I checked the expressions, using 'echo $whatever' in my bash, whose version string is: GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc.
All behaved without extra quote marks or whatever. So, Amos - please let us know which shell and version did you use for 'sh'. --- Omer On Fri, 2008-12-05 at 09:58 +1100, Amos Shapira wrote: > I've been doing shell programming for years but this got me stomped > (simplified version): > > rsync="/usr/bin/rsync -navHz --delete --delay-updates --bwlimit=256 -e > 'ssh -i /root/rsync.id'" > local=/mnt/data/html/minicpan > copyto="test01:$local" > $rsync $local/ $copyto/ > > When I execute this script with "sh -vx" the final lines are: > > $rsync $local/ $copyto/ > + /usr/bin/rsync -navHz --delete --delay-updates --bwlimit=256 -e > ''\''ssh' -i '/root/rsync.id'\''' /mnt/data/html/minicpan/ > test01:/mnt/data/html/minicpan/ > Missing trailing-' in remote-shell command. > rsync error: syntax or usage error (code 1) at main.c(361) [sender=3.0.4] > > It looks like the shell splits the value of "$ssh" into words and adds > quoting around them. > > The rsync command line I'd like to see is: > > /usr/bin/rsync -navHz --delete --delay-updates --bwlimit=256 -e ''ssh > -i /root/rsync.id'' /mnt/data/html/minicpan/ > test01:/mnt/data/html/minicpan/ > > But whatever I tried so far playing with single quotes or back-slashes > I haven't managed to make the shell do that. > > What am I missing? -- Philip Machanick: "caution: if you write code like this, immediately after you are fired the person assigned to maintaining your code after you leave will resign" My own blog is at http://www.zak.co.il/tddpirate/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]