Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc -I/usr/src/packages/BUILD/bash-3.1
-L/usr/src/packages/BUILD/bash-3.1/../readline-5.1
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MAC
> | It is not possible to have a naive SHELLOPTS=myopt configured outside
> | the shell without all future options being exported implicitly.
> I have never used SHELLOPTS, and have never tested this, but:
> Does "unset SHELLOPTS" not work?
It gives:
bash: unset: SHELLOPTS: cannot unset
> This precdence question is really the only one. Is this issue serious
> enough to change previous behavior in an incompatible way?
To me it seems most intuitive for flags to be applied after the environment
variable, but I do not mind too much about this.
> No. That is not consistent with the
add it to the environment. This way, the behaviour wouldn't come as a surprise.
Here is another project that fell into the same trap:
https://github.com/infertux/bashcov/issues/50.
--
Tobi
ue to `set` or bash option flags. I've added a patch below
that achieves this, if it seems reasonable then I will write a test and format
it properly as a patch request.
Regards,
Tobi
---
variables.c | 21 +++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git
ml#index-BASH_005fENV
If this is the correct way to achieve this, that is fair enough. If SHELLOPTS
is not intended to be used in this way then I would expect the documentation to
include enough information that would discourage a user from falling into this
trap.
--
Tobi