7 ms·
It does also matter where the plus signs are: $ i=0 $ echo $((++i)) 1 $ echo $((i++)) 1 $ echo $((++i)) 3 $ ((++i)) does add 1 before the comm
by fab23 4y ago
It does also matter where the plus signs are:
$ i=0
$ echo $((++i))
1
$ echo $((i++))
1
$ echo $((++i))
3
$
((++i)) does add 1 before the command is run, and ((i++)) does add 1 after the command is run.