On Mon, Feb 14, 2011 at 9:14 AM, Greg Wooledge <wool...@eeg.ccf.org> wrote: > On Mon, Feb 14, 2011 at 09:03:34AM -0600, Dennis Williamson wrote: >> I'm having a discussion with someone who claims that for them on Bash >> 4.0.33, with compat31 *off*, they are getting 3.1 behavior with quoted >> patterns in a =~ match. > >> Are there any other circumstances that could >> produce this behavior? > > The most obvious would be that the script is actually being run by > bash 3.1. Have him/her do something like echo $BASH_VERSION inside the > script to be sure. >
I was hoping for something less obvious. (Well not actually hoping.) The user is performing this from a shell prompt. I had him try [[ $BASH_VERSION =~ "4\.0" ]] && echo yes || echo no which should output "yes" only if he's using Bash 4.0 *and* compat31 is on. He says the output is "yes", but that shopt -p compat31 says "shopt -u compat31". I think he's messing with me, unless there's something else going on. Can you suggest any other tests or any scenarios where this might occur?