Ulrich Mueller wrote:

> But both sides of [[ ]] aren't symmetric, in the first place:
> 
> # When the == and != operators are used, the string to the right of
> # the operator is considered a pattern and matched according to the
> # rules described below under Pattern Matching.
> 
> So there's almost never a reason for quoting the left-hand side, while
> on the right-hand side quotes will suppress pattern matching.
> 
> (Of course, in the example above it doesn't matter, because the string
> doesn't contain any special characters.)
> 
Indeed; minor addition: the above applies to [[ foo = bar* ]] as well,
ie you don't have to use == (and most BASH scripters don't.) It's the fact 
that you're in [[ which triggers fnmatch() behaviour.

-- 
#friendly-coders -- We're friendly, but we're not /that/ friendly ;-)



Reply via email to