LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 08-12-2008, 09:23 AM   #1
dningale
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Rep: Reputation: 15
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.

Last edited by dningale; 08-12-2008 at 09:28 AM.
 
Old 08-12-2008, 09:50 AM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by dningale View Post
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.
 
Old 08-13-2008, 12:04 AM   #3
dningale
LQ Newbie
 
Registered: Aug 2008
Posts: 25

Original Poster
Rep: Reputation: 15
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.

Last edited by dningale; 08-13-2008 at 12:39 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob --> my script to scp to remote server bskrakes Linux - General 5 07-04-2007 04:25 PM
sftp script via cronjob ?? OzTEXS Linux - Security 21 12-28-2006 03:38 PM
Cronjob / script question nazs Linux - General 1 12-21-2006 01:45 PM
cronjob php script MrSako Linux - General 1 08-27-2006 07:30 PM
cronjob not working but script works dtra Linux - Newbie 4 02-28-2005 05:05 PM


All times are GMT -5. The time now is 08:11 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration