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?
