Hardy Release Notes should note upgrade to Bash 3.2 changes regex syntax
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Ubuntu Website - OBSOLETE |
Undecided
|
Unassigned | ||
| | bash (Ubuntu) |
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: bash
The following regular expression should work in bash (and used to work in Edgy), but no longer does:
if [[ "foo.tex" =~ '^(.*)\.tex$' ]]
then
file=
echo "File is: $file"
else
echo "Not a TeX file"
fi
It appears that regular expressions using the dot, star, carat and dollar-sign metacharacters no longer work.
| Robert (robrwo) wrote : | #2 |
Well, it looks like that did affect it, according to a
http://
Basically, the single quotes surrounding the regex become part of the regex. So the above code becomes:
if [[ "foo.tex" =~ ^(.*)\.tex$ ]]
then
file=
echo "File is: $file"
else
echo "Not a TeX file"
fi
That's a pretty significant change. A lot of scripts will be broken. More warning should have been given to users about this.
| Robert (robrwo) wrote : | #3 |
The release notes at http://
| Johnathon (kirrus) wrote : Re: Feisty Release Notes should note upgrade to Bash 3.2 changes regex syntax | #4 |
Confirming
| Changed in bash: | |
| status: | Needs Info → Confirmed |
| Johnathon (kirrus) wrote : | #5 |
Not needed on the bash lists, site issue only.
| Changed in ubuntu-website: | |
| status: | Unconfirmed → Confirmed |
| Changed in bash: | |
| status: | Confirmed → Rejected |
| Robert (robrwo) wrote : | #6 |
I do wonder if a version of Bash 3.1 should be included as an option in the distro. The change was unexpected and enough to hurt me at least one script that I wrote, and may be the cause of problems I've hard with an install script from a third party which kept insisting that I did not have prereqs installed which I did (it was paring the output of --version calls).
I suspect this is affecting a few people who run Ubuntu server. There should at least be an option for them to downgrade to an earlier version of bash to lessen the burden.
| Johnathon (kirrus) wrote : Re: Feisty Release Notes should note upgrade to Bash 3.2 changes regex syntax | #7 |
I would recommend adding a new bug. Mail me the number, and I'll confirm
it, we have been affected by a problem with the bash upgrade as well.
(Firehol is not able to work with bash 3.2. There is a sneaky
workaround, but it's not good.)
| Robert (robrwo) wrote : Re: Feisty Release Notes should note upgrade to Bash 3.2 changes regex syntax | #8 |
I've just added Bug #110407
| Robert (robrwo) wrote : | #9 |
This needs to be documented for the LTS release of Hardy. If Bus #110407 is acted on, then users will have an alternative.
| Changed in ubuntu-website: | |
| assignee: | nobody → ubuntu-websites |
| Jamie (ubuntu-websites) wrote : | #10 |
This should not have been assigned to me. I am not part of the programming project. It should be assigned to someone else.
| Jamie (ubuntu-websites) wrote : | #11 |
This shouldn't have been assigned to me. I am not related to this project.
| Changed in ubuntu-website: | |
| assignee: | ubuntu-websites → robrwo |
| Changed in ubuntu-website: | |
| assignee: | robrwo → ubuntu-website |
| Robert (robrwo) wrote : | #12 |
Is someone going to act on this? It shouldn't be too difficult to add a note to the website and release notes warning users about potential problems.
| Johnathon (kirrus) wrote : | #13 |
try emailing <email address hidden>, and point them at this bug.
| Johnathon (kirrus) wrote : | #14 |
Not a problem anymore - bashrc patched.
| Changed in ubuntu-website: | |
| assignee: | ubuntu-website → nobody |
| status: | Confirmed → Invalid |

The feisty move upgraded bash from Bash 3.1 to 3.2. Would this have had an effect on your script? (i.e. has the regex stuff been changed in the newer bash?)