1 # test out %+, jobs -p, and $! agreement in a subshell first
4 # test out fg/bg failure in a subshell
10 # should be a job-control-not-enabled error
13 # make sure we can't fg a job started when job control was not active
17 # make sure the killed processes don't cause a message
21 wait # make sure we reap the processes while stderr is still redirected
32 echo wait-for-background-pids
37 echo async list wait-for-background-pids
41 echo async list wait for child
45 echo wait-when-no-children
52 wait %2 # this should be a no-such-job error
56 echo async list wait-for-job
76 # these next two are error cases
79 fg %2 # this should be a no-such-job error
80 bg %1 # this should be a `bg background job?' error
83 # these may someday mean to start the jobs, but not print the line
84 # describing the status, but for now they are errors
91 # someday this may mean to disown all stopped jobs, but for now it is
95 # this is an error -- the job with the pid that is the value of $! is
96 # retained only until a `wait' is performed
99 # this, however, is an error
102 echo wait-for-non-child
106 exit 1 | exit 2 | exit 3
107 echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
128 sleep 5 # give time for the shell to get the stop notification
129 echo after kill -STOP
145 echo after kill -s CONT
152 sleep 5 # give time for the shell to get the stop notification
153 echo after kill -STOP, backgrounding %3:
158 # make sure the killed processes don't cause a message
164 wait # make sure we reap the processes while stderr is still redirected
171 sleep 5 # give time for the shell to get the stop notification
172 echo after KILL -STOP, foregrounding %1