The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 06:44 AM
return code from script mpang_ Shell Programming and Scripting 2 10-23-2007 05:50 PM
Passing exit code to calling script debbiekuch Shell Programming and Scripting 2 09-18-2006 09:46 AM
Capture Oracle return code in shell script Vikas Sood Shell Programming and Scripting 1 05-22-2006 05:32 PM
Store return code of shell script in oracle table sveera Shell Programming and Scripting 3 05-04-2005 01:25 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-05-2002
Connie Connie is offline
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
  #2 (permalink)  
Old 04-23-2002
Connie Connie is offline
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0