Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Conceptual Overview

awk is a pattern-matching program for processing files, especially when each line has a simple field-oriented layout. Linux provides the GNU version of awk, called gawk, which provides a number of additional features. This utility can be invoked either through the standard name awk or through gawk.

This chapter describes functionality that is found in gawk. Most of this discussion applies to all versions of awk, but items marked “gawk-specific” or as an “extension” may not apply to versions of awk other than GNU’s. If portability to older, non-Linux systems is important, do not use gawk-specific features.

With gawk, you can:

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

  • Perform arithmetic and string operations.

  • Use programming constructs, such as loops and conditionals.

  • Produce formatted reports.

  • Define your own functions.

  • Execute Unix commands from a script.

  • Process the results of Unix commands.

  • Process command-line arguments gracefully.

  • Work easily with multiple input streams.

  • Flush open output files and pipes.

  • Sort arrays.

  • Retrieve and format system time values.

  • Do bit manipulation.

  • Internationalize your gawk programs, allowing strings to be translated into a local language at runtime.

  • Perform two-way I/O to a coprocess.

  • Open a two-way TCP/IP connection to a socket.

  • Dynamically add built-in functions.

  • Profile your gawk programs.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page