Hi:

     Is there a way of knowing if a particular shell script is being executed 
from crontab? If
there's no way to know if it was executed from crontab, can a particular shell 
script determine if
it was executed via command line?

     I want to achieve something like below

     if executed from command line
     then
         # user can see the message at the same time it will be logged to a file
         echo "...." | tee -a $LOG
     else
         # We didn't execute it from command line, most likely it got executed 
via crontab
         # no point in echoing to the terminal
         echo "....." >> $LOG
     fi
         

     Thank you in advance.

Regards,

Ludwig


      
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to