-e escape rule

Kevin Korb kmk at sanitarium.net
Sat Oct 29 02:41:56 UTC 2016

A \  is a shell escape.  Every level of shell consumes one level of
escape.  For every session of a shell every example "\ " becomes " " and
every example of "\\" becomes "\".

The raync command line is a mix of local shell commands + commands run
via a remote shell via ssh.

The simple fact is that if only \ escapes are used, the local shell will
utilize those escapes and rsync will never see them.

For every level of shell an escape \ does its job.

If you want rsync to interpret a space char as other than whitespace
then a \ is one way to do so.

But one we are talking about the other side of an rsync we are talking
about a local command line that consumes a \.  Then we are talking about
a remote command line that consumes another \.  So, within the -e
parameter, multiple stacked \ characters are required.

Simply put, it is absolutely absurd to \ escape an rsync command line
while interpreting the subshell -e parameter and the remote shell
parameters the same way.

At best you are insisting that ssh do something entirely nonsensical
while ensuring that the first s in "ssh" is interpreted as an "s".

On 10/28/2016 10:10 PM, Wayne Davison wrote:
> On Fri, Oct 28, 2016 at 5:39 AM, Samuel Williams
> <space.ship.traveller at gmail.com <mailto:space.ship.traveller at gmail.com>>
> wrote:
>     Rsync passed the backslashes through without dealing with them.
> Yeah, it only does space-splitting and that's all it will ever do. It
> still looks to me like there is a bug in the original escaping, since
> any command receiving that string is receiving a backslash that is not
> supposed to be there. It should only be escaping the string enough to
> get it to rsync, not trying to guess what rsync is going to do with it
> after it gets it.
> To work around that bug, you could consider using an ssh-calling shell
> script instead of manually specifying the ssh command and args to rsync.
> ..wayne..

	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/rsync/attachments/20161028/faff998c/signature.sig>

More information about the rsync mailing list