1832891 Members
2487 Online
110048 Solutions
New Discussion

Re: UX - Return Codes

 

UX - Return Codes

Hi all,

maybe a simlpe question, but it would help very much:
On UX systems, comands return a zero when they terminate normaly and a nonzero value when they don't. I a shell script the "exit" command may be used to retun an explicit value. Now my question: Are there any UX - "predefined" exit codes, which the system uses for, let's say, irregular termination?
And what are the values therefor?

Hope you can help me in that matter, and thx a lot.

Thomas
5 REPLIES 5
Andy Monks
Honored Contributor

Re: UX - Return Codes

Each command may return different codes, as it is programmer dependant. Therefore you'll have to check the man pages for the commands your interested in to see what they return when.
Devbinder Singh Marway
Valued Contributor

Re: UX - Return Codes

May be of use --- IF however you want to , block users entering certain commands you can also look at ( kill -l ) signals e.g. in your script block users shelling out by pressing ctrl +c
etc..
Seek and you shall find
John Palmer
Honored Contributor

Re: UX - Return Codes

Thomas,

The file /usr/include/sys/errno.h defines standard C library error codes. The comments define what the error number is used for and may be of assistance to you.

Regards,
John
Andy Monks
Honored Contributor

Re: UX - Return Codes

John, the /usr/include/sys/errno.h file is the return codes for system calls and not hp-ux commands. Although some commands will exit and report the system error (like dd), most do not.
James R. Ferguson
Acclaimed Contributor

Re: UX - Return Codes

Hi:

Some utilities follow at least use:

0=OK, 1=fault 2=warning

...but don't count on that!

...JRF...