simple question [message #98131] |
Mon, 22 March 2004 13:57 |
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 |
Frank Naude
Messages: 4581 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:
Best regards.
Frank
|
|
|