Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: