Hi, Not sure when this stopped working, because I'm sure it used to. 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 Try `rsh --help' for more information. rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/tmp/rsync-2.6.2/io.c(342) ~-12=> 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 Anthony This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of J.P. Morgan Chase & Co., its subsidiaries and affiliates.
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 syntax. You will have to write an rsh wrapper. This will probably do: #!/bin/sh #rsh4rsync - wrapper to insert "--" host=$1 shift if [ "$1" = "-l" ] then rshargs="$1 $2" shift;shift fi exec rsh $host $rshargs -- $@ I don't think rsync ever adds more than a -l user (taken from user@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 hosed. Tim Conway Unix System Administration Contractor - IBM Global Services desk:3032734776 conway@us.ibm.com 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
On Thu, Jun 03, 2004 at 05:43:28PM -0400, Anthony Heading wrote:> This is the cygwin build of rsync, with the standard cygwin > rsh (which is a fairly old GNU inetutils 1.3.2).A few months ago cygwin switched their getopt code (when they added getopt support to their library, I think) and this made several utilities break like this -- e.g. it also affected ssh (but I managed to talk them out of such a broken behavior). I believe that having rsh behave this way is also a cygwin bug because it is silly to have a tool that is accepting a command-line reorder the to-run command's options prior to the command (and the rsh utilities on other OSes don't do this). I'd recommend complaining to the cygwin folks about it. I suppose I could have rsync export the environment variable POSIXLY_CORRECT, but that just seems to rub me the wrong way. ..wayne..