有没有办法让 bash 作业控制安静? [英] Is there a way to make bash job control quiet?

查看:46
本文介绍了有没有办法让 bash 作业控制安静?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在后台运行作业时,Bash 非常冗长:

Bash is quite verbose when running jobs in the background:

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

由于我尝试并行运行作业并使用输出,因此我想找到一种使 bash 静音的方法.有没有办法去除这个多余的输出?

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?

推荐答案

您可以使用括号在子 shell 中运行后台命令,这将使作业控制消息静音.例如:

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

(sleep 10 & )

这篇关于有没有办法让 bash 作业控制安静?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆