Chapter 5. Perl as a (better) awk command

5.1

A brief history of AWK

122

5.2

Comparing basic features of awk and Perl

123

5.3

Processing fields

130

5.4

Programming with Patterns and Actions

138

5.5

Matching ranges of records

151

5.6

Using relational and arithmetic operators

157

5.7

Using built-in functions

159

5.8

Additional examples

165

5.9

Using the AWK-to-Perl translator: a2p

175

5.10

Summary

175

The awk command is surely one of the most useful in the Unix toolkit. It’s even more important than grep and sed, because it can do everything they can do and more. That’s to be expected, because unlike those commands, awk implements a general-purpose programming language (called AWK), which can handle many types of data-processing tasks.

This is why a Unix “power user” who’s asked ...

Get Minimal Perl 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.