如果我在shell脚本中使用反引号,是否可以抑制git的命令输出?这是我当前的代码:
OUT=$(git status > /dev/null)
谢谢 :)
我认为您想要的是抑制stderr而不是stdout,因为您仍然想要该值。您可以改为:
OUT=$(git status 2>/dev/null)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
点击生成二维码
我来说两句