1 # test out %+, jobs -p, and $! agreement in a subshell first
4 # test out fg/bg failure in a subshell
7 # test out behavior of waiting for background pids -- bug in versions
11 # test out behavior of using job control notation when job control is not
13 ${THIS_SH} ./jobs4.sub
15 # test out wait -n framework
16 ${THIS_SH} ./jobs5.sub
21 # a no-such-job error, since we can use job control notation without job control
24 # make sure we can't fg a job started when job control was not active
28 # make sure the killed processes don't cause a message
32 wait # make sure we reap the processes while stderr is still redirected
43 echo wait-for-background-pids
48 echo async list wait-for-background-pids
52 echo async list wait for child
56 echo wait-when-no-children
63 wait %2 # this should be a no-such-job error
67 echo async list wait-for-job
87 # these next two are error cases
90 fg %2 # this should be a no-such-job error
91 bg %1 # this should be a `bg background job?' error
94 # these may someday mean to start the jobs, but not print the line
95 # describing the status, but for now they are errors
102 # someday this may mean to disown all stopped jobs, but for now it is
106 # this is an error -- the job with the pid that is the value of $! is
107 # retained only until a `wait' is performed
110 # this, however, is an error
113 echo wait-for-non-child
117 exit 1 | exit 2 | exit 3
118 echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
140 sleep 5 # give time for the shell to get the stop notification
141 echo after kill -STOP
157 echo after kill -s CONT
164 sleep 5 # give time for the shell to get the stop notification
165 echo after kill -STOP, backgrounding %3:
170 # make sure the killed processes don't cause a message
175 kill -n 9 $sleep300pid
177 wait # make sure we reap the processes while stderr is still redirected
184 sleep 5 # give time for the shell to get the stop notification
185 echo after KILL -STOP, foregrounding %1