重定向bas​​h命令的输出控制台消息

问题描述

我执行以下命令

bash -c 'comm -12 <(sort vms1.txt) <(sort vms2.txt)'

它给出以下输出

sort: cannot read: vms1.txt: No such file or directory
sort: cannot read: vms2.txt: No such file or directory

如何隐藏以上消息?我尝试了stderr重定向方法,但是没有用

bash -c 'comm -12 <(sort vms1.txt) <(sort vms2.txt) 2>&-'

重点是禁止显示错误消息,并且不想在标准输出显示

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)