Hacker News
points by rethab 1 day ago | 0 comments
Wonderful AWK command there. For those with hobbies other than AWK, here's what it does:

  - set variable s to that string: -v s='=== /C=IN/OU=emSign PKI/O=eMudhra Technologies Limited/CN=emSign ECC Root CA - G3'
  - on lines matching the regex between //, set skip to false: /^(===|###) /{skip=0}
  - on lines matching s, set skip to true: $0==s{skip=1}
  - if skip is false, print the line: !skip
Note the last part where it just says !skip without a curly braces. AWK defaults to print in that case.
[–] tomjakubowski 1 day ago
AWK is a great hobby, if anyone's looking to get into a new one. If sed is map and grep is filter, then awk is reduce.
[–] somat 1 day ago
AWK is a great little language. But you know how some people get hung up on the useless use of cat, I get triggered whenever I see a grep piped into an awk.

And on the subject of the useless use of cat, I like the form because it makes input a normal command(replaceable by any other command), rather than a shell special form. I sort of wish that "tee" would not default to emitting on stdout to better act as cat's compliment.