Hi folks,
This is a question about sending script output (for clarity, Bourne shell) into two identical files. One file is a normal log, second is used to append debug messages so they are mixed with normal output.
Suppose we use this way of redirecting (from inside the script):
exec > logfile1 2>&1
If I had a second log file I could use some debug messaging:
echo Debug msg.... >> logfile2
But I have a single log file... Any help with this?
Another question is, once redirected with "exec", what is the proper way of closing the log file(s) before leaving the script run? Should I redirect output back to where it was before?
Thanks in advance.