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