On Tue, Jan 21, 2025, at 9:49 PM, MacBeth wrote:
> "Bash-5.0 is the final version for which there will be an individual shopt
> option for the previous version. Users should use BASH_COMPAT on bash-5.0
> and later versions."
>
> ...Not sure if this means `shopt compat50` should work or not.

It shouldn't, and never has.

https://git.savannah.gnu.org/cgit/bash.git/tree/builtins/shopt.def?h=bash-5.1#n178


> But either
> way, `shopt compat50` should be consistent with BUILTINS/shopt.

Yeah, probably.


> 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
>
>> BASH_COMPAT=44 bash --noprofile -l
> bash: BASH_COMPAT: compat44: compatibility value out of range
> bash-5.2$ shopt compat44
> compat44        on

I'm not seeing this behavior.

        outer$ BASH_COMPAT=4.4 PS1='inner\$ ' bash --noprofile -l
        inner$ shopt compat44
        compat44        on
        inner$ echo "$BASH_VERSION"
        5.2.37(1)-release

And those error messages don't make any sense.  They ought to just
show the bad value:

        $ BASH_COMPAT=3.0 bash -c :
        bash: BASH_COMPAT: 3.0: compatibility value out of range
        $ BASH_COMPAT=5.3 bash -c :
        bash: BASH_COMPAT: 5.3: compatibility value out of range

Are you sure "bash" wasn't/isn't an alias or function or wrapper
script or something?


-- 
vq

Reply via email to