Bash Scripting: Redirect output of entire script to file & screen
Hi All,
Trying to get my head around this one. How would I redirect stdout and stderr of an entire bash script to a file, but also leaving the output to the screen? I've tried various combination of exec and tee, and I can't get anything to work =/ Any help is much appreciated. -Kristijan |
First copy stderr to stdout, then use tee to copy stdout to a file:
Code:
script.sh 2>&1 |tee out.log |
Quote:
|
Just try it, you'll find out.
|
All times are GMT -5. The time now is 11:24 AM. |