Re: command [argument ...] in ssh(1): a footgun

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



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
local shell.

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, !.
...
       The backslash
       retains its special meaning only when followed by one of the  fol-
       lowing  characters:  $, `, ", \, or <newline>.

Other shells may be different, of course.

Regards,

Brian.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux