Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process.
I know that we can use $? to get the final status but this is on unix command. How can I return a value from the script??????

You could save the exit status of the program
and use it in the shells exit statement...

#!/bin/sh
...
you're script code
PROC_RET=$?

echo "Returning $PROC_RET to Informix" >> ./Debug.log
exit $PROC_RET

Look at the popen() subroutine in the man pages.

return value of shell skripts is like booleans

--------------
example 1:
--------
ls
echo $? //(this returns 0 for true)

--------------
example 2:
--------
ls xyz
echo $? //(this returns 1 for false)