Hi,

when the option compatXX iss et through BASHOPTS, shopt will report it tob e 
set, but it is not applied.
A simple test case is:

# compat31 enables the quoting of regular expressions
bash -c ' [[ "1" =~ "[1]" ]]; echo $?' --> Outut is 1
bash -c 'shopt -s compat31; [[ "1" =~ "[1]" ]]; echo $?' --> Output is 0

# from a non bash shell
# setting compat31 through BASHOPTS
BASHOPTS=compat31 bash -c 'shopt compat31; [[ "1" =~ "[1]" ]]; echo $?'

This should output
compat31 on
0

It will output
compat31 on
1

So it pretends, that compat31 is enabled, but it is not. The reason is, that 
for options set using BASHOPTS the set_funcs are not called.
The attached patch will fix this.


Greetings,
Jörg

Attachment: shopt_BASHOPTS.patch
Description: shopt_BASHOPTS.patch

Reply via email to