bug-bash
[Top][All Lists]
Advanced

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

Re: Conditional Regexp matching problem in 3.2


From: Kevin F. Quinn
Subject: Re: Conditional Regexp matching problem in 3.2
Date: Tue, 23 Jan 2007 19:50:53 +0100

On Tue, 23 Jan 2007 11:04:58 -0500
Chet Ramey <chet.ramey@case.edu> wrote:

> One of the changes between bash-3.1 and bash-3.2 was to unify the
> handling of the pattern in the `==' and `=~' conditional command
> operators.  Pattern characters on the rhs are quoted to represent
> themselves (remove their special pattern meaning).  This is how ==
> has always worked.

I don't get this; I must be missing something.  If I do, in bash-3.1:

$ V="alphabet"
$ [[ $V == alphabet ]] && echo yes
yes
$ [[ $V == "alphabet" ]] && echo yes
yes
$ [[ $V == 'alphabet' ]] && echo yes
yes
$ [[ $V =~ alphabet ]] && echo yes
yes
$ [[ $V =~ "alphabet" ]] && echo yes
yes
$ [[ $V =~ 'alphabet' ]] && echo yes
yes
$

yet if I try the same in 3.2:

$ V="alphabet"
$ [[ $V == alphabet ]] && echo yes
yes
$ [[ $V == "alphabet" ]] && echo yes
yes
$ [[ $V == 'alphabet' ]] && echo yes
yes
$ [[ $V =~ alphabet ]] && echo yes
yes
$ [[ $V =~ "alphabet" ]] && echo yes
$ [[ $V =~ 'alphabet' ]] && echo yes
$

which to me looks like the two operators are not treating quotes the
same way.

-- 
Kevin F. Quinn

Attachment: signature.asc
Description: PGP signature


reply via email to

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