remote command word splitting

Frederik Eaton frederik at
Thu Dec 2 14:14:50 EST 2004

Ah, I misunderstood where the splitting was done, sorry.

Hmm. So, while I'm no longer as enthusiastic as I was about this idea,
I still wonder if it wouldn't be cleaner if there were a way to get
ssh to preserve the separation between remote command arguments
itself, rather than asking the user to do protective quoting. How
about an option to ask ssh to use 'execvp' rather than a shell? Then I
could do

Q=(-E sh -c '"$@"' --)
ssh some-host $Q perl -le 'die "hi"'

Anyway, just a suggestion.

Thanks for the responses,


On Thu, Dec 02, 2004 at 10:02:03AM +1100, Darren Tucker wrote:
> Damien Miller wrote:
> >Maybe the way that ssh reconstructs the argument string to send to the
> >server could be changed to insert quotes around arguments with spaces in
> >them, but that would require ssh to examine the commands themselves.
> There's no guarantee that the shell on the server is going to understand 
> quotes the same way the client does, either.  What are the quoting rules 
> for Windows?  VMS?  OS/390?  NetWare?  etc...
> >I don't think that this is acceptable because it means that ssh would
> >magically muck with your command behind your back. I have no doubt that
> >this would break people's scripts.
> Agreed.
> -- 
> Darren Tucker (dtucker at
> GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
>     Good judgement comes with experience. Unfortunately, the experience
> usually comes from bad judgement.

More information about the openssh-unix-dev mailing list