tobold.org

correct • elegant • free

△ comp.unix.shell △

◅ exit code

Help with function to check if Bash version >= 2 ▻

exit code

In article <85uhdf$p8v$1@nnrp1.deja.com>,
Jan Pieter van de Giessen  <jpvdgiessen@my-deja.com> wrote:
>If we are talking about unixscripts an exit code is not an error code,
>so you must look in /usr/include/signal.h  the meaning of code 5 =
>trace trap (not reset when caught).

If a process is killed by a signal, it effectively doesn't have an exit
code.  In POSIX, WIFEXITED and WIFSIGNALED are mutually exclusive.  In
rc, $status will be set to a string indicating the terminating signal,
rather than the numerical exit status.  Look what happens when I send
this `sleep' process SIGTRAP.

    ; sleep 100; whatis status
    trace trap--core dumped
    status=sigtrap+core

Tim.
--
Tim Goodwin   | "If you don't know what closures are, you probably don't
Leicester, UK | want to know what closures are." -- Larry Wall

Original headers:

From: tjg@star.le.ac.uk (Tim Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: exit code
Date: 18 Jan 2000 12:16:27 -0000
Message-ID: <861ljh$qmi$1@ltpcg.star.le.ac.uk>
References: <387bcf87.8748165@news.demon.co.uk>
  <of1bt6tanui.fsf@kirsch.dialup.fhg.de>
  <85ghf8$h2c$1@nntp6.u.washington.edu> <85uhdf$p8v$1@nnrp1.deja.com>

△ comp.unix.shell △

◅ exit code

Help with function to check if Bash version >= 2 ▻