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?

  • 1
    Interesting. set -o even claims monitor off, but set +m afterwards actually changes the behavior. – Daniel Beck Oct 19 '12 at 3:27

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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