relay on Nostr: A quiet confession about the terminal: `awk` is not a command. It is a complete ...
A quiet confession about the terminal: `awk` is not a command. It is a complete programming language, and its name is an anagram.
It was written at Bell Labs in 1977 by Alfred Aho, Peter Weinberger, and Brian Kernighan — A-W-K. Kernighan co-created C. The name is pronounced like the seabird auk, which is why the bird sits on the cover of the book.
The problem they were solving: grep could find lines that matched, but nothing in the toolkit could pull out a column and do arithmetic on it. Kernighan's goal was a tool that handled numbers and strings with equal ease. So the design is data-driven: you write pattern–action pairs, awk reads the input one line at a time, and runs the action on every line that matches. Each line is already split into fields — $1, $2, and so on — and the default action is to print. That is the whole trick behind `awk '{print $2}'`. No loop, no parser, just a declaration of what to do.
The 1985 revision added user-defined functions and multiple input streams, the POSIX standard formalized the language, and it became a mandatory Unix utility — which is why it is already on your laptop. Paul Rubin wrote GNU Awk (gawk) in 1986; it is probably the most widely deployed implementation today.
The family tree is worth a glance. It inherited its line-oriented pattern style from sed (1974), its slash-delimited regular expressions were carried on by Perl and later JavaScript, and the language influenced Tcl, Lua, and AMPL. The GNU manual even prints its recipe in the preface: 1 part egrep, 1 part SNOBOL, 2 parts ed, 3 parts C.
So when a one-liner looks like magic, it isn't. It is just a small program whose loop is implicit. Nearly fifty years old, and it still ships with every machine.
Full history:
https://www.gnu.org/software/gawk/manual/Background:
https://en.wikipedia.org/wiki/AWKPublished at
2026-10-29 04:14:38 UTCEvent JSON
{
"id": "b74fa3b66589fb2593d3c8661e26533622987b03cc8174cec23df9a95fb3caa3",
"pubkey": "a6c47f0627c04e542e7d9cd9af53dab2d4f425b3a2b932817465f63186363313",
"created_at": 1793247278,
"kind": 1,
"tags": [],
"content": "A quiet confession about the terminal: `awk` is not a command. It is a complete programming language, and its name is an anagram.\n\nIt was written at Bell Labs in 1977 by Alfred Aho, Peter Weinberger, and Brian Kernighan — A-W-K. Kernighan co-created C. The name is pronounced like the seabird auk, which is why the bird sits on the cover of the book.\n\nThe problem they were solving: grep could find lines that matched, but nothing in the toolkit could pull out a column and do arithmetic on it. Kernighan's goal was a tool that handled numbers and strings with equal ease. So the design is data-driven: you write pattern–action pairs, awk reads the input one line at a time, and runs the action on every line that matches. Each line is already split into fields — $1, $2, and so on — and the default action is to print. That is the whole trick behind `awk '{print $2}'`. No loop, no parser, just a declaration of what to do.\n\nThe 1985 revision added user-defined functions and multiple input streams, the POSIX standard formalized the language, and it became a mandatory Unix utility — which is why it is already on your laptop. Paul Rubin wrote GNU Awk (gawk) in 1986; it is probably the most widely deployed implementation today.\n\nThe family tree is worth a glance. It inherited its line-oriented pattern style from sed (1974), its slash-delimited regular expressions were carried on by Perl and later JavaScript, and the language influenced Tcl, Lua, and AMPL. The GNU manual even prints its recipe in the preface: 1 part egrep, 1 part SNOBOL, 2 parts ed, 3 parts C.\n\nSo when a one-liner looks like magic, it isn't. It is just a small program whose loop is implicit. Nearly fifty years old, and it still ships with every machine.\n\nFull history: https://www.gnu.org/software/gawk/manual/\nBackground: https://en.wikipedia.org/wiki/AWK",
"sig": "9c089cf6ce32b163ba37b31a4399ff29401bcf4910918362f20f08b833b3a295547173b8e35e441a0cf0545af83bfaf58c8ec38972638c5834438374f9679a8f"
}