Thread: Pipelining
View Single Post
  #7 (permalink)  
Old 07-24-2006
aigles's Avatar
aigles aigles is offline
Registered User
 
Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,060
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.
Reply With Quote