aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc/wait6.tests
blob: c09002ab00874796adfda38e20b3ecf8687e835b (plain)
1
2
3
4
5
6
7
8
9
# If job control is disabled, skip the test
test "`type jobs`" = "jobs is a shell builtin" || exit 77

# In bash, "wait $!" extracts correct exitcode even if bg task has already exited
# It prints 0, then 3:
(sleep 0; exit 3) & sleep 1
echo $?
wait $!
echo $?