The first command of a nested compound command receives no arguments

Parke parke.nexus at gmail.com
Mon Oct 22 05:27:17 AEDT 2018


> On Sun, Oct 21, 2018 at 10:21:56AM -0700, Parke wrote:
> > Where is it documented that ssh is going to eval my command?  The fact
> > remains that ssh does not transparently pass the command to the remote
> > host.

On Sun, Oct 21, 2018 at 10:30 AM Gert Doering <gert at greenie.muc.de> wrote:
> This is not a *ssh* thing, but a generic "how does quoting on unix work
> if two levels of shell are involved".

It is not obvious (at least to me), nor is it documented (that I can
find), that ssh should be thought of as a shell.  Neither the
OpenSSH.com homepage nor the ssh manpage describe ssh as a shell.

If the ssh protocol could pass argv-style string lists (and this is
certainly technically possible), the protocol could be transparent and
command flattening could be avoided.

I claim the current behavior can be unexpected and is undocumented.

The current manpage describes:

ssh [snip] [user@]hostname [command]

I believe the manpage could improved to describe:

ssh [snip] [user@]hostname [command [arg ...]]

After all, ssh *does* accept commands with extra arguments.  (ssh
could exit with an error instead of accepting extra arguments.)
However, the current manpage fails to describe how those extra
arguments will be relayed to the remote host.

Cheers,

Parke


More information about the openssh-unix-dev mailing list