[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
shopt -u compat* (re)sets BASH_COMPAT to 51
From: |
Mihai Moldovan |
Subject: |
shopt -u compat* (re)sets BASH_COMPAT to 51 |
Date: |
Sat, 12 Feb 2022 10:11:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: x86_64-pc-linux-gnu-gcc
Compilation CFLAGS: -march=native -mtune=native -Wall -pipe -g3 -ggdb3 -gdwarf-4
-O2 -fno-omit-frame-pointer
uname output: Linux apgunner 5.15.11 #1 SMP PREEMPT Thu Dec 23 09:06:30 CET 2021
x86_64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz GenuineIntel
GNU/Linux
Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.1
Patch Level: 16
Release Status: release
Description:
The only way to set a compat level of 50 is to use the BASH_COMPAT
variable. However, unsetting any compatNN shopt value will (re)set
BASH_COMPAT to 51 (with bash-5.1), which is not something users might
expect.
Technically, the result isn't wrong, since, i.e., shopt -u compat43 did
what it was asked to - not setting the compat value to 43. It's
counter-intuitive and the old value should be retained, though.
Repeat-By:
BASH_COMPAT='5.0'
declare -p 'BASH_COMPAT'
eval "$(shopt -p)"
# alternatively, a simple shopt -u compat44 would suffice
declare -p 'BASH_COMPAT'
OpenPGP_signature
Description: OpenPGP digital signature
- shopt -u compat* (re)sets BASH_COMPAT to 51,
Mihai Moldovan <=