On Wed, Mar 14, 2007 at 03:20:05PM -0700, Dan Nicholson wrote:
> On 3/14/07, Richard Gill <[EMAIL PROTECTED]> wrote:
> >
> > In the latest development branch (SVN-20070314), the
> > bash-3.2-fixes-2.patch creates a problem in bash, as regular
> > expression matches in conditionals don't work anymore :
> >
> > [[ $test =~ $regexpr ]]
> >
> > always returns 1 in $?.
> > Tested without the patch, all works fine. I saw a 'protection' fix in
> > the patch (look for COND_REGEX) ; I guess the problem is there. I
> > don't have any fix for the patch for now, and not sure to be able to
> > do so.
> 
> There's a new upstream patch that's supposed to fix the regex
> operator, but only when " are used. You can at least give that a shot.
> The LFS patch includes fixes 001-009.
> 
> http://ftp.gnu.org/gnu/bash/bash-3.2-patches/bash32-010


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:

=============================================================================
[EMAIL PROTECTED]:/usr/src/rpm> if [[ "sploerp" =~ "s.*rp" ]] ; then echo yes ; 
fi
[EMAIL PROTECTED]:/usr/src/rpm> if [[ sploerp =~ s.*rp ]] ; then echo yes ; fi
yes
=============================================================================

                        greets,
                          Jens
-- 
[EMAIL PROTECTED]
                23.....56.......drifting
By caffeine alone I set my mind in motion, By the beans of Java
do thoughts acquire speed,  hands acquire shaking,  the shaking
becomes a warning, By caffeine alone do I set my mind in motion
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to