Awk is a pattern-scanning language designed by Al Aho, Brian Kernighan and Peter Weinberger at Bell Labs in the 1970s to provide string munging, file conversion and data laundry services in the data center. It features strong support for regular expressions, provides string-indexed associative arrays, and operates on a pattern-action paradigm where it scans an input file looking for lines that match a particular pattern then performs a specified action on each matching line. The original version of the language (“old awk”, still available on some unix systems as oawk) had only the pattern-action control structure, the updated version of awk (“new awk”, available as either nawk or simply awk, still maintained by Kernighan) added user-defined functions, dynamic regular expressions, and a somewhat larger library, and the GNU version of awk (known as gawk) adds the ability to read or write to URLs as if they are files.

The Awk Programming Language, by the original authors of the language, is definitive (and is the best “language book” since K&R C). Arnold Robbins, the developer of gawk, has written Effective AWK Programming, which is also excellent. Comp.lang.awk is a low-volume Usenet group. Ronald Loui wrote a surprising paean to awk.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: