busybox/shell/ash_test/ash-misc/source_argv_and_shift.tests
Denys Vlasenko 2b1559056c hush: fix a bug in argv restoration after sourcing a file
if sourced file "shift"ed argvs so that $1 is NULL, restore wasn't done.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-09 08:13:21 +01:00

13 lines
149 B
Plaintext
Executable File

echo 'echo sourced_arg1:$1' >sourced1
echo 'shift' >>sourced1
set -- 1
. ./sourced1
echo arg1:$1
set -- 1
. ./sourced1 a
echo arg1:$1
rm sourced1