On 1/21/25 9:49 PM, MacBeth wrote:
re: GNU bash, version 5.2.37(1)-release (aarch64-apple-darwin23.4.0)

---

1) `shopt compat50` does not exist. The manpage does specify that
'compat50' is a valid option for `shopt` under BUILTINS/shopt. Yet bash
provides an error when trying to read or change it:

This is correct; the man page description of shopt is wrong. There has
never been a compat50 shell option.

2) Bash errors on valid BASH_COMPAT values? Am I missing something here?

"BASH_COMPAT...For example, 4.2 and 42 are valid values that correspond to
the compat42 shopt option and set the compatibility level to 42.  The
current version is also a valid value."

BASH_COMPAT=4.4 bash --noprofile -l
bash: BASH_COMPAT: compat44: compatibility value out of range
bash-5.2$ shopt compat44
compat44        on

I can only reproduce this if you do this while BASH_COMPAT is set to
`compat44' (an invalid value). After bash processes the temporary
environment, using it to create the environment for the child process,
it restores the values that the temporary environment changed. It tries
to process `compat44' as a compatibility setting, and reports it as
invalid. It does this before it tries to wait for the child process, so
it's entirely possible, based on when processes get scheduled and start
executing, that the error message is displayed before the child process
outputs anything.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to