At Friday 30 July 2010, Greg Wooledge wrote: > On Fri, Jul 30, 2010 at 09:49:22PM +0200, Stefano Lattarini wrote: > > But then, maybe an exit status of `2' instead of `1' in case of > > errors in ((...)) would be helpful -- currently the exit status > > is still `1' > > > > also if a real error is present: > > $ ((1+)); echo \$?=$? > > bash: ((: 1+: syntax error: operand expected (error token is > > "+") $?=1 > > Most syntax errors cause the shell to abort right then and there, > when in non-interactive mode. Syntax errors inside an arithmetic > context don't, which is already weird. If I were going to ask for > a change, Well, I wasn't really advocating a change here, since I've never had problems with the current behaviour; I was just pointing out that it is suboptimal.
> it would be to make them crash the script instead of > letting bash continue. This makes sense; now I think that, if there's going to be a change, it should be on the lines proposed by you. Regards, Stefano