summaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc/assignment5.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2018-04-03 11:21:13 +0200
committerDenys Vlasenko2018-04-03 11:21:13 +0200
commit5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6 (patch)
tree626cdb9979f4ccddd4566c8073c5d316b1af97b1 /shell/hush_test/hush-misc/assignment5.tests
parent11752d46d18ff4a04a9f6736d129a82756a65a22 (diff)
downloadbusybox-5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6.zip
busybox-5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6.tar.gz
hush: fix "set -e; false || x=1; echo OK"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test/hush-misc/assignment5.tests')
-rwxr-xr-xshell/hush_test/hush-misc/assignment5.tests9
1 files changed, 9 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/assignment5.tests b/shell/hush_test/hush-misc/assignment5.tests
new file mode 100755
index 0000000..0b81042
--- /dev/null
+++ b/shell/hush_test/hush-misc/assignment5.tests
@@ -0,0 +1,9 @@
+true; a=1; echo Zero1:$?
+false; a=1; echo Zero2:$?
+false || a=1; echo Zero3:$?
+
+false || x=$? y=`echo $?`; echo Zero4:$? x:$x y:$y
+false || x=$? y=`echo $?; exit 3`; echo Three:$? x:$x y:$y
+
+#ash sets z=1 instead of z=3. disabled for now
+#false || x=$? y=`echo $?; exit 3` z=`echo $?`; echo x:$x y:$y z:$z