Re: [PATCH v2 5/8] builtins/source: parse the -i option
From:
Chet Ramey
Subject:
Re: [PATCH v2 5/8] builtins/source: parse the -i option
Date:
Thu, 16 May 2024 11:44:58 -0400
User-agent:
Mozilla Thunderbird
On 5/15/24 11:25 AM, Koichi Murase wrote:
2024年5月15日(水) 22:13 Chet Ramey <chet.ramey@case.edu>:
On 5/14/24 4:48 PM, Koichi Murase wrote:
However, at the same time, I think the new option could be justified
from the viewpoint of language design. If we have a new namespace
``BASH_SOURCE_PATH'' for the scripts to be sourced, it would be neat
to have an option to specify the namespace exclusively.
Should these be the default semantics for BASH_SOURCE_PATH?
Even if the option is not supported, I think the default semantics
should still reference PATH and the current working directory as
fallbacks because some libraries may want to set BASH_SOURCE_PATH,
As I said, I'm not sure a library changing the value of a global user
setting like that is good practice.
`unset -v var' is not required.
That was a POSIX invention as a compromise between implementations.
Hmm. Then, is the example of `unset' irrelevant?
It means it wasn't added for orthogonality or to make the language cleaner;
it was added to allow applications to force a particular behavior in the
face of default behavior differences by existing implementations. And this
was back in 1990.
--
``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/