-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 11/16/2008 2:22 PM:
>> $ echo $((+))
>> bash: +: syntax error: operand expected (error token is "+")
>> $ echo $?
>> 0
>>
>> so we can't really make as_func_arith a reliable way to detect ill-formed
>> input.
> 
> Hmm, bash 3.2.39 here does, as does zsh 4.3.6.  OTOH, pdksh doesn't
> output an error neither change the status.

I spoke a bit too soon.  Bash _does_ set $?, but fails to set $PIPESTATUS
(I have $PIPESTATUS in my PS1, and it is annoying when the two disagree).
 So although my claim was false about $?, I was correct that bash has a bug.

$ PS1='${PIPESTATUS[*]} \$ '
0 $ echo $?
0
0 $ echo $((+))
bash: +: syntax error: operand expected (error token is "+")
0 $ echo $?
1
0 $ false
1 $

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkgkFAACgkQ84KuGfSFAYDf9wCcDK+ca+snte4b+eH/yCCORfY3
opEAn24ZX770EE074wa4kltfzXg+F/a5
=DFxG
-----END PGP SIGNATURE-----


Reply via email to