Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15630 > unrolled thread

Saving/restoring of posix option unsets expand_aliases

Started byUlrich Mueller <ulm@gentoo.org>
First post2019-11-24 13:35 +0100
Last post2019-11-24 13:35 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Saving/restoring of posix option unsets expand_aliases Ulrich Mueller <ulm@gentoo.org> - 2019-11-24 13:35 +0100

#15630 — Saving/restoring of posix option unsets expand_aliases

FromUlrich Mueller <ulm@gentoo.org>
Date2019-11-24 13:35 +0100
SubjectSaving/restoring of posix option unsets expand_aliases
Message-ID<mailman.2496.1574598945.13325.bug-bash@gnu.org>
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.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web