|
| From: | Chet Ramey |
| Subject: | Re: bash: S>99?4:S>9?3:S>0?2:0: syntax error in expression |
| Date: | Sun, 20 Apr 2008 15:25:02 -0400 |
| User-agent: | Thunderbird 2.0.0.12 (Macintosh/20080213) |
Archimerged Ark Submedes wrote:
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."
Thanks for the report; it was an operator precedence problem. It's
fixed for the next version.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/
| [Prev in Thread] | Current Thread | [Next in Thread] |