Hacker News new | ask | show | jobs
by fab23 1264 days 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.