bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shopt compat


From: Chet Ramey
Subject: Re: shopt compat
Date: Wed, 14 Aug 2024 09:57:02 -0400
User-agent: Mozilla Thunderbird

On 8/14/24 2:25 AM, Martin Kealey wrote:
Hi Chet

I have worked up a patch that considerably simplifies the logic for
setting and displaying the shopt compatXX settings, by getting rid of
the numberous boolean variables and simply computing the setting level
directly.

Thanks. The boolean variables and corresponding shopt options are frozen
and only remain for backwards compatibility; there are no compatXX shopt
options beyond compat44; the BASH_COMPAT variable is the current way to
set the compatibility level.


However before I submit my compatXX patch, I would like to ensure I've
correctly accounted for the intention of the commit below, which I
assume is fairly described by this comment:

If we're unsetting one of the compatibility options, make sure the
current value is in the range of the compatNN space.

In partiular, I'm puzzled by the introduction of this boolean expression

(oldval > 44 && shell_compatibility_level < DEFAULT_COMPAT_LEVEL)

There are no compat options beyond compat44, so any value greater than
that must have been set via BASH_COMPAT.

For example, once it's possible to use 'shopt -s compat52', we would then
find that 'shopt -u compat52' would have no effect, unless the number
"44" is updated to match any new available levels.

We're not going to do that.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]