In bash script,
echo "error" 1>&2 | tee -a log
will print stderr in screen but no log to file, how to do these at same time?
To echo the text to both the log file and stderr, but not stdout, try this:
echo "error" | tee -a log 1>&2
2.1m questions
2.1m answers
60 comments
57.0k users