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

I believe no distro actually ships this version of awk by default. They ship GNU awk which has Unicode support anyways.


OpenBSD uses "The One True AWK."

  $ awk -V
  awk version 20211208
Kernighan's version is likely used in other places where the GPL is eschewed.


I think the other BSDs do too, including macOS.


Yes, here on macOS 11.6.8

  $ awk -version
  awk version 20200816


On a FreeBSD 12.3-RELEASE box, FWIW:

   # awk -version
   awk version 20210215



So it turns out the default on Debian is mawk which does NOT support Unicode. Thanks for pointing that out. This simple test gives different results for gawk and mawk.

  $ echo 'ö' | awk '{print length}'


…only if the current locale is set to use UTF-8 (or some other variable-width encoding). Which nowadays the default locale usually does, but in principle it doesn’t need to be.




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

Search: