rsync 2.6.2 doesn't work with GNU inetutils rsh

Tim Conway conway at
Fri Jun 4 16:35:24 GMT 2004

A few weeks ago, I corrected a guys commandline, wherein a flag came after 
a directory specification, and was informed that new libraries rearrange 
ARGV.  I was somewhat abashed, not having known that, but also thought 
that was a really stupid idea.  Now we have to do kludgy workarounds in 
order to accomodate users who are too stupid to understand a simple 

You will have to write an rsh wrapper.
This will probably do:


#rsh4rsync - wrapper to insert "--"
if [ "$1" = "-l" ]
    rshargs="$1 $2"
exec rsh $host $rshargs -- $@

I don't think rsync ever adds more than a -l user (taken from 
user at host:path) to the transport commandline.
No guarantees.  I wrote that in here, and haven't tested it.
Now, if sh's argument parser starts fscking with your commandline, you're 

Tim Conway
Unix System Administration
Contractor - IBM Global Services
conway at

This is the cygwin build of rsync, with the standard cygwin
rsh (which is a fairly old GNU inetutils 1.3.2).

~=> rsync --rsh=rsh -vv bibble:
opening connection using rsh bibble rsync --server --sender -vvr . 
rsh: unknown option -- server

As it helpfully explains, rsh is grabbing all the arguments intended for
the remote rsync command.

With GNU rsh,  it seems necessary to add a '--' to provide a limit:

rsh bibble ls -l     :   error from rsh
rsh bubble -- ls -l  :   works fine

More information about the rsync mailing list