Re: shell error codes

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 11/07/04


Date: Sun, 07 Nov 2004 13:56:53 -0500

In article <418e6396$0$32079$636a15ce@news.free.fr>,
 gregg <greggory@netJUSTSAYNOcourrier.com> wrote:

> Hello,
>
> I was perusing the different errno.h, bits/errno.h, asm/errno.h, but all
> error codes aren't there (and manpages do not contain the number)
>
> I mean: how can i relate the error code returned by the shell to
> something more intelligible (the simple macro E_something would do the
> trick)

The shell doesn't report error codes, it reports the exit status of
programs. These are not standardized, except that 0 means success and
anything else is considered failure. The man page for a program should
explain if it assigns any special meanings to specific exit codes (see
"man grep" for an example).

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • Re: Small Lisp to work with small operating system?
    ... what you are describing here with numerical error codes (and even shell commands, actually) is very much a UNIX design. ... Common Lisp has a great condition system, you should consider using it, or, if you want UNIX, run a UNIX-based Lisp. ... The shell will have its own external-code-check function and condition classes, but the user could substitute if they wanted to. ...
    (comp.lang.lisp)
  • shell error codes
    ... I was perusing the different errno.h, bits/errno.h, asm/errno.h, but all ... error codes aren't there (and manpages do not contain the number) ... I googled a bit, but oftentimes "errno, codes, error codes, shell" point ...
    (comp.unix.shell)
  • Re: what about this new way of opening file
    ... Old Wolf wrote: ... > you have a program that can return N different error codes to the ... > standard that the C standard is aligning itself with, ... All exit codes other than 0, EXIT_SUCCESS, and EXIT_FAILURE are ...
    (comp.lang.c)