[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash 5.1: Make shell_script_filename available to startup files
From: |
Grisha Levit |
Subject: |
Re: Bash 5.1: Make shell_script_filename available to startup files |
Date: |
Fri, 16 Feb 2024 22:32:50 -0500 |
On Fri, Feb 16, 2024, 16:17 Marc Aurèle La France <tsi@tuyoix.net> wrote:
>
> On Mon, 2021-Feb-01, Marc Aurèle La France wrote:
>
> > Currently, only the script's arguments are passed as positional
> > parameters. For compatibility reasons, $0 cannot be used to also pass the
> > script's filename, so I'm creating a new BASH_SCRIPT variable instead.
>
> > --- bash-5.1/doc/bash.1
> > +++ devel-5.1/doc/bash.1
> Yes, it's been three years, but...
>
> Withdrawn. I can accomplish the same thing by capturing $_ early on,
> before it gets clobbered by whatever.
I believe bash-5.2 and up do behave the way you want w.r.t. the value
of $0 when running the BASH_ENV script.
See https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS-5.2?h=devel#n58 :
p. The `$0' special parameter is now set to the name of the script when running
any (non-interactive) startup files such as $BASH_ENV.
- Re: Bash 5.1: Make shell_script_filename available to startup files, (continued)
- Re: Bash 5.1: Make shell_script_filename available to startup files, Zachary Santer, 2024/02/16
- Re: Bash 5.1: Make shell_script_filename available to startup files, Marc Aurèle La France, 2024/02/16
- Re: Bash 5.1: Make shell_script_filename available to startup files, Zachary Santer, 2024/02/17
- Re: Bash 5.1: Make shell_script_filename available to startup files, Marc Aurèle La France, 2024/02/17
- Re: Bash 5.1: Make shell_script_filename available to startup files, Zachary Santer, 2024/02/17
- Re: Bash 5.1: Make shell_script_filename available to startup files, Marc Aurèle La France, 2024/02/17
- Re: Bash 5.1: Make shell_script_filename available to startup files, Chet Ramey, 2024/02/20
- Re: Bash 5.1: Make shell_script_filename available to startup files, Zachary Santer, 2024/02/20
- Re: Bash 5.1: Make shell_script_filename available to startup files, alex xmb sw ratchev, 2024/02/20
- Re: Bash 5.1: Make shell_script_filename available to startup files, Zachary Santer, 2024/02/20
Re: Bash 5.1: Make shell_script_filename available to startup files,
Grisha Levit <=