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
1.4m articles
1.4m replys
5 comments
57.0k users