https://bugzilla.mindrot.org/show_bug.cgi?id=2563
--- Comment #3 from Pascal Bourguignon <[email protected]> --- I've identified the reason of the observed behavior: bash -c takes a single command (as documented), but if it is followed by arguments, then they are used as "command line arguments", assigned to $0 $1 ... For example: $ bash -c 'echo $0 $@' foo \; echo bar foo ; echo bar $ so: ssh ... bash -c 'echo foo;echo bar' sends and executes remotely: bash -c echo foo ; echo bar with: bash -c echo foo assigning foo to $0 (no other command line argument), bash executing therefore just 'echo'. Then something strange occurs, since it seems that the following ; echo bar gets evaluated somehow (probably by a shell forked by ssh on the remote side). The whole situation is messy, and I definitely think that ssh should either concatenate the arguments to make a single command to be executed remotely, or it should signal an error when it's given additionnal arguments, instead of forwarding them to the remote side to be processed in ways that are not very strictly controlled, documented or well known. -- You are receiving this mail because: You are watching the assignee of the bug. _______________________________________________ openssh-bugs mailing list [email protected] https://lists.mindrot.org/mailman/listinfo/openssh-bugs
