copying stdout and stderr to seperate files
i want to run a script that creates large quantaties sdtout and posts errors to sterr putting these into 2 seperare files, (eg stdout.txt and stderr.txt) (extentions only for conviniance!)
however i also want thease to do to stdout and std error on the screen. i have been using "tee" to do this ie. command | tee [filename] but this doesnt do anything with stderr (which is more impiortant that stdout) what would be the best way to do this? |
command 2>&1 | tee filename
This will redirect standard error into stdout. So the file will have both :) |
redirect your stderr to stdout using
2>&1 like Code:
echo "hi" 2>&1 | tee -a a.txt; |
All times are GMT -5. The time now is 02:03 AM. |