bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH 0/4] Add import builtin


From: Chet Ramey
Subject: Re: [PATCH 0/4] Add import builtin
Date: Fri, 3 May 2024 09:18:09 -0400
User-agent: Mozilla Thunderbird

On 5/2/24 6:22 PM, Matheus Afonso Martins Moreira wrote:

This patch set introduces a new "import" builtin which behaves just like
the source builtin but only looks up executables in the BASH_IMPORT_PATH
variable.

How is this any different than

PATH=$BASH_IMPORT_PATH:$PATH source
or
PATH=$BASH_IMPORT_PATH source

You could force the latter if you are sure that the sourced files will
not attempt to run external commands.

You could even make this an alias if you want. I'd hesitate to make it a
function, unless you're sure that no file you source uses `declare' to
create variables, since those will be local to the function by default.

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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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