1834007 Members
1805 Online
110063 Solutions
New Discussion

ksh return code

 
F Saluba
Occasional Contributor

ksh return code

I have a script that is giving me a return code of 64. Where can I look up that return code for more information?

Thanks
6 REPLIES 6
Peter Godron
Honored Contributor

Re: ksh return code

Hi,
afraid you have to debug your script as the return code can be set, by for example "exit 64".
Include "set -x" near the start of your script to trace.

You may also want to have a look at:
http://forums1.itrc.hp.com/service/forums/helptips.do?#22

Ivan Krastev
Honored Contributor

Re: ksh return code

Some info:

# grep 64 sysexits.h
# define EX__BASE 64 /* base value for error messages */
# define EX_USAGE 64 /* command line usage error */


Try to run sript with -x option to see more details.

regards,
ivan
Keith Johnson
Valued Contributor

Re: ksh return code

If you did not set the return status (ex. return 64) then the status is coming from the last command executed within the script. If that is the case, you could try and do a "man" on that command to see if the error code is documented there.
No matter where you go...there you are.
spex
Honored Contributor

Re: ksh return code

Hi,

According to this scripting guide:
http://www.aero.jussieu.fr/services/INFO/documentation/mendel/HTML/exitcodes.html
the recommended user-defined range for exit codes is 64-113.

PCS
Bill Hassell
Honored Contributor

Re: ksh return code

Shells only have error codes when a problem has occurred within a shell task. That is not the same as running a command and exiting due to an error. Virtually all well written scripts will have error codes defined which you can see. Otherwise, the error was caused by a failed command or a logic problem in the script such as arithmetic on some random or null text. In the problem script, put the line:

set -x

at the top of the script. When the script fails, you'll see what it was trying to do. If the script tried to run a built-in function, you'll need to add the set -x to the function to get the exact failure.


Bill Hassell, sysadmin
Peter Godron
Honored Contributor

Re: ksh return code

Hi,
as you have not updated this thread I assume the problem is resolved ?

Please see http://forums1.itrc.hp.com/service/forums/helptips.do?#22 to reward the work the contributors have put into resolving your problem and then close this thread summarising the solution. This will help future problem resolution.

From your profile I see you have not allocated any points to any answers to your post(0 for 10)!