|
From: | Linda Walsh |
Subject: | Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~ |
Date: | Wed, 04 Aug 2010 02:02:39 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 |
Oi vey. Is that the only thing that will be affected by shopt -s compat31? Or perhaps that shopt needs to be a bit more specific. > So your example would have worked with "shopt -s compat31". > >From the file COMPAT: 33. Bash-3.2 adopts the convention used by other string and pattern matching operators for the `[[' compound command, and matches any quoted portion of the right-hand-side argument to the =~ operator as a string rather than a regular expression. ... Other string operators? What other ones operate this way? This is what I'm referring to: a="hi" if [[ "hi" == "$a" ]]; then echo "this matches"; fi if [[ 'hi' == '$a' ]] then echo "this doesn't"; fi I would prefer this work: a="h." if [[ "hi" =~ "$a" ]];.... That would make "sense" though I'm not sure what other string operators we are trying to be consistent with. Foolish consistency is the hobgoblin of small minds.
[Prev in Thread] | Current Thread | [Next in Thread] |