home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 11.1 Command-line Syntax Chapter 11
The Awk Scripting Language
Next: 11.3 Patterns and Procedures

11.2 Conceptual Overview

Awk is a pattern-matching program for processing files, especially when they are databases. The new version of awk, called nawk, provides additional capabilities and is now the standard in SVR4. Awk is still available under the same name (it is really just a link to the command oawk ). In the next major release of System V, nawk will become the default. (The Free Software Foundation has a version of awk called gawk. All features in nawk are available in gawk.)

With original awk, you can:

  • Think of a text file as made up of records and fields in a textual database.

  • Use variables to change the database.

  • Perform arithmetic and string operations.

  • Use programming constructs such as loops and conditionals.

  • Produce formatted reports.

With nawk, you can also:

  • Define your own functions.

  • Execute UNIX commands from a script.

  • Process the result of UNIX commands.

  • Process command-line arguments more gracefully.

  • Work more easily with multiple input streams.

Previous: 11.1 Command-line Syntax UNIX in a Nutshell: System V Edition Next: 11.3 Patterns and Procedures
11.1 Command-line Syntax Book Index 11.3 Patterns and Procedures

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System