[Top][All Lists]

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

bash: S>99?4:S>9?3:S>0?2:0: syntax error in expression

From: Archimerged Ark Submedes
Subject: bash: S>99?4:S>9?3:S>0?2:0: syntax error in expression
Date: Sat, 19 Apr 2008 00:16:10 -0400

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
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
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

        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."

reply via email to

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