On 7/5/19 5:57 AM, [email protected] wrote:
> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
>
> Description:
> Two related issues, regarding negative exit status.
>
> First, I always thought that the exit status, $?, was in the 0-255
> range.
> ( wait4 int argument for status masked with 0377 )
> But I got a -1 in the exit status of (builtin command) bind.
> Is this a bug or wanted behaviour?
It certainly seems like a problem.
> Second, when ran in a subshell, the same exit status gets mapped to 255.
> While logical, as -1 gets mapped to 255, it seems inconsistent.
> ( from the manual: "The return status is the exit status of list." )
It's the difference between passing a status around the shell and passing
it through the waitpid() interface, which takes just eight bits.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/