in reply to Copy STDOUT and STDERR to logfile and also display to screen
tee is useful when you cannot change the script that was given to you and you want to save and view. But if you are the author of the script why can't a simple print statement work?
for example -
if ($error) { print STDERR ("Error: $errmsg\n"); print ERRLOG ("Error: $errmsg\n"); } else { print ("Output: $outstr\n"); print CLEANLOG ("Output: $outstr\n"); }
Of course if you if you are interpolating the string inside print I would probably first do that in a variable and use it inside print to avoid interpolating twice
Am i missing somethign here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copy STDOUT and STDERR to logfile and also display to screen
by Fletch (Bishop) on Aug 10, 2005 at 17:54 UTC | |
by sk (Curate) on Aug 10, 2005 at 18:12 UTC | |
by Fletch (Bishop) on Aug 10, 2005 at 18:23 UTC | |
by sk (Curate) on Aug 10, 2005 at 18:26 UTC |