How to get the exit status of a command in nner script to the outer script?

Hi all,

I have a shell script inside which i am executing another shell script. In the inner script im executing a command. i want the status of that command in the outer script to perform some validations.

How to get its status please help!!1

Im using ksh.

You'd have to give better example. Most likely the inner script returns the status of the last executed command. If the command of interest is not the last executed command, than you would store it ret=$? and make sure you exit "$ret" .

try using the exit $NUMBER statement inside the inner script which upon return to the outer script will bring in the value of that particular variable. if that is not acceptable, try exporting it to environment using export , 3rd option would be use a temp file with the value of the parameter and then use it by reading the temp file.