Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Problem solving with Unix commands. Parent comment
But awk is actually pretty simple. Imagine everything having an implicit loop like this around it like so:
# BEGIN{ ... } would go here for $0 in input.split('\n'): $1, $2, ... = line.split() # if TEST {ACTION}; pairs ... # END { ... } would go here
if TEST is omitted it's True, if ACTION is it's print the whole line.
There are no comments on this comment yet.
But awk is actually pretty simple. Imagine everything having an implicit loop like this around it like so:
so the first TEST in GP's awk would be `$1 ~ /class|module/` and the corresponding ACTION to take `{print $2}`.if TEST is omitted it's True, if ACTION is it's print the whole line.