awk
Installation
SKILL.md
GNU awk (gawk) Skill
All output assumes gawk (awk --version shows GNU Awk). POSIX awk
compatibility is not a goal; gawk extensions are used freely where they help.
Core Principles
- Prefer one-liners. Multi-line awk scripts only when a one-liner becomes unreadable.
- Use
-Fto set the field separator explicitly. Never assume space. - Dry-run friendly by default. awk reads and prints; it never edits files
in-place. Redirect explicitly (
> out && mv out in) when the user wants in-place behavior. - Use
BEGIN/ENDblocks for setup and summary output. - Chain with pipes when awk alone isn't the cleanest tool.
- Never use awk to parse JSON or XML. Redirect to
jq/xmllintand say why.