[Top][All Lists]

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

Re: shopt -u compat* (re)sets BASH_COMPAT to 51

From: Chet Ramey
Subject: Re: shopt -u compat* (re)sets BASH_COMPAT to 51
Date: Mon, 14 Feb 2022 10:44:03 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0

On 2/14/22 4:30 AM, Mihai Moldovan wrote:

Or maybe leaving shell_compatibility_level alone if it's > 44 (the last
compat_NN option) and <= DEFAULT_COMPATIBILITY_LEVEL (the current version)
instead of unconditionally setting it to DEFAULT_COMPATIBILITY_LEVEL. But
then you'd be required to unset BASH_COMPAT to get back to the current
compatibility level, which is supported now but not required.

The easiest way to do this would be to check if the old value matches the new
one and in case both were unset, just do nothing.

It's easier than that. Since the compatNN options and the compatibility
level are separate, it's easier to just make it a no-op if the current
compatibility level is outside the range of the compatNN options. That's
basically what I said above.

``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/

reply via email to

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