Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error codes

Status
Not open for further replies.

darfader

Programmer
Aug 6, 2003
38
GB
SunOS 5.6
ksh

Hi,

is there a standard set of error codes that can be picked up from $? and is it possible to find out what they mean by querying the OS like

$ err 139

or someting similar ?


tia,
 
The return value depends on the command you are calling. It's different for each command. Generally if you want to see the exit codes for any given command you look at the man page.
 
thanks Wonboodoo,

unfortunately man 139 doesn't produce anything :(

this was what I was looking for

139. NFS write failed for server variable: RPC: Timed out



cheers
 
as already noted, the return code will DIFFER based on the original command.

What's the command the return code you're interested in?

man <yourCommand>

When in doubt, 'man man'!

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
For example :

man dd
------
Exit Status
This command returns the following exit values:

0 The input file was copied successfully.
>0 An error occurred.

man diff
--------
Exit Status
This command returns the following exit values:

0 No differences were found.
1 Differences were found.
>1 An error occurred.

man env
-------
Exit Status
If the Command parameter is specified, the exit status of the env command is
the exit status of the command specified in the Command parameter.
Otherwise, the env command exits with one of the following values:

0 The env command completed successfully.
1-125 An error occurred in the env command.
126 The command specified by the Command parameter was found, but could not be invoked.
127 The command specified by the Command parameter was not found.




Dickie Bird (:)-)))
 
To see a list of error codes returned by common system calls (not those returned to the shell in $?) you can look at /usr/include/errno.h. There may also be a variety of other errno.h files in subdirectories under /usr/include which should be checked as well; their locations vary across flavours of Unix.

Annihilannic.
 
thank you all,

I have made of note of these locations


:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top