Re: bash expr problem/bug... 0$val

2005-08-19 Thread Hugh Sasse
On Fri, 19 Aug 2005, [EMAIL PROTECTED] wrote: Description: bash-expr problems... if a=500 i expect "c: 500", but produce 320 if a="z" i expect "c: 0", but produce 40 [...] Repeat-By: # a=500; b="0$[a]"; c=$[b]; echo -e "a: $a\nb: $b\nc: $

Re: bash expr problem/bug... 0$val

2005-08-19 Thread Paul Jarc
[EMAIL PROTECTED] wrote: > # a=500; b="0$[a]"; c=$[b]; echo -e "a: $a\nb: $b\nc: $c\n" > a: 500 > b: 0500 > c: 320 man bash, under ARITHMETIC EVALUATION: Constants with a leading 0 are interpreted as octal numbers. paul __

bash expr problem/bug... 0$val

2005-08-19 Thread bloodman
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-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../