Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In bash, set +m is supposed to turn off the monitor mode. I would like this to be the default behaviour, and put the line in the .bashrc

The .bashrc file is read (put a line echo "hello" next to it), but the notifications for terminated jobs still appear. Why is that?

share|improve this question
1  
Interesting. set -o even claims monitor off, but set +m afterwards actually changes the behavior. –  Daniel Beck Oct 19 '12 at 3:27
add comment

1 Answer

Because job notifications are tied to interactive mode, not monitor mode. The description of what set -m does is quite misleading. It has a number of effects such as forcing pipelines to run in their own process group, and causes traps on CHLD to trigger for each background process. It doesn't actually do anything to affect whether "job control" works. You can still use all the job related commands and refer to jobs using jobspecs even with set +m, so long as your OS supports job control.

The same applies to ksh. I'm not aware of any way to disable or hide job notifications. If Bash is started with interactive mode you will always see them, even if you subsequently set +i (which AFAICT has no effect after startup). I find set +b makes things slightly more tolerable. If you're writing a script that makes use of job control for fancy multi-processing then you won't have to worry about it anyway.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.