On Tue, Feb 20, 2024 at 2:38 PM alex xmb sw ratchev
wrote:
> check if $BASH_SOURCE begins with a / , else prepend $PWD to it
> to path of file
>
source "$( dirname -- "$( realpath --canonicalize-existing --
"${BASH_SOURCE[0]}" )" )\
/common/sourced-file.bash"
What I do, anyway. Won't let symlin
On Tue, Feb 20, 2024, 17:53 Zachary Santer wrote:
> On Tue, Feb 20, 2024 at 11:17 AM Chet Ramey wrote:
>
> >
> > BASH_SOURCE and BASH_LINENO are part of the debugger support, and exist
> so
> > the debugger can create a function call stack.
> >
> > I've definitely used them to create my own call
On 2/17/24 6:47 PM, Zachary Santer wrote:
If you're satisfied with $_ or now $0, then fine, but I would actually
expect that to show up as ${BASH_SOURCE[1]} within the ${BASH_ENV} script,
which it obviously doesn't. Don't know what ${BASH_LINENO[0]} ought to be
in that case. Maybe 0?
The way th
On Tue, Feb 20, 2024 at 11:17 AM Chet Ramey wrote:
>
> BASH_SOURCE and BASH_LINENO are part of the debugger support, and exist so
> the debugger can create a function call stack.
>
> I've definitely used them to create my own call stack. I've seen
${BASH_SOURCE[0]} given as preferable to ${0} for
On Sat, 2024-Feb-17, Zachary Santer wrote:
On Sat, Feb 17, 2024, Marc Aurèle La France wrote:
Do ...
rm -fr GREPME grepme
echo '#! /bin/bash\nset' > GREPME
"ln" GREPME grepme
chmod a+x grepme
... then (case matters) ...
BASH_ENV=GREPME ./grepme | fgrep -iw grepme
... gives ...
B
On Sat, Feb 17, 2024 at 3:44 PM Marc Aurèle La France
wrote:
> Do ...
>
> rm -fr GREPME grepme
> echo '#! /bin/bash\nset' > GREPME
> "ln" GREPME grepme
> chmod a+x grepme
>
> ... then (case matters) ...
>
> BASH_ENV=GREPME ./grepme | fgrep -iw grepme
>
> ... gives ...
>
> BASH_ARGV=([0]="GREPME")
On Fri, 2024-Feb-16, Grisha Levit wrote:
On Fri, Feb 16, 2024, Marc Aurèle La France 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 fil
On Sat, 2024-Feb-17, Zachary Santer wrote:
On Fri, Feb 16, 2024, Marc Aurèle La France wrote:
On Fri, 2024-Feb-16, Zachary Santer wrote:
And you're sure ${BASH_SOURCE[0]} wasn't what you wanted all along?
Yes, but that doesn't matter now.
At the bottom of my .bashrc file:
printf '%s\n'
On Fri, Feb 16, 2024 at 9:45 PM Marc Aurèle La France
wrote:
> On Fri, 2024-Feb-16, Zachary Santer wrote:
>
> > And you're sure ${BASH_SOURCE[0]} wasn't what you wanted all along?
>
> Yes, but that doesn't matter now.
>
At the bottom of my .bashrc file:
printf '%s\n' "Hello, this script is ${BAS
On Fri, Feb 16, 2024, 16:17 Marc Aurèle La France 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
On Fri, 2024-Feb-16, Zachary Santer wrote:
On Fri, Feb 16, 2024, Marc Aurèle La France 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 f
On Fri, Feb 16, 2024 at 4:17 PM Marc Aurèle La France
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 cre
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
On 2/8/21 10:04 AM, Marc Aurèle La France wrote:
Yes, I could have all such scripts source a file when they start. But
isn't that just another startup file? And duplication. Or pass
something through $1; again duplication. BASH_SCRIPT is a more elegant
solution and doesn't require any int
On Tue, 2 Feb 2021, Marc Aurèle La France wrote:
On Tue, 2 Feb 2021, Chet Ramey wrote:
On Mon, 1 Feb 2021, 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,
On Tue, 2 Feb 2021, Chet Ramey wrote:
On Mon, 1 Feb 2021, 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 instea
On 2/1/21 6:17 PM, 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.
I'm interested in use cases for this
17 matches
Mail list logo