Question : Unix Exit Codes

Hi,

I'm using a script to start my application on a daily basis. A cron-like application called Control-M calls this script at a give time and starts the app. The script istelf is very simple as you can see below.

However the line "Load app" occasionally has thrown an error which has resulted in "app.sh" failing to start up the applicartion. I need to check the "Load app" command has completed successfully before calling app.sh, otherwise abort.

How can I do this? Some one mention using exit codes, but I don't know how this works. any ideas?
Code Snippet:
1:
2:
3:
4:
#!/bin/ksh
. /apps/bin/0LOAD
Load app
app.sh
Open in New Window Select All

Answer : Unix Exit Codes

1:
2:
3:
4:
#!/bin/ksh
. /apps/bin/0LOAD
Load app || exit 1
app.sh
Open in New Window Select All
Random Solutions  
 
programming4us programming4us