[SunHELP] simple query about "exec"

Foong, Tzeweng sunhelp at sunhelp.org
Fri Nov 9 02:07:46 CST 2001


Hmm I would like to know as well !!!

Whan I tried to find out I was not able to figure it out. I hope 
there is a way to do it......  

My solution was to to create another script say "subscript.sh" and 
call that script. Then have subscript.sh do the "exec" thing.
once sub script finishes then the main script will be executing 
and output/loging goes to where it was previously.

Hope this helps. I still would like to know how to reset the 
stdout stderr thing if some one knows how to do it.

Tze Weng Foong




-----Original Message-----
From: TAG DBA [mailto:dbatag at tatainfotech.com]
Sent: Thursday, 8 November 2001 5:18 PM
To: 'sunhelp at sunhelp.org'
Subject: [SunHELP] simple query about "exec"


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
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list