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 __