On 1/12/10 5:16 AM, Stephane CHAZELAS wrote: > 2010-01-11, 17:42(-05), Chet Ramey: >>>> Think of it as >>>> >>>> x = $(( RANDOM%6+1 + RANDOM%6+1 )) >>>> y = dice[x] >>>> dice[RANDOM%6+1 + RANDOM%6+1] = y + 1 >>>> return y >>> [...] >>> >>> I would still consider that a bug. >> >> OK. But everyone does it the same way. > > Except for pdksh, mksh, posh, perl, C.
The three shells in your list are all variants of the same base. It's like using three different releases of bash. The other two aren't shells. C is a reasonable comparison, but there are other differences in how the languages are parsed and executed. > I think by "everyone", you mean "AT&T ksh" and "zsh" or do you > know any other shell or language that behaves like that? I haven't done an extensive investigation. It's not really a significant issue. It's important enough that bash, ksh, and zsh agree. We don't need more incompatibilities between the major shells. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/