help-bash
[Top][All Lists]
Advanced

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

Re: Special PATH variable for sourcing scripts?


From: Alan D. Salewski
Subject: Re: Special PATH variable for sourcing scripts?
Date: Mon, 22 Apr 2024 14:40:09 -0400
User-agent: Mutt/2.0.5 (2021-01-21)

On 2024-04-22 02:12:08, Matheus Afonso Martins Moreira 
<matheus@matheusmoreira.com> spake thus:
Instead of diving into the semantics of what counts as a "library,"
how about we just consider different variable names? BASH_SOURCE_PATH?
SOURCE_PATH?

Sure. I think BASH_SOURCE_PATH is great.
It denotes the fact it is specific to
both bash and the source builtin.

Sourcing reusable code seems fine.

I agree, the source builtin is good.
It can even pass arguments to the scripts.

How else would it work?

I suppose creating a dedicated builtin for this
is also an option. Just like the enable builtin
which I saw in the documentation. I thought that
was where discussion was heading for a moment there.

Creating a wrapper around 'bash' could also work (maybe call it 'runbash'?), similar to how 'runawk'[0] wraps 'awk' to add support for modules (and other things).

-Al


[0] https://github.com/cheusov/runawk
    https://sourceforge.net/projects/runawk/

--
a l a n   d.   s a l e w s k i
ads@salewski.email
salewski@att.net
https://github.com/salewski


reply via email to

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