On 11/20/2016 02:55 PM, francis.montag...@inria.fr wrote:
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

A couple of years ago I was having somewhat similar problems building an rsync command in bash and someone on this list suggested exactly the same solution. It really makes things simpler - and easier to read/maintain.

Joe

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to