On 2013-08-26 21:36, David Lehmann wrote: > My issue is that the resulting behavior in Exercise 1 does not make sense. > > The resulting value of i should have no bearing on the exit code. If the > addition succeeded, the expression should return 0 (success). If i was not > an integer (e.g. i=hello), then I expect (( i++ )) to return a non-zero > error code. > > ...IMHO, of course.
That would be pretty much rewriting the entire way that (( works, since the whole point is that it returns a status based upon having a return value that is >0. Compare: $ (( 0 )); echo "$?" 1 $ (( 1 )); echo "$?" 0
pgplrgI2Lzb_o.pgp
Description: PGP signature