Home » Infrastructure » Unix » simple question
simple question [message #98131] Mon, 22 March 2004 13:57 Go to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
I am calling a shell script inner_script.ksh with in a shell script mail_script.ksh, I want continue my main_script.ksh if only inner_script.ksh run successfully. like for space reasons if my inner_script.ksh did not run successfully i want to exit from main_script.ksh without executing any further commands in it. how do i do this?

thanks.
Re: simple question [message #98132 is a reply to message #98131] Tue, 23 March 2004 02:34 Go to previous message
Frank Naude
Messages: 4565
Registered: April 1998
Senior Member
Hi,

You can do something like this:

main_script.ksh:

# Run the inner script...
./inner_script.ksh

# test return code
if [ $? != 0 ]; then
  echo Script failed...
  exit;
else
  echo Script was successfull...
fi


inner_script.ksh:

exit 0;


Best regards.

Frank
Previous Topic: copy files from UNIX to WinNT using Oracle Program Unit
Next Topic: Return values from sqlplus to Shell script
Goto Forum:
  


Current Time: Sun Sep 27 21:49:27 CDT 2020