-e escape rule

Francis.Montagnac at inria.fr Francis.Montagnac at inria.fr
Sun Nov 20 19:55:56 UTC 2016


Hi

On Sun, 30 Oct 2016 20:06:00 +1300 Samuel Williams wrote:

> But it's also a surprise that backslash escape sequences don't work
> according to intuition of how commands are normally executed. If you
> supplied the string in -e to system, it would work as expected..

> Unfortunately, this is the default when using Shellwords.join in Ruby.
> So, I had to write a custom RSync "join" function to produce an
> appropriate command for -e argument.

I guess you are building from ruby a single string for the whole rsync
command, and that you give it to the system ruby command.

If this is it, it would be simpler to build instead an array of
strings and to call system with this array as arguments.

This way, ruby will call directly rsync without calling an extra shell
and you will not have to re-quote the arguments, in particular the one
for -e.

Francis



More information about the rsync mailing list