Bash eating stderr output

十年热恋 提交于 2019-12-24 20:23:08

问题


I'm calling a command line tool we wrote from bash on OS X and I have the problem that I don't get the stderr output but only printf's written to stdout.

That's my call:

echo "someInputString" |theTool -v someArg

I also tried:

echo "someInputString" |theTool -v someArg 2>&1

without success... I bet it's trivial but I don't know what needs to be done. Thanks in advance!


回答1:


Redirect the stderr stream output with 2>.

echo "someInputString" |theTool -v someArg 2> error_file


来源:https://stackoverflow.com/questions/16034286/bash-eating-stderr-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!