THE READING ROOM / BOOK GUIDE
The AWK programming language
A book by AWK's three creators explains a small text-processing language through worked examples, from one-line filters to complete programs, and shows how a compact tool earns its place in daily work.
About the book
The AWK Programming Language comes from Alfred V. Aho, Brian W. Kernighan and Peter Weinberger, the people who designed the language at Bell Labs. It treats AWK as a practical instrument for scanning and reshaping text: records split into fields, patterns that select lines, and actions that print, count or compute. The book builds outward from that model rather than burying it under formalism.
What distinguishes the book is its use of complete, runnable programs as arguments. AWK suits short solutions, and the authors show the language doing real work: summarizing data, generating reports, writing small interpreters and utilities. Each example carries a reason for its shape, so the reader learns idiom alongside syntax. The treatment of regular expressions and field handling stays close to the tasks that motivate them.
The book also addresses the language's limits. AWK is not a general-purpose replacement for larger systems languages, and the authors are candid about where a few lines stop being enough. That honesty gives the material a practical edge: readers learn to judge when AWK fits and when another tool serves better.
How to read it
Read with a terminal open. Type the shorter programs, run them against your own files, and change one piece at a time to see what breaks. The book rewards this kind of active reading because its examples are meant to be executed, not admired.
The prose is plain and the pace steady, though the density rises in the later material on program structure and larger examples. Readers new to regular expressions should slow down there. Those already fluent in shell tools can skim the early syntax and concentrate on the worked programs, which carry most of the instruction.
Who it suits
Programmers who process logs, delimited files and generated text will find immediate use for the pattern-action model, and system administrators working in Unix environments will recognize many of the tasks. Readers learning how to design small languages also gain from seeing a compact language explained by its authors. Beginners comfortable with a command line can follow the early sections; the book assumes some familiarity with programming concepts.
Reading considerations
This is a 1988 text, so expect the Unix setting and tooling of that period. Later AWK implementations, including gawk and other variants, add features the book does not cover, and some examples may need adjustment on modern systems. Treat it as a guide to the core language and its idioms rather than a current reference for every implementation.
Follow the HN conversation
61 different recommenders are recorded in the upstream dataset. These are AI-classified source counts, not an independent rating.
Search HN comments about this book ↗
Explore videos on the same subject ↗
Book notes prepared with DeepSeek, using catalogue records and Open Library subject information. They are reading guidance, not a personal review or a verified chapter-by-chapter account. Book details can vary by edition. HN data methodology · Book metadata and covers.
