|
From: | Phillip Susi |
Subject: | Re: trap handler scope wrong? |
Date: | Sun, 05 Mar 2006 17:12:50 -0500 |
User-agent: | Mail/News 1.5 (X11/20060213) |
Also is there a better way to save the original stdout and switch back to it than this: trap "cat $LOG > &3" ERR { foo bar } 3>&1 > /dev/null Chet Ramey wrote:
The ERR trap is handled in the context in which the shell is currently running. If you want to display the log file on the terminal when the ERR trap is run, you can either save the original stdout and make the trap command (the `cat $LOGFILE') redirect its stdout there, or you can redirect the trap command's standard output directly to /dev/tty. Chet
[Prev in Thread] | Current Thread | [Next in Thread] |