On 27/05/2023 01:45, Thorsten Glaser wrote:
ssh user@host "ls -l a\ b"
This one, incidentally, sends 'ls -l a b' to the remote shell.
ssh user@host "ls -l a\\ b"
has the effect you want; the first backslash is eaten by the
Or is it?
$ echo "ls -l a\ b"
ls -l a\ b
This is with bash 5.2.15. From the man page:
Enclosing characters in double quotes preserves the literal value
of all characters within the quotes, with the exception of $, `,
\, and, when history expansion is enabled, !.
retains its special meaning only when followed by one of the fol-
lowing characters: $, `, ", \, or <newline>.
Other shells may be different, of course.
openssh-unix-dev mailing list