The AWK programming language

The AWK programming language interpreter works in many ways like sed; it accepts (by default) lines of input, performs pattern-matching and filtering on each, and applies actions based on those patterns.

AWK is especially well-suited for data that takes the form of a regular pattern of words, or fields, which makes it ideal for filtering data in clearly-delineated columns. By default, fields are separated by any whitespace (spaces or tabs), and records are separated by newlines, but both of these can be changed as part of the program.

The basic form of an AWK program is a set of patterns for each record (normally a line) to match, for which an action is performed for each matching record. We will take a look at ...

Get Bash Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.