[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash 3.2 match operator problem
From: |
Chet Ramey |
Subject: |
Re: bash 3.2 match operator problem |
Date: |
Thu, 12 Oct 2006 10:40:19 -0400 |
> Machine Type: i586-pc-linux-gnu
>
> Bash Version: 3.2
> Patch Level: 0
> Release Status: release
>
> Description:
> I just upgraded to bash 3.2 and my scripts quit working for matching.
> The test case below will say 'Life is good' in bash 3.1.17, but on bash
> 3.2 I get 'Upgrade of doom returns 2 from match' instead.
[...]
> [[ "${OLDCANDIDATE}" =~ "([^-]+)-([^-]+)-([^-]+)-0*([1-9][0-9]*)\.tgz" ]]
This is from the list of new features in bash-3.2:
f. Quoting the string argument to the [[ command's =~ operator now forces
string matching, as with the other pattern-matching operators.
The change was made for consistency -- without it, there is no way to have
the string matched without regard to characters significant to the matcher.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU chet@case.edu http://tiswww.tis.case.edu/~chet/