diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-03 11:21:13 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-04-03 11:21:13 +0200 |
| commit | 5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6 (patch) | |
| tree | 626cdb9979f4ccddd4566c8073c5d316b1af97b1 /shell/ash_test | |
| parent | 11752d46d18ff4a04a9f6736d129a82756a65a22 (diff) | |
| download | busybox-w32-5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6.tar.gz busybox-w32-5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6.tar.bz2 busybox-w32-5fa0505f8a74848ce4d2a7a4ed905e1bb8af3fe6.zip | |
hush: fix "set -e; false || x=1; echo OK"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash_test')
| -rw-r--r-- | shell/ash_test/ash-misc/assignment5.right | 5 | ||||
| -rwxr-xr-x | shell/ash_test/ash-misc/assignment5.tests | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/shell/ash_test/ash-misc/assignment5.right b/shell/ash_test/ash-misc/assignment5.right new file mode 100644 index 000000000..a91554c09 --- /dev/null +++ b/shell/ash_test/ash-misc/assignment5.right | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | Zero1:0 | ||
| 2 | Zero2:0 | ||
| 3 | Zero3:0 | ||
| 4 | Zero4:0 x:1 y:1 | ||
| 5 | Three:3 x:1 y:1 | ||
diff --git a/shell/ash_test/ash-misc/assignment5.tests b/shell/ash_test/ash-misc/assignment5.tests new file mode 100755 index 000000000..0b8104285 --- /dev/null +++ b/shell/ash_test/ash-misc/assignment5.tests | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | true; a=1; echo Zero1:$? | ||
| 2 | false; a=1; echo Zero2:$? | ||
| 3 | false || a=1; echo Zero3:$? | ||
| 4 | |||
| 5 | false || x=$? y=`echo $?`; echo Zero4:$? x:$x y:$y | ||
| 6 | false || x=$? y=`echo $?; exit 3`; echo Three:$? x:$x y:$y | ||
| 7 | |||
| 8 | #ash sets z=1 instead of z=3. disabled for now | ||
| 9 | #false || x=$? y=`echo $?; exit 3` z=`echo $?`; echo x:$x y:$y z:$z | ||
