Quote:
|
Originally Posted by r2007
Code:
exec 3>&1
RC=$(exec 4>&1;{ proc;echo $? >&4; }|tee -a logfile >&3)
exec 3>&-
echo $RC
|
RC contains the status of the tee command.
Another way:
Code:
#! /bin/ksh
(proc; echo $? > status_file) | tee -a logfile
RC=$(<status_file)
Jean-Pierre.