in reply to Copy STDOUT and STDERR to logfile and also display to screen
select STDERR; $|=1 unless (open STDERR, '|-') { eval { open ERRLOG, ">/tmp/errlog" or die; while(<>) { print ERRLOG $_; print STDERR $_; } }; exit(0); } # repeat for STDOUT
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copy STDOUT and STDERR to logfile and also display to screen
by boat73 (Scribe) on Aug 11, 2005 at 11:51 UTC |