Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Rsync exclusion question



On Thu, Jun 11, 2009 at 11:55 AM, Josh Glover<jmglov@example.com> wrote:
> 2009/6/11 Doug McLean <dmclean635@example.com>:
>
>> By using single-quotes, the shell would defer interpolation of the
>> file-exclusion to the rsync command itself.  In other words, defer and
>> let rsync sort things out, which is as it should be.
>
> Well, I am definitely missing something about how interpolation works,
> since I cannot reproduce the expansion of the * wildcard. I'm fairly
> certain I've been bitten by this at some point, however, and that is
> why I started always single-quoting * and ?.
>
> I think the Best Practise to always use non-interpolating quotes
> unless you know you need interpolation is the way to go. That way, you
> don't need to understand the interpolation rules of your programming
> language all the way down to the metal.

For what it's worth, the double-quotes worked correctly on the
command-line, but didn't in the script.  So, not sure if that weighs
in on the issue, or the use of 'env' in executing the script.

In any case, I think that's sound advice: use of non-interpolating
quotes reduces the complexity of what you're trying to do.

-- 
Doug McLean

Blog: http://nihonshukyo.wordpress.com/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links