> You missed a subshell test:

$ test_crash() { local a=$((009+1)) ;}; cnt=0 rmsg=(success failed)

$ ((cnt+=1)); test_crash                   ;echo case $cnt ${rmsg[$?<1?0:1]}
bash: 009: value too great for base (error token is "009")

$ ((cnt+=1)); ( test_crash )               ;echo case $cnt ${rmsg[$?<1?0:1]}
bash: 009: value too great for base (error token is "009")
case 2 failed

$ ((cnt+=1)); ( test_crash ;: )            ;echo case $cnt ${rmsg[$?<1?0:1]}
bash: 009: value too great for base (error token is "009")
case 3 failed

$ ((cnt+=1)); ( (test_crash) ;: )          ;echo case $cnt ${rmsg[$?<1?0:1]}
bash: 009: value too great for base (error token is "009")
case 4 success

-- 
 Félix Hauri  -  <[email protected]>  -  http://www.f-hauri.ch

Reply via email to