shell: some additions to *sh-misc/* tests

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-07-24 18:51:40 +02:00
parent b920a38dc0
commit ca50caacad
7 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,2 @@
./assignment2.tests: line 2: a=b: not found
127

View File

@ -0,0 +1,3 @@
# This must not be interpreted as an assignment
a''=b true
echo $?

View File

@ -0,0 +1,6 @@
Null 0th arg:
./empty_args.tests: line 2: : Permission denied
127
Null 1st arg:
0
Null arg in exec:

View File

@ -0,0 +1,9 @@
echo Null 0th arg:
""
echo $?
echo Null 1st arg:
# printf without args would print usage info
printf ""
echo $?
echo Null arg in exec:
exec printf ""

View File

@ -0,0 +1,2 @@
var=val
var=val

View File

@ -0,0 +1,8 @@
var=old
f() { echo "var=$var"; }
# bash: POSIXLY_CORRECT behavior is to "leak" new variable values
# out of function invocations (similar to "special builtins" behavior);
# but in "bash mode", they don't leak.
# hush does not "leak" values. ash does.
var=val f
echo "var=$var"

View File

@ -1,4 +1,8 @@
var=old
f() { echo "var=$var"; }
# bash: POSIXLY_CORRECT behavior is to "leak" new variable values
# out of function invocations (similar to "special builtins" behavior);
# but in "bash mode", they don't leak.
# hush does not "leak" values. ash does.
var=val f
echo "var=$var"