Phillip Susi wrote:
> Does redirecting to /dev/tty work if the original stdout of the shell
> was NOT a tty?  This script runs as a cron job so it has no tty.

Probably won't work to use /dev/tty in that case.

> 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

That's about right, but you need >&3 in the trap command.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                           Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to