Thread: Pipelining
View Single Post
  #5 (permalink)  
Old 07-19-2005
jerardfjay jerardfjay is offline
Registered User
 
Join Date: Feb 2005
Location: Columbus OH
Posts: 128
Quote:
Originally Posted by r2007
Code:
exec 3>&1
RC=$(exec 4>&1;{ proc;echo $? >&4; }|tee -a logfile >&3)
exec 3>&-
echo $RC
Can someone please explain this code.
I know that file handles 1 for stdout and 2 for stderr. what are 3 and 4?
How does the first three lines of code achieve the result that bakunin wanted of returning the result of execution of proc?
Reply With Quote