1827294 Members
2297 Online
109717 Solutions
New Discussion

Exit Codes

 
Gale W. Satre
New Member

Exit Codes

What are the exit codes on HP-UX 11.0 and what do they mean? Also, what specifically is exit code 2?
2 REPLIES 2
Paul Hite
Trusted Contributor

Re: Exit Codes

There really is no standard for exit codes...each program defines its own. So you need to look at the man page for the particular command.

For example, "man cpio" tells us that a 2 means out-of-phase error. But "man frecover" says 2 means "error conditions prevent the session from completing".

There is somewhat of a standard throughout unix that 0 means success and non-zero means failure of some kind. Even that is not completely followed. So check the man page to be sure.
Carlos Fernandez Riera
Honored Contributor

Re: Exit Codes

Hi:

System programs use to return exit codes as described in /usr/include/errno.h ( really in /usr/include/sys/errno.h. At least it should be so.
i.e: dd returns $?=5. If you look 5 in errno.h this is I/O error.

Note than i have said system programs, no users programs.

But what paul said is really true.
i.e.: last versions of tar returns 5 if when extracting if same file owner is not in passwd.


HTH

unsupported