# 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
echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
sleep 300 &
+sleep300pid=$!
sleep 350 &
sleep 400 &
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