tobold.org

correct • elegant • free

△ comp.unix.shell △

reversing a file, line by line ▻

Repost: Re: How to make an octal exit status?

[ Followups directed to comp.unix.shell only. ]

In article <CD4JGy.5L3@twg.bc.ca>, Bill Irwin <bill@twg.bc.ca> quoted
the FM, and asked a question.

>         [...]  An exit status of 0 implies that the command succeeded
>         and everything went well. An exit status of octal 0300-0377
>         indicates that a permanent failure occurred and the message
>         should be rejected.  [...]
>
> My question is:  what is the bsh syntax to have a script exit
> with an octal exit code?

I think you've misinterpreted this.  Exit statuses are just numbers,
and the FM is trying to tell you that an exit status between 300[8]
(or 192[10], or C0[16], or 11000000[2], or...) and 377[8] (or 255[10],
or FF[16], or 11111111[2], or...) indicates a permanent failure.

So I suggest you try "exit 0" for success; "exit 1" for a temporary
failure; and "exit 255" for a permanent failure.

[ I wouldn't be at all surprised to discover that bash has some way to
specify numbers in octal, but I don't know or care what it is. ]

Tim.
--
Tim Goodwin  | "The telephone analogy to the PC being turned off is one
PIPEX Ltd    | of the conversants dying.  The telephone system doesn't
Cambridge UK | drop the call when this happens."  Barry Margolin.

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: comp.unix.shell,comp.unix.internals
Subject: Re: Repost: Re: How to make an octal exit status?
Followup-To: comp.unix.shell
Date: 10 Sep 1993 11:18:41 +0100
Organization: PIPEX Ltd, Cambridge, UK
Message-ID: <26pka1$9o1@tank.pipex.net>
References: <CC9Bou.B3@twg.bc.ca> <CD4JGy.5L3@twg.bc.ca>

△ comp.unix.shell △

reversing a file, line by line ▻