[SunHELP] simple query about "exec"

TAG DBA sunhelp at sunhelp.org
Thu Nov 8 00:18:03 CST 2001


This must be a real simple question - but I cant seem to figure this out :
In one of my scripts I redirect std o/p and std error to a file like
this "
exec >$LOGFILE 2>&1  
And later I reset std error and std input back to the screen like this :
exec > /dev/tty 2>&1 

This works fine when I run the script from the command line - but when I
run it from cron , the second line gives this error :
/scripts/doexp.sh[84]: /dev/tty: cannot create

Perhaps there is no /dev/tty associated with a cron job - but then how
do I still get the script to dump std output and std error to where it
was originally going ?

Thanks and Regards,
~aslam



More information about the SunHELP mailing list