Problem with bash-3.2 patch

Dan Nicholson dbn.lists at gmail.com
Thu Mar 15 13:12:11 PDT 2007


On 3/15/07, Jens Stroebel <drifter at bcsoft.de> wrote:
> On Thu, Mar 15, 2007 at 01:11:31PM +0100, Jens Stroebel wrote:
>
> > Reading your posts, I got and applied the above-mentioned patch;
> > contrary to what I expected, [[ $test =~ $regexpr ]] worked, whereas
> >  [[ "$test" =~ "$regexpr" ]] did not. See below:
> >
> > =============================================================================
> > root at matthew:/usr/src/rpm> if [[ "sploerp" =~ "s.*rp" ]] ; then echo yes ; fi
> > root at matthew:/usr/src/rpm> if [[ sploerp =~ s.*rp ]] ; then echo yes ; fi
> > yes
> > =============================================================================
>
> Following up my own post, sorry, but I thought the above incomplete after
> a bit more testing:
>
> It seems like it's OK to "" the left side of the comparison,
> but not the regex which should be matched:

Jens, if you think this is a bug, it would be great if you could ask
on bug-bash. The worst that can happen is that they tell you it's not
a bug. Actually, it looks like this has happened already, and you have
to be careful with bash-3.1 v. 3.2 when using quotes on the rhs.

http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00017.html

--
Dan



More information about the lfs-dev mailing list