Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / jobs.tests
index 26adfe0..c99f4f7 100644 (file)
@@ -4,10 +4,21 @@ ${THIS_SH} ./jobs1.sub
 # test out fg/bg failure in a subshell
 ${THIS_SH} ./jobs2.sub
 
+# test out behavior of waiting for background pids -- bug in versions
+# before 2.03
+${THIS_SH} ./jobs3.sub
+
+# test out behavior of using job control notation when job control is not
+# active
+${THIS_SH} ./jobs4.sub
+
+# test out wait -n framework
+${THIS_SH} ./jobs5.sub
+
 jobs
 echo $?
 
-# should be a job-control-not-enabled error
+# a no-such-job error, since we can use job control notation without job control
 wait %1
 
 # make sure we can't fg a job started when job control was not active
@@ -107,6 +118,7 @@ exit 1 | exit 2 | exit 3
 echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
 
 sleep 300 &
+sleep300pid=$!
 sleep 350 &
 sleep 400 &
 
@@ -160,6 +172,7 @@ exec 5>&2
 exec 2>/dev/null
 
 echo killing...
+kill -n 9 $sleep300pid
 kill -n 9 %2 %3
 wait   # make sure we reap the processes while stderr is still redirected
 echo done