Hi all,
I'm writing a fairly large script that is essenially a frontend to other
programs/scripts & I want to redirect stderr to a file and see it on the
screen as well, thus allowing any error messages to be captured to file,
while also letting any prompts/messages passed through stderr to appear on
the screen.
My issue is this:
I'm using the following code which works, but I'm getting a delay of about
~2seconds between when the message is written to stderr and when it appears
on the screen (obviously because of where/how I'm sending it):
[$ErrLog is also written to by other means, such as through 'print', so
$ErrLog.screen is needed - otherwise everything I write to $ErrLog will show
on the screen, when we only want stderr]
...<declarations,etc. (incl. $ErrLog)>...
exec 2>>$ErrLog.screen
tail -f $ErrLog.screen|tee -a $ErrLog &
...<script continues>...
It is this delay I would like to get rid of, but I can't seem to reduce it.
I have tried renice-ing it with different values in the following way, but
with no apparent effect:
...<declarations,etc. (incl. $ErrLog)>...
exec 2>>$ErrLog.screen
(tail -f $ErrLog.screen|tee -a $ErrLog) &
renice -n <newvalue> $!
...<script continues>...
Can anyone help me?
OS/Shell:
UnixWare 7.1.1 i386 x86at SCO UNIX_SVR5
KSH Version M-12/28/93e-SCO
TIA
Jason