bug-bash
[Top][All Lists]
Advanced

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

Re: make test errata (part 2)


From: Chet Ramey
Subject: Re: make test errata (part 2)
Date: Thu, 19 Dec 2024 17:25:03 -0500
User-agent: Mozilla Thunderbird

On 12/14/24 9:35 AM, Martin D Kealey wrote:
(see first part for background)

I've patched Bash to merge “shopt” and “set -o”, and now “make tests”
reports some minor differences. I would like some feedback on whether
they're significant enough to warrant fixing.

I never did hear why exactly you decided to do this. I understand what
you're doing, and your goals, just not what prompted it.

I've tried to mimic the current behaviour as closely as possible, including
keeping underscores for shopt names and hyphens for set -o names, and
limiting the display from “set -o” to the same old list of options.

As long as `set -o' acts on the same old list of options. I basically
abandoned `set -o' to POSIX and put all new options into shopt.


However I've made a conscious choice not to apply the corresponding limit
to “shopt”, intending to promote the use of “shopt” as the “normal” command
to use for all options. This increases the list displayed by “shopt” by
about 50%.

You can already use shopt for all options, since it supports -o.

I've also widened the column format because many of the names are longer
than 15 bytes, and the current list is looking decidedly untidy as a result.

This is a reasonable idea.


I've tried to keep the current division of options when *populating*
BASHOPTS and SHELLOPTS, but I haven't included a check to ignore (or
complain about) options that are in the “wrong” variable when *reading*
them at startup. Does it matter if options are honoured even when they're
in the wrong one out of BASHOPTS and SHELLOPTS? Are there any security
implications?

They're mostly parallel, and have the same restrictions, but I would keep
the historical behavior.

Similarly the command line options -o and -O become interchangeable, except
for their order of evaluation. Does the deferred processing of -O

Yes, it matters. These have to override the normal interactive/non-
interactive startup.


Lastly, the current order for “$-” seems to be “abefhikmptuvxBCEHIPTcs”,

These are the options you can set with `set', followed by the invocation-
only options.

Yes, you could run `set -i' until bash-4.4, even though it didn't really
do anything. I changed it after a bug-bash discussion in 2015.


PS2: in the current version of Bash, BASHOPTS can contain
‘interactive_comments’ and SHELLOPTS can contain ‘interactive-comments’.
Does this duplication serve any useful purpose?

History. It's been this way since before shopt was introduced in 1994.

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