How to get the exit status

Hi all,

I'm running a program which return 1 upon success.
But when encounters problem shell return 's '1' .
How to differentiate between them the shell return value and script return value.

Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters any problem and could not run the function 'fn' then shell return '1' indicating that program execution failed.
Return value can be checked using "$?" any alternative way?

No, unless you specify your own return codes and then do a check withing the functions, as in : functionExecution() -> do stuff here, if $? = 0 then take actions. Can we see a portion of the script ?