O'Reilly logo

A Practical Guide to UNIX for Mac OS X Users by Peter Seebach, Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14 The awk Pattern Processing Language

In This Chapter

Syntax

Arguments

Options

Patterns

Actions

Variables

Functions

Associative Arrays

Control Structures

Examples

getline: Controlling Input

Error Messages

The awk utility is a pattern-scanning and processing language that searches one or more files to see whether they contain records (usually lines) that match specified patterns. It processes lines by performing actions, such as writing the record to standard output or incrementing a counter, each time it finds a match. As opposed to procedural languages, the awk language is data driven: You describe the data you want to work with and tell awk what to do with the data once it finds it.

You can use awk to generate reports or filter text. It works ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required