问题
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