3 ms·
Nice write-up! A couple of points: On CentOS, at least, gawk == awk which falsifies "patterns cannot capture specific groups to make them available in the ACT
by lotsofcows 12y ago
Nice write-up!
A couple of points:
On CentOS, at least, gawk == awk which falsifies "patterns cannot capture specific groups to make them available in the ACTIONS part of the code". Eg: echo "abcdef" | gawk 'match($0, /b(.*)e/, a) { print a[1]; }'
You missed the match and not match operators ~ and !~ in your list.
Finally, I find people better understand the flexibility of awk when they realise that awk '/bob/ { print }' is shorthand for awk '$0~/bob/ { print $0; }'. This makes it clear that the pattern element is not limited to regexs or matching the whole line.