The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's manas6 UNIX for Dummies Questions & Answers 0 06-05-2008 03:44 AM
return code from script mpang_ Shell Programming and Scripting 2 10-23-2007 02:50 PM
Passing exit code to calling script debbiekuch Shell Programming and Scripting 2 09-18-2006 06:46 AM
Capture Oracle return code in shell script Vikas Sood Shell Programming and Scripting 1 05-22-2006 02:32 PM
Store return code of shell script in oracle table sveera Shell Programming and Scripting 3 05-04-2005 10:25 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-05-2002
Registered User
 

Join Date: Apr 2002
Posts: 2
Cool mailx in kornshell script passing return code to CA-Unicenter

I have a KornShell script that has successfully been scheduled through Cron. We are in the process of changing over from Cron to using CA-Unicenter. To negative test the script I put a bad return code in. At the bottom of the script an e-mail is sent using mailx and then the return code is set using "exit 2". However, CA-Unicenter gets a zero return code back. If I comment out the mailx code, then CA-Unicenter will show up with a return code of 2. My assumption is that the mailx command ends with a zero return code and CA-Unicenter gets it and assumes its from the KornShell script. Here's the piece of code in question:

CENTMSGRC=2
print $CENTMSGRC >> /appl/cmddba/bin/job.log

mailx -s "$subject" "$MAILTO" </appl/cmddba/bin/job.log

print $CENTMSGRC >> /appl/cmddba/bin/job.log

exit $CENTMSGRC

Do you have any idea if my theory is correct? And if it is, do you know a solution to my problem besides creating another Script that will just send the e-mail message and have the script executed after the first one.

Thanks,
Connie
Forum Sponsor
  #2  
Old 04-23-2002
Registered User
 

Join Date: Apr 2002
Posts: 2
We have discovered that there is a setting within CA-Unicenter that will fix this problem. The following 2 configuation changes where made in CA-Unicenter:

enfcontrol JOB TRIGGER EXITMAIN
instructs CAIENF to consider a job as completed when the main process of the job has completed. We have used this for jobs such as starting a database, the database pid remains active, yet the script that started them can end.

enfcontrol JOB RC EXITMAIN
The control option JOB RC indicates that the exit return code presented by CAIENF to the Unicenter-TNG Workload Management component is the exit code of the main process (shell script).

So essentially CA-Unicenter has been configured to only accept the exit code from the main process script.

Connie
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0