[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issues in bash found while creating command result display

From: Chet Ramey
Subject: Re: issues in bash found while creating command result display
Date: Tue, 16 Apr 2019 10:44:33 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/16/19 10:36 AM, Eric Blake wrote:
> On 4/15/19 4:31 PM, Chet Ramey wrote:
>> The Korn shell uses values > 256 to denote `internal' shell exit statuses,
>> but that violates POSIX.
> No, actually it does NOT violate POSIX.  In fact, POSIX has tried hard
> to permit that ksh behavior, in particular since that extension allows
> an easy distinction between normal exit with 8-bit status and exit due
> to signal.

It's ambiguous.

"When reporting the exit status with the special parameter '?', the shell
shall report the full eight bits of exit status available."

That can be read as restricting the value of $? to eight bits, regardless
of where the status comes from. It doesn't really say anything about the
exit status of, say, a SIGINT at PS1, or a shell syntax error that doesn't
cause the shell to exit, which is why there's so much variation.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]