[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/4] Add import builtin
From: |
Lawrence Velázquez |
Subject: |
Re: [PATCH 0/4] Add import builtin |
Date: |
Thu, 02 May 2024 22:35:02 -0400 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-417-gddc99d37d-fm-hotfix-20240424.001-g2c179674 |
On Thu, May 2, 2024, at 9:40 PM, Dale R. Worley wrote:
> It seems like you could get much the same effect with this device:
>
> ----------------------------------------------------------------------
> t1 contains:
>
> # Where I am doing this testing.
> BASH_IMPORT_PATH=$HOME/temp/import/t2
>
> echo "Note PATH does not contain '.'"
> echo "PATH=$PATH"
> echo "BASH_IMPORT_PATH=$BASH_IMPORT_PATH"
>
> function import () {
> local PATH="$BASH_IMPORT_PATH"
> source "$1"
> }
You probably want something like
local PATH=$BASH_IMPORT_PATH:$PATH
otherwise the sourced file will not be able to find the usual
external utilities. Even then, the additional function scope
will interfere with top-level "declare" commands.
--
vq
- [PATCH 0/4] Add import builtin, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 1/4] builtins: extract file content executor function, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 3/4] findcmd: define the user import finder function, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 4/4] builtins: add import builtin, Matheus Afonso Martins Moreira, 2024/05/02
- [PATCH 2/4] findcmd: parameterize path variable in functions, Matheus Afonso Martins Moreira, 2024/05/02
- Re: [PATCH 0/4] Add import builtin, Dale R. Worley, 2024/05/02
- Re: [PATCH 0/4] Add import builtin,
Lawrence Velázquez <=
- Re: [PATCH 0/4] Add import builtin, Lawrence Velázquez, 2024/05/02
- Re: [PATCH 0/4] Add import builtin, Koichi Murase, 2024/05/02