Hacker News new | ask | show | jobs
by chasil 41 days ago
Awk also says it's 12.

  awk 'BEGIN{a=5; a = a++ + ++a; print a}'
  12
1 comments

https://www.gnu.org/software/gawk/manual/gawk.html#index-pre...

"When side effects happen is implementation-defined. In other words, it is up to the particular version of awk."

Android appears to use the One True AWK.

  :/ $ awk 'BEGIN{a=5; a = a++ + ++a; print a}'
  12

  :/ $ which awk
  /system/bin/awk

  :/ $ awk --version
  awk version 20240728