bug-bash
[Top][All Lists]
Advanced

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

Re: proposed BASH_SOURCE_PATH


From: konsolebox
Subject: Re: proposed BASH_SOURCE_PATH
Date: Wed, 26 Jun 2024 21:25:07 +0800

On Wed, Jun 26, 2024 at 8:57 PM Chet Ramey <chet.ramey@case.edu> wrote:
> What `lazy alternatives' did you have in mind?

I replied to Martin D Kealey about it but looking at the email now it
seems like he's referring to something involving BASH_SOURCE_PATH
instead of BASH_SOURCE.  I misinterpreted.

I'm thinking if people wouldn't want to implement BASH_SOURCE values
being resolved to real path by default, Bash can store the working
directories to another list like "BASH_SOURCE_PWD".  Then if someone
wants to get the real path version of a value in BASH_SOURCE, they can
do so either by:

1) Enabling a shell option.  All values in BASH_SOURCE will be
recalculated to their real path versions and all new values will be
stored as real paths from now on.
2) Accessing BASH_SOURCE_REAL instead.  The values of BASH_SOURCE_REAL
are initially empty and are only calculated the moment they are
accessed.

I still prefer the simpler one however, which is to just assign real
paths to BASH_SOURCE by default.


-- 
konsolebox



reply via email to

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