Redirection in bash: stdout AND stderr to file while SIMULTANEOUSLY stderr to another file.

kitepilot at kitepilot.com kitepilot at kitepilot.com
Sat Jul 11 05:05:20 MST 2009


Good morning... 

What I have:
I wrote a script that generates a LOOOOOOOONG log file...
I send stdout and stderr to the same file so I can see errors into context. 

Problem is:
I have to find that THERE WAS an error first...
There are no obvious cues to separate the GOOD messages from the BAD 
messages and scanning a long text file visually is a (sometimes useless) 
challenge. 

What I want:
stdout to one file.
stderr simultaneously out to 2 files.
I want to keep my log as it is (again, errors into context), but I also want 
to output a parallel log with ERRORS only.
In other words:
One log captures only errors, so I know that something failed and,
another log captures EVERYTHING so I know WHERE it failed. 

I know this is possible, but I am already dizzy trying to make sense of the 
redirection reading.
Thanks!
ET


More information about the PLUG-discuss mailing list