From 3580b6dc5e4a68983891b242839b8027e423c1cb Mon Sep 17 00:00:00 2001 From: Yanbing Date: Mon, 14 Jan 2019 12:53:34 -0800 Subject: [PATCH] Updated Remote command line escaping rules (markdown) --- Remote-command-line-escaping-rules.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Remote-command-line-escaping-rules.md b/Remote-command-line-escaping-rules.md index 761dd89..1d1fefe 100644 --- a/Remote-command-line-escaping-rules.md +++ b/Remote-command-line-escaping-rules.md @@ -1,13 +1,12 @@ 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 | DefaultShellEscapeArguments |Example to print out "hello"
(client cmd run in cmd prompt)| Notes | -|:--|:--|:--|:--| -| powershell | N/A | ``c:\>ssh.exe localhost echo `\"hello`\"`` | PS strip the " | -| bash | N/A | to be added | | -| cygwin | N/A | to be added | | -| cmd.exe | N/A | `c:\>ssh.exe localhost echo \"hello\"` | | -| ssh-shellhost.exe | N/A | to be added | | -| shells other than above | 1, not set | | | -| shells other than above | 0 | | | +| 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"'``
or ``echo \"hello\"``| ``c:\>ssh winbox 'echo \"hello\"'``
or `c:\>ssh.exe winbox echo \\\"hello\\\"`
or `c:\>ssh winbox echo '\"hello\"'` | +| cygwin | ``echo '"hello"'``
or ``echo \"hello\"``| ``c:\>ssh winbox 'echo \"hello\"'``
or `c:\>ssh.exe winbox echo \\\"hello\\\"`
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. \ No newline at end of file