[Top][All Lists]

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

Re: RFE: allow double quotes to group multi-words & be treated as 1 arg,

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 23:56:20 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100228 Lightning/0.9 Thunderbird/ Mnenhy/

On 8/4/2010 10:07 PM, Chet Ramey wrote:
> On 8/4/10 8:31 AM, Greg Wooledge wrote:
>> In fact, putting the ERE-pattern you want to match against into a variable
>> and then using =~ $variable *is* the recommended practice, if you need to
>> use =~ at all.  It is the only way to get consistent results among all
>> the different releases of bash that have =~, since the behavior changed
>> multiple times during the 3.x series.
> All this is true (as is the text I removed), except that the behavior
> changed only once: to make quoted text remove any special meaning of
> the quoted characters to the regular expression matcher.
> Backwards compatibility, of course, means never having to say you're sorry,
> but it also means that you never get to fix anything.  The behavior change
> fixed a problem, as I saw it, with the initial implementation.  Without
> this change, there is no clean way to match a literal character that has a
> special meaning as a regexp operator.
> Chet
Couldn't you have limited to single quotes -- reserving to them the
function of literalizing what is between them.

Otherwise, could you think other characters you'd prefer to use to
group words separated by white-space, together to be matched in a pattern?

Or, why should double quotes be functionally the same as single quotes 
in that situation?

reply via email to

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