Invoking rsync from a script with null parameters

Joe josephj at main.nc.us
Mon Nov 5 09:31:13 MST 2012


On 11/05/2012 03:22 AM, Voelker, Bernhard wrote:
> Joe wrote (Monday, November 05, 2012 4:23 AM):
>
>> To avoid having a number of slightly different rsync commands, I would
>> like to use shell variables as part of the rsync command.  I.e.:
>> DRYRUN="-n"
>> rsync "${DRYRUN}" more parameters ...
> Just omit the quotes (and in this case you can
> also omit the curly braces):
>
>  $ rsync $DRYRUN more parameters ...
>
> Have a nice day,
> Berny
Thanks.  Blindingly obvious, so I didn't see it.

I almost always put the curly braces in. They don't hurt anything and if
I modify a script later, variables are protected from being accidentally
renamed by something getting concatenated to them.

However, it still looks like rsync did something unexpected that it
probably should not have done.

Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20121105/834d18ed/attachment.html>


More information about the rsync mailing list