[Top][All Lists]

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

Wrong input confuses bash's arithmetic unit permanently

From: Enrico Scholz
Subject: Wrong input confuses bash's arithmetic unit permanently
Date: Tue, 11 Sep 2007 22:23:14 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_GNU_SOURCE 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic 
uname output: Linux kosh.bigo.ensc.de #1 SMP PREEMPT Thu Aug 16 
23:36:51 CEST 2007 i686 i686 i386 GNU/Linux
Machine Type: i686-redhat-linux-gnu

Bash Version: 3.2
Patch Level: 9
Release Status: release


A syntactical wrong statement will confuse bash permanently so that 
arithmetic operations return wrong results.

[copy from https://bugzilla.redhat.com/show_bug.cgi?id=286861]
$ i=0
$ let ++i
$ echo $i

$ let tmp="foo.a"+0
bash: let: tmp=foo.a+0: syntax error: invalid arithmetic...

$ i=0
$ let ++i
$ echo $i

--> every further use of 'let' will generate bogus results. bash-3.1 returns
expected results.

reply via email to

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