Re: cond?true:false and division by 0

2011-08-01 Thread Chet Ramey
On 8/1/11 4:41 AM, dnade@orange-ftgroup.com wrote: > Hello > > I wanted to check a variable before attempting to divide something by it, so > I wrote : > > echo $(( foo==0?0:something/foo )) > > And bash 2, 3 and up to 4.2.10 version sent me a "division by 0" error. > > So, I've test

cond?true:false and division by 0

2011-08-01 Thread dnade.ext
Hello I wanted to check a variable before attempting to divide something by it, so I wrote : echo $(( foo==0?0:something/foo )) And bash 2, 3 and up to 4.2.10 version sent me a "division by 0" error. So, I've tested a static version of the statement : $ echo $(( 0==0?0:1/0 )) -bash: 0