bug-bash
[Top][All Lists]
Advanced

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

Re: large exit values (>255)


From: Jan Schampera
Subject: Re: large exit values (>255)
Date: Thu, 26 Feb 2009 07:18:24 +0100
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Mike Frysinger wrote:

> $ true
> $ echo '<enter>
> <ctrl+d>
> $ echo $?
> 258
> 
> $ true
> $ echo '<enter>
> <ctrl+d>
> $ echo '<enter>
> <ctrl+c>
> $ echo $?
> 386
> 
> that doesnt seem right to me :)
> 
> the first test seems fine, and older versions of bash would set 258 for the 
> second test (not sure if it's correct though), but the third test looks like 
> a 
> regression (not clearing exit status completely somewhere ?).
> -mike

Wow - how does one find that out? ;)

IMHO everything above 255 is wrong.

Maybe it could be "fixed" by making the $? expansion only respect the
lower 8 bits. Though...weird :) (works in Bash 3 and 4 here)

J.




reply via email to

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