Help for this page

Select Code to Download


  1. or download this
    exec 3>&1
    rc=`(($SOME_COMMAND 2>&1 3>&- 4>&-;echo $? 1>&4) | tee -a $LogFile 1>&
    +3 3>&- 4>&-) 4>&1`
    exec 3>&-
    # $rc has the return code of $SOME_COMMAND.