bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] silent job monitor when 'set +m'


From: Chet Ramey
Subject: Re: [PATCH] silent job monitor when 'set +m'
Date: Sat, 07 Nov 2009 21:14:13 -0500
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Jeff Chua wrote:
> 
> 
> On Sun, Nov 8, 2009 at 5:25 AM, Chet Ramey <address@hidden
> <mailto:address@hidden>> 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    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]