Bob Proulx wrote:
> Chet Ramey wrote:
>> Peter Volkov wrote:
>>> Please CC my email to answers as I'm not subscribed to the list.
>>> $ [[ "string" =~ "[a-z]" ]] && echo something
>>> something
>> ...
>> The real question is whether or not quoting the pattern should work as
>> it does with other [[ pattern matching operators, which is to quote any
>> characters special to the matching engine.  I think it should, for
>> consistency.
> 
> Could you give an example of how you think it should work?  (Just
> curious and trying to keep up.)

The documentation for [[ says this about the == and != operators,
which take patterns as the right-hand side:

        Any part of the pattern may be quoted to force it to
        be matched as a string.

It seems reasonable that quoting any part of the rhs to the =~
operator should cause it to behave in the same manner.

Since the arguments to [[ don't undergo any of the expansions that
require quoting to protect them, there's no reason for =~ to act
differently than the other operators that do pattern matching.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to