bug-bash
[Top][All Lists]
Advanced

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

Incorrect exit status of the Build-IN (( ))


From: Orlob Martin (EXT)
Subject: Incorrect exit status of the Build-IN (( ))
Date: Fri, 7 Dec 2012 10:52:43 +0000

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DH 
   AVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib  
-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
-Wformat-security -Werror=format-security -Wall
uname output: Linux ESO0560-ubuntu 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 
20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.2
Patch Level: 24
Release Status: release

  Description:
         PROBLEM: Exit status not correct, when count up from zero using 
Build-in (( ))

          EXAMPLE (enter each following line in Bash):
                 a=0
                 ((a++))
                 echo $?
                 echo $a
                 ((a++))
                 echo $?
                 echo $a
         COMMENTS TO EXMAPLE:
         The first ((a++)) should perform 'a+1' --> '0+1' (correct operation)
         The first 'echo $?' returns '1' which is not correct, since
         following 'echo $a' returns '1' (result of adding 0+1) which is correct





reply via email to

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