如何在 bash 中隐藏"Created new window in existing browser session"



你好,我正在为大学做一个项目,我是bash脚本的新手。我的部分代码如下(打开铬标签):

chromium-browser& &>/dev/null
while read line
    do
        chromium-browser "$line"& &>/dev/null 
        sleep 5
    done < url.in

然而,每次打开选项卡时,我都会在shell上收到一条烦人的消息"在现有浏览器会话中创建了新窗口"。它不会停止执行或任何事情,但我不希望它在那里,因为我希望之后的输出更清晰。既然重定向不起作用,有什么办法让它消失的吗?

您可以使用nohup:

nohup command >/dev/null 2>&1 &

将stdout和stderr重定向到/dev/null,如下所示:

command > /dev/null 2>&1 &

command &> /dev/null &

关于论点:http://www.tldp.org/LDP/abs/html/io-redirection.html

最新更新