Jeff Chua wrote: > > > On Sun, Nov 8, 2009 at 5:25 AM, Chet Ramey <chet.ra...@case.edu > <mailto:chet.ra...@case.edu>> wrote: > > > Are you saying you ran a script in which you enabled job > control, ran a job, turned job control off, then killed the job? > > > No, I didn't turn off job control. I use "set +m" to turn of monitoring > only because I don't want to see any message about the job being terminated.
I think you're confused about the distinction. set -m and +m turn job control on and off. The `monitor' name is historical (ask Dave Korn why he chose it). > > Bash and historical versions of sh report the status of jobs in a script > that exit as the result of being killed by a signal. I'm not going to > change that. > > > Isn't that the purpose of "set +m" ... to turn off monitoring? Let's take a step back. I don't think your patch does what you think it does, since the code it changes doesn't get executed when the shell is interactive. What version of bash are you using? Assuming you mean an interactive shell, bash-4.0 behaves like I think you want: $ ./bash $ echo $BASH_VERSION 4.0.35(9)-release $ echo $- himBH $ sleep 40 & [1] 19038 $ set +m $ kill %1 $ fg %1 bash: fg: no job control $ set -m $ sleep 40 & [1] 19041 $ kill %1 $ [1]+ Terminated sleep 40 $ Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/