Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-pc-linux-gnu-gcc
Compilation CFLAGS: -march=native -ggdb -O2 -pipe -Wno-parentheses 
-Wno-format-security
uname output: Linux themis 4.14.154-gentoo #1 SMP Sat Nov 16 15:00:00 CET 2019 
x86_64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz GenuineIntel GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 11
Release Status: release

Description:
In a non-interactive non-posix-mode shell, saving the output of
"shopt -p -o" and restoring it will unset the expand_aliases option.

Repeat-By:
Execute the following script:

   #!/bin/bash
   shopt -s expand_aliases
   save=$(shopt -p -o)
   shopt -p expand_aliases
   eval "${save}"
   shopt -p expand_aliases

Here, its output is:

   shopt -s expand_aliases
   shopt -u expand_aliases

AFAICS, this is caused by eval unsetting the "posix" option (even though
it wasn't set before). Function set_posix_mode calls sv_strict_posix,
which in turn calls posix_initialize, which sets expand_aliases and
other options.

Expected behavior: Saving and restoring of options shouldn't change
other options by side effect.

Reply via email to