equal
deleted
inserted
replaced
35 # Propagate the result code from acommand so that |
35 # Propagate the result code from acommand so that |
36 # ./logger.sh exits with the same result code. |
36 # ./logger.sh exits with the same result code. |
37 |
37 |
38 # Create a temporary directory to store the result code from |
38 # Create a temporary directory to store the result code from |
39 # the wrapped command. |
39 # the wrapped command. |
40 RCDIR=`mktemp -d tmp.XXXXXX` || exit $? |
40 RCDIR=`mktemp -dt jdk-build-logger.tmp.XXXXXX` || exit $? |
41 trap "rm -rf '$RCDIR'" EXIT |
41 trap "rm -rf \"$RCDIR\"" EXIT |
42 LOGFILE=$1 |
42 LOGFILE=$1 |
43 shift |
43 shift |
44 (exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > $RCDIR/rc) | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE |
44 (exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > "$RCDIR/rc") | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE |
45 exit `cat $RCDIR/rc` |
45 exit `cat "$RCDIR/rc"` |
46 |
|