Alexis Huxley wrote:

Bash Version: 3.2
Patch Level: 39
Release Status: release

Description:
        [[ ... =~ ... ]] is broken when RHS is quoted

The behavior changed, intentionally, between bash-3.1 and bash-3.2.

        #  As described by OP, =~ has stopped working:
        lasagne$ bash -c '[[ "apple" =~ "^(apple)" ]]; echo ${BASH_REMATCH[1]}'
                <--- no output!

And this is how.  Quoting any part of the rhs forces it to be matched
as a string.

Patch 39, which you appear to have applied, introduces a `compat31' shell
option which you may enable to restore the bash-3.1 behavior.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to