Re: Why are the arguments supplied for the command run through ssh interpreted by shell before they are passed to the command on the server side?

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

 



On Sat, 11 Jan 2020, Yuri wrote:

> On 2020-01-11 09:07, Thorsten Glaser wrote:
> > Yes, “command1” is expanded remotely, but you use the quoting rules
> > of the remote shell INSIDE the single quotes for the local POSIX shell
> > to prevent that (just replace all ' with '\'' and you’re set).
> 
> It arrives to the remote host with the outer quotes stripped, and the
> expansion takes place.

No, it doesn’t.

$ ssh localhost 'echo "a  string with '\'' and" '\''$pecial ch`aracters'\''  works'
a  string with ' and $pecial ch`aracters works

The command that gets run remotely is:
	echo "a  string with ' and" '$pecial ch`aracters'  works

This is handled according to normal quoting rules on the remote side,
as if you entered it interactively.

bye,
//mirabilos, shell developer (so knows what he’s saying)
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
_______________________________________________
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