On Sat, Dec 13, 2008 at 06:49:52AM +0800, jida...@jidanni.org wrote:
> These however are more insidious, compare bash:
> $ dash -c 'b=5; echo $((--b)); echo $((--b))'
> 5
> 5

--b is being parsed here as a double-negation.

> $ bash -c 'b=5; echo $((--b)); echo $((--b))'
> 4
> 3
> $ dash -c 'b=5; echo $((++b)); echo $((++b))'
> 5
> 5

Similarly, this is being parsed as a double unary-plus.

POSIX says support for ++ and -- is "not required", but it doesn't seem to
(explicitly or implicitly) indicate how an implementation may handle ++b and
--b when they aren't supported:

http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_04

Cheers,
    Olly



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to