remote command word splitting

Bob Proulx bob at
Fri Dec 3 12:02:41 EST 2004

frederik at wrote:
> $ perl -le 'die "hi"'
> hi at -e line 1.
> $ ssh some-host perl -le 'die "hi"'
> Died at -e line 1.
> (The remote perl program executed differently because ssh split the
> eval text into separate arguments)

Not that this is really any help but seeing this discussion I thought
I would throw this in.

  echo echo one two three | ssh some-host sh

By using stdin to a shell I get two benefits.  I always get the same
shell regardless of the account's login shell.  I have a more
predictable, and to me easier to deal with, number of quoting layers
that need to be done.  YMMV and all of that.


More information about the openssh-unix-dev mailing list