Bug#299928: bash: negative exit status are buggy
Package: bash Version: 3.0-14 Severity: normal Hi, Bash accept negative exit status, I don't now if it is normal (dash or posh don't accept it.) But even if there are accepted, the return value is wrong : $ bash -c "exit -1"; echo $? 255 bash -c "exit -10"; echo $? 246 Matthieu -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.11 Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) Versions of packages bash depends on: ii base-files 3.1.2Debian base system miscellaneous f ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an ii libncurses5 5.4-4Shared libraries for terminal hand ii passwd 1:4.0.3-31sarge1 change and administer password and -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#299928: bash: negative exit status are buggy
matthieu castet writes: > Package: bash > Version: 3.0-14 > Severity: normal > > Hi, > > Bash accept negative exit status, I don't now if it is normal (dash or > posh don't accept it.) > > But even if there are accepted, the return value is wrong : > $ bash -c "exit -1"; echo $? > 255 > > bash -c "exit -10"; echo $? > 246 I don't see anything, why this should be disallowed, the behaviour is the same as in zsh. The exit status is anded with 0377, see exit(3). -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#299928: bash: negative exit status are buggy
Matthias Klose wrote: > matthieu castet writes: > >>Package: bash >>Version: 3.0-14 >>Severity: normal >> >>Hi, >> >>Bash accept negative exit status, I don't now if it is normal (dash or >>posh don't accept it.) >> >>But even if there are accepted, the return value is wrong : >>$ bash -c "exit -1"; echo $? >>255 >> >>bash -c "exit -10"; echo $? >>246 > > > I don't see anything, why this should be disallowed, the behaviour is > the same as in zsh. The exit status is anded with 0377, see exit(3). There's no bug here. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ( ``Discere est Dolere'' -- chet ) Live Strong. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#299928: bash: negative exit status are buggy
Hi Matthias, Matthias Klose wrote: matthieu castet writes: Package: bash Version: 3.0-14 Severity: normal Hi, Bash accept negative exit status, I don't now if it is normal (dash or posh don't accept it.) But even if there are accepted, the return value is wrong : $ bash -c "exit -1"; echo $? 255 bash -c "exit -10"; echo $? 246 I don't see anything, why this should be disallowed, the behaviour is the same as in zsh. The exit status is anded with 0377, see exit(3). Ok, may be it could be nice to add it in bash man page. I still wonder if it is valid for POSIX mode as it is not supported by dash and posh. If it is ok, may be a bug report should be filled for dash and posh... Regards, Matthieu -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]