Hacker News new | ask | show | jobs
by yakubin 1525 days ago
mawk is the worst, which, given the article's claim about POSIX, is ironic, because mawk is POSIX-compliant.

  $ mawk --version
  mawk: not an option: --version
  $ mawk --help
  mawk: not an option: --help
  $ mawk -W version
  mawk 1.3.4 20200120
  Copyright 2008-2019,2020, Thomas E. Dickey
  Copyright 1991-1996,2014, Michael D. Brennan

  random-funcs:       srandom/random
  regex-funcs:        internal
  compiled limits:
  sprintf buffer      8192
  maximum-integer     2147483647
And mawk is (was in 16.04 at least) the default version of awk on Ubuntu. How is the user supposed to know this magic incantation? ¯\_(ツ)_/¯
2 comments

To be fair, I can see this coming out of a strict reading of POSIX: it doesn’t say a single word about GNU-style long options (though there is an implied hole where they can fit), but explicitly leaves -W with an argument as a place for implementation-defined crufties when passed to Awk (I haven’t the slightest idea why).

(Honestly I’d rather not have the convention of programs themselves handling this at all and instead have this be `ident awk` or similar, but I understand this is not going to happen.)

I can only imagine that the "w" stands for "what the hell do I need to pass this thing to get it to tell me something useful"