Is there a way to make bash job control quiet?

static_rtti picture static_rtti · Jun 19, 2012 · Viewed 11.9k times · Source

Bash is quite verbose when running jobs in the background:

$ echo toto&
toto
[1] 15922
[1]+  Done                    echo toto

Since I'm trying to run jobs in parallel and use the output, I'd like to find a way to silence bash. Is there a way to remove this superfluous output?

Answer

Todd A. Jacobs picture Todd A. Jacobs · Jun 20, 2012

You can use parentheses to run a background command in a subshell, and that will silence the job control messages. For example:

(sleep 10 & )