Is there a way to make bash job control quiet?

前端 未结 5 1389
无人及你
无人及你 2020-12-02 13:25

Bash is quite verbose when running jobs in the background:

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

Since I\

5条回答
  •  情深已故
    2020-12-02 13:43

    Interactively, no. It will always display job status. You can influence when the status is shown using set -b.

    There's nothing preventing you from using the output of your commands (via pipes, or storing it variables, etc). The job status is sent to the controlling terminal by the shell and doesn't mix with other I/O. If you're doing something complex with jobs, the solution is to write a separate script.

    The job messages are only really a problem if you have, say, functions in your bashrc which make use of job control which you want to have direct access to your interactive environment. Unfortunately there's nothing you can do about it.

提交回复
热议问题