|
From: | Dale R. Worley |
Subject: | Re: [PATCH 0/4] Add import builtin |
Date: | Thu, 02 May 2024 21:40:07 -0400 |
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" } import t2 echo "T2_VARIABLE=$T2_VARIABLE" ---------------------------------------------------------------------- t2 contains: echo "Executing t2" T2_VARIABLE=t2_value ---------------------------------------------------------------------- Test execution: $ bash ./t1 Note PATH does not contain '.' PATH=/home/worley/bin/x86_64:/home/worley/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb:/etc:/usr/etc:/usr/X11R6/bin:/usr/hosts:/usr/games:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin BASH_IMPORT_PATH=/home/worley/temp/import/t2 Executing t2 T2_VARIABLE=t2_value $ ---------------------------------------------------------------------- Dale
[Prev in Thread] | Current Thread | [Next in Thread] |