Awk is a programming language whose basic operation is to search a set of files for patterns, and to perform specified actions upon lines or fields of lines which contain instances of those patterns. Awk makes certain data selection and transformation operations easy to express; for example, the awk program
prints all input lines whose length exceeds 72 characters; the program
prints all lines with an even number of fields; and the program
replaces the first field of each line by its logarithm.
Awk patterns may include arbitrary boolean combinations of regular expressions and of relational operators on strings, numbers, fields, variables, and array elements. Actions may include the same pattern-matching constructions as in patterns, as well as arithmetic and string expressions and assignments, if-else, while, for statements, and multiple output streams.
This report contains a user's guide, a discussion of the design and implementation of awk, and some timing statistics.