help-bash
[Top][All Lists]
Advanced

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

Re: BASH_ENV and $0


From: Chet Ramey
Subject: Re: BASH_ENV and $0
Date: Thu, 22 Jul 2021 15:14:39 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 7/22/21 9:06 AM, Tapani Tarvainen wrote:

But that does not work: it turns out that $0 is always "/bin/bash" in
.bashenv (or just "bash" if called as "bash script"). Apparently $0 is
only set to the script name after .bashenv has been processed, and it
isn't in any other environment variable either.

I took another look at this -- this is not the first request to make the
shell script filename available in startup files -- and I don't think
that it will break anything or add an incompatibility to set $0 as
requested here.

Chet


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