mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-21 21:14:51 +02:00
Updated Remote command line escaping rules (markdown)
parent
3580b6dc5e
commit
c4a548ae1c
11
Command-line-support-for-various-shells.md
Normal file
11
Command-line-support-for-various-shells.md
Normal file
@ -0,0 +1,11 @@
|
||||
Here are examples to run commands on remote shell over openssh. Examples are to print out "hello" remotely.
|
||||
|
||||
| DefaultShell | cmd on local shell | cmd to print on remote shell (client cmd run in cmd prompt) |
|
||||
|:--|:--|:--|
|
||||
| powershell | echo `'"hello"'`<br/> or ``echo `"hello`"`` |`c:\>ssh.exe localhost echo '\"hello\"'` <br/> or ``c:\>ssh.exe winbox echo `\"hello`\"``<br> or ``c:\>ssh.exe localhost "echo `""hello`"""`` |
|
||||
| bash | ``echo \"hello\"``<br/> or ``echo '"hello"'``| ``c:\>ssh winbox 'echo \"hello\"'``<br/> or `c:\>ssh.exe winbox echo \\\"hello\\\"` <br/> or `c:\>ssh winbox echo '\"hello\"'` |
|
||||
| cygwin | ``echo \"hello\"``<br/> or ``echo '"hello"'`` | ``c:\>ssh winbox 'echo \"hello\"'``<br/> or `c:\>ssh.exe winbox echo \\\"hello\\\"` <br/> or `c:\>ssh winbox echo '\"hello\"'` |
|
||||
| cmd.exe | `echo "hello"` | `c:\>ssh.exe winbox echo \"hello\"`<br/> or `c:\>ssh.exe winbox "echo ""hello"""` |
|
||||
| ssh-shellhost.exe | to be added | to be added |
|
||||
|
||||
If you have a shell other than above and want it to receive exactly the same argument list that the ssh received on the server side, Please refer to [DefaultShell](https://github.com/PowerShell/Win32-OpenSSH/wiki/DefaultShell) for setting DefaultShell and set DefaultShellEscapeArguments to 0.
|
@ -1,12 +0,0 @@
|
||||
OpenSSH follow the below rules to determine if the " and \ in shell arguments are escaped or not
|
||||
Here are examples to print out "hello" on different shells
|
||||
|
||||
| DefaultShell | cmd to print on local shell | cmd to print on remote shell (client cmd run in cmd prompt) |
|
||||
|:--|:--|:--|
|
||||
| powershell | ``echo `"hello`"`` |``c:\>ssh.exe winbox echo `\"hello`\"`` |
|
||||
| bash | ``echo '"hello"'``<br/> or ``echo \"hello\"``| ``c:\>ssh winbox 'echo \"hello\"'``<br/> or `c:\>ssh.exe winbox echo \\\"hello\\\"` <br/> or `c:\>ssh winbox echo '\"hello\"'` |
|
||||
| cygwin | ``echo '"hello"'``<br/> or ``echo \"hello\"``| ``c:\>ssh winbox 'echo \"hello\"'``<br/> or `c:\>ssh.exe winbox echo \\\"hello\\\"` <br/> or `c:\>ssh winbox echo '\"hello\"'` |
|
||||
| cmd.exe | `echo "hello"` | `c:\>ssh.exe winbox echo \"hello\"` |
|
||||
| ssh-shellhost.exe | to be added | to be added |
|
||||
|
||||
Please refer to [DefaultShell](https://github.com/PowerShell/Win32-OpenSSH/wiki/DefaultShell) for setting DefaultShell and DefaultShellEscapeArguments.
|
Loading…
x
Reference in New Issue
Block a user