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
18 # a no-such-job error, since we can use job control notation without job control
21 # make sure we can't fg a job started when job control was not active
25 # make sure the killed processes don't cause a message
29 wait # make sure we reap the processes while stderr is still redirected
40 echo wait-for-background-pids
45 echo async list wait-for-background-pids
49 echo async list wait for child
53 echo wait-when-no-children
60 wait %2 # this should be a no-such-job error
64 echo async list wait-for-job
84 # these next two are error cases
87 fg %2 # this should be a no-such-job error
88 bg %1 # this should be a `bg background job?' error
91 # these may someday mean to start the jobs, but not print the line
92 # describing the status, but for now they are errors
99 # someday this may mean to disown all stopped jobs, but for now it is
103 # this is an error -- the job with the pid that is the value of $! is
104 # retained only until a `wait' is performed
107 # this, however, is an error
110 echo wait-for-non-child
114 exit 1 | exit 2 | exit 3
115 echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
136 sleep 5 # give time for the shell to get the stop notification
137 echo after kill -STOP
153 echo after kill -s CONT
160 sleep 5 # give time for the shell to get the stop notification
161 echo after kill -STOP, backgrounding %3:
166 # make sure the killed processes don't cause a message
172 wait # make sure we reap the processes while stderr is still redirected
179 sleep 5 # give time for the shell to get the stop notification
180 echo after KILL -STOP, foregrounding %1