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:35:59 -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:36 PM, Linda Walsh wrote:

> t='one two three'
> a='one two three'
> 1) if [[ $t == $a ]]; then echo 'Matches'; fi
> 2) if [[ $t == "$a" ]]; then echo 'Matches'; fi examples.
> 
> The above does match.  the pattern in $a matches the pattern
> in $t whether it is in quotes or not.
> 
> But with =~ it is different:
> t='one two three'
> a='one t.. three'
> 3) if [[ $t =~ $a ]]; then echo 'Matches'; fi
> 4) if [[ $t =~ "$a" ]]; then echo 'SHOULD Match'; else echo 'BUG, double
> quotes disable match'; fi
> 
> They don't behave the same.

I can't understand why you think the two values of `a' are equivalent.
Since they're not equivalent, how can you claim the behaviors should
be identical?

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



reply via email to

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