bug-bash
[Top][All Lists]
Advanced

[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: Chet Ramey
Subject: Re: RFE: allow double quotes to group multi-words & be treated as 1 arg, w/DQ's stripped off -- including RH =~
Date: Thu, 05 Aug 2010 01:07:26 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1

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
-- 
``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]