Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables uname output: Linux beta.localnet 2.6.25-0.121.rc5.git4.fc9 #1 SMP Fri Mar 14 23:14:20 EDT 2008 i686 i686 i386 GNU/Linux Machine Type: i386-redhat-linux-gnu
Bash Version: 3.2 Patch Level: 33 Release Status: release Description: gcc accepts the expression S>99?4:S>9?3:S>0?2:0 bash 3.2(33) does not. I claim this is a bash bug: gcc is perfectly happy with S>99?4:S>9?3:S>0?2:0, but GNU bash, version 3.2.33(1)-release (i386-redhat-linux-gnu) chokes on W=$((S>99?4:S>9?3:S>0?2:0)). The bash man page promises that "The operators and their precedence, associativity, and values are the same as in the C language."