[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 chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., (continued)
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Pierre Gaston, 2010/09/20
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Linda Walsh, 2010/09/21
- Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Greg Wooledge, 2010/09/21
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Linda Walsh, 2010/09/22
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Dennis Williamson, 2010/09/22
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Marc Herbert, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Pierre Gaston, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Linda Walsh, 2010/09/23
- Re: RFE: request for grouping mechanism to work in double brackets where otherewise illegal, Pierre Gaston, 2010/09/24
Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Linda Walsh, 2010/09/17
Re: RFE: request for quotes as grouping operators to work in brackets as elsewhere., Jan Schampera, 2010/09/18