From e9396994d328606ff436b87bea3a0321bba98809 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 3 May 2020 23:15:35 -0500 Subject: Next round of shell work. --- tests/sh.test | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/sh.test b/tests/sh.test index 28b453f0..0759398d 100644 --- a/tests/sh.test +++ b/tests/sh.test @@ -42,7 +42,10 @@ testing "exec3" '$C -c "{ exec readlink /proc/self/fd/0;} < /proc/self/exe"' \ testing 'arg shift' "$SH -c '"'for i in "" 2 1 1 1; do echo $? $1; shift $i; done'"' one two three four five" \ "0 two\n0 three\n0 five\n0\n1\n" "" "" - +# The bash man page is lying when it says $_ starts with an absolute path. +ln -s $(which $SH) bash +testing 'non-absolute $_' "./bash -c 'echo \$_'" './bash\n' '' '' +rm bash testing 'exec exitval' "$SH -c 'exec echo hello' && echo \$?" "hello\n0\n" "" "" testing 'simple script' '$SH input' 'input\n' 'echo $0' '' @@ -61,7 +64,7 @@ testing 'IFS $*' "$SH -c 'IFS=xy; echo \"\$*\"' one two tyree" "twoxtyree\n" \ "" "" testing 'default exports' \ - "env -i \"$(which $SH)\" --noprofile -norc -c env | sort" \ + "env -i \"$(which $SH)\" --noprofile --norc -c env | sort" \ "PWD=$(pwd)\nSHLVL=1\n_=$(which env)\n" "" "" # Change EVAL to call sh -c for us, using "bash" explicitly for the host. -- cgit v1.2.3