From 5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 3 Apr 2018 11:21:13 +0200 Subject: hush: fix "set -e; false || x=1; echo OK" Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-misc/assignment5.right | 5 +++++ shell/hush_test/hush-misc/assignment5.tests | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 shell/hush_test/hush-misc/assignment5.right create mode 100755 shell/hush_test/hush-misc/assignment5.tests (limited to 'shell/hush_test') diff --git a/shell/hush_test/hush-misc/assignment5.right b/shell/hush_test/hush-misc/assignment5.right new file mode 100644 index 000000000..a91554c09 --- /dev/null +++ b/shell/hush_test/hush-misc/assignment5.right @@ -0,0 +1,5 @@ +Zero1:0 +Zero2:0 +Zero3:0 +Zero4:0 x:1 y:1 +Three:3 x:1 y:1 diff --git a/shell/hush_test/hush-misc/assignment5.tests b/shell/hush_test/hush-misc/assignment5.tests new file mode 100755 index 000000000..0b8104285 --- /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 -- cgit v1.2.3