How can I set the compatibility level in Bash 4?
Issue
Some bash scripts that worked correctly on Red Hat Enterprise Linux 4 and 5 are not working since we upgraded to version 6. A script like the following used to work on versions prior to bash version 4.x shipped in RHEL 6:
$ [[ "20110228" =~ '^[0-9]{8}$' ]] && echo matches
$
In previous bash versions it printed matches
Environment
- Red Hat Enterprise Linux 6
- Bash 4.X
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.