O'Reilly logo

A Practical Guide to Linux® Commands, Editors, and Shell Programming by 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

Chapter 12. The gawk Pattern Processing Language

IN THIS CHAPTER

Syntax 528

Arguments 528

Options 529

Patterns 530

Actions 531

Variables 531

Functions 532

Associative Arrays 534

Control Structures 535

Examples 537

getline: Controlling Input 554

Coprocess: Two-Way I/O 557

Getting Input from a Network 558

Error Messages 559

The gawk (GNU 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 gawk language is data driven: You describe the data you want to work with ...

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