Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I trap for the exit status (string) rather than number?

Status
Not open for further replies.

SJSFoxPro

Technical User
Jun 19, 2003
110
US
I am using a posix shell script to perform a nightly export of a specific schema in my database... I'm checking the exit status of the exp command, but am finding that I really want my messaging to indicate when the exp has completed successfully with warnings. The problem is that the numeric exit status for EX_OKWARN (success with warning) is the same as EX_SUCC (success).

The exit codes are: EX_SUCC=0, EX_OKWARN=0, and EX_FAIL=1. Is there any way to trap the exit code (string) rather than the exit number?

Thanks for any insight!
 
What about a grep in the log file of export?
Or perhaps just the last line, using tail command?

You did not tell us what database it is.
But all databases should offer some kind of export log file...

hope this helps
 
Thanks for your quick reply...

Sorry for the lack of details.

It's an Oracle database. The only thing I could come up with is a grep of the log to see if there were any messages with ORA- or EXP-. I was just hoping that there was a way similar to checking for the $? value, but to get the exit code string instead.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top