bug-bash
[Top][All Lists]
Advanced

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

Re: RFE: request for quotes as grouping operators to work in brackets as


From: Chet Ramey
Subject: Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere.
Date: Fri, 17 Sep 2010 22:31:05 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2

On 9/17/10 8:20 PM, Linda Walsh wrote:
> 
> 
> Andreas Schwab wrote:
>> Linda Walsh <bash@tlinx.org> writes:
>>
>>>   Or another disparity:  C.
>>> t='one two three'
>>> c='one two three'
>>> 1) if [[ $t == $a ]]; then echo 'Matches'; fi
>>> 2) if [[ $t == "$a" ]]; then echo 'Matches'; fi
>>> So, the expressions match whether or not $a is in double quotes or not
>>> (single quotes would not match, as the $a would be taken literally).
>>
>> Set a='one * three' and try again.
> ----   
>     Why?   How would that be any different than case B4 & B5 that I already
> showed?

I'm not sure you are understanding the difference between one case that
does not include any special pattern characters (what you're using with
==) and one that does (what you're using with =~).  Since the quoting
disables the special meaning of pattern characters, how can you claim
that your examples are equivalent?

>>> Quoting should not disable RE matching.

That's what you're asserting.  You're certainly entitled to do so.  Since
quoting does also disable pattern matching when using ==, however, you
can't use alleged inconsistency as an argument.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]