sh ++/-- operators

Dan Nelson dnelson at
Thu Jun 10 17:15:25 UTC 2010

In the last episode (Jun 10), RW said:
> FreeBSD's sh (in 8.0) doesn't seem to support the ++ or -- arithmetic
> operators
>   $ echo "$((n++))"
>   arithmetic expression: syntax error: "n++"
> Am I wrong in thinking these are POSIX operators? It seems odd if they
> were simply left-out..

Easy enough to check:

 * The sizeof() operator and the prefix and postfix "++" and "--" operators
   are not required.

Patches welcome to implement them if you want them :)

	Dan Nelson
	dnelson at

More information about the freebsd-questions mailing list