[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed BASH_SOURCE_PATH
From: |
Chet Ramey |
Subject: |
Re: proposed BASH_SOURCE_PATH |
Date: |
Wed, 7 Aug 2024 10:34:21 -0400 |
User-agent: |
Mozilla Thunderbird |
On 8/6/24 3:09 AM, konsolebox wrote:
I just saw the new changes and tested it. It's not useful because
BASH_SOURCE still expands to the relative form after `shopt -s
bash_source_fullpath` is executed in the main script.
You mean for the paths that were added to BASH_SOURCE before setting
the option? If that's a concern for you, maybe start the script with
that option enabled on the command line.
This is why I
was saying context directories would have to be stored and paths
already stored in BASH_SOURCE would have to be converted to real path
versions the moment the option is enabled;
That's wrong for the same reason people didn't like doing it themselves:
if the shell changes the working directory, prefixing the working
directory is incorrect.
If this is already final can the option at least be allowed to be
enabled by default at compile time?
Woe unto the poor soul who expects the default behavior and happens to use
a distro compiled with that as the default. Not that that's likely to
happen.
--
``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/
OpenPGP_signature.asc
Description: OpenPGP digital signature