LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   script expression not running in cronjob (http://www.linuxquestions.org/questions/solaris-opensolaris-20/script-expression-not-running-in-cronjob-662231/)

dningale 08-12-2008 09:23 AM

script expression not running in cronjob
 
hi,


ex. ctot=`expr $ctota + $zar`

echo $ctot

when I puts this in script and fired manually gives output but not when executed as a cronjob.

custangro 08-12-2008 09:50 AM

Quote:

Originally Posted by dningale (Post 3244817)
hi,


ex. ctot=`expr $ctota + $zar`

echo $ctot

when I puts this in script and fired manually gives output but not when executed as a cronjob.

A cron job will not print the output on the screen. You have to redirect the output to a file.

dningale 08-13-2008 12:04 AM

Actually

when I schedules this in cronjob as it should mail the value of variable it does not give any value.

However it mails the value when fired manually.

ex.

tot=890

echo $tot |mailx -s total mailid@domain.com

will mail, blank when added to script and scheduled to cronjob.


All times are GMT -5. The time now is 06:31 PM.