Effective awk Programming (3rd Edition)

Effective awk Programming (3rd Edition)
by Arnold Robbins

Effective awk Programming (3rd Edition)
List Price: $44.99
Our Price: $33.64
You Save: $11.35 (25%)
Availability: Usually ships in 1-2 business days
Buy Used: from $19.99 (click here)
Category: Book
See more book details and other editions


(Click here)
Buy this book at online book store in your country
Canada | UK | Germany | France

Book Summary Information

Author: Arnold Robbins
Edition: Paperback
Audio: English (Unknown); English (Original Language); English (Published)
Published: 2001-05-15
ISBN: 0596000707
Number of pages: 456
Publisher: O'Reilly Media

Book Reviews of Effective awk Programming (3rd Edition)

Book Review: Excellent tutorial & reference that zeroes in on awk
Summary: 5 Stars

This book explains both the awk language and how to run the awk utility. You should already be familiar with basic system commands, such as cat and ls, as well as basic shell facilities, such as input/output redirection and pipes. This book describes the awk language in general and also the particular implementation of awk called gawk. gawk runs on a broad range of Unix systems and has also been ported to Mac OS X, MS-DOS, Microsoft Windows, and VMS.

Many people are familiar with O'Reilly's book on sed and awk, but not this book. If you want to zero in on awk and its capabilities, this is really the better of the two books. It makes an excellent tutorial and reference for system administrators and anyone else that wants to use awk to extract and format text. The following is a description of the book from the context of the table of contents:

Chapter 1. The awk language and gawk - talks about the basics including how to run awk, when you should use awk, and starts you off with a few simple examples.

Chapter 2. Regular expressions - introduces regular expressions in general, and in particular the flavors supported by POSIX awk and gawk.

Chapter 3 Reading Input Files - describes how awk reads your data. It introduces the concepts of records and fields, as well as the getline command. I/O redirection is first described here.

Chapter 4. Printing Output - Besides basic and formatted printing, this chapter also covers I/O redirections to files and pipes, introduces the special filenames that gawk processes internally, and discusses the close built-in function.

Chapter 5. Expressions - describes expressions, which are the basic building blocks of awk patterns and actions.

Chapter 6. Patterns, Actions, and Variables - Each awk statement consists of a pattern with an associated action. This chapter describes how you build patterns and actions, what kinds of things you can do within actions, and awk's built-in variables.

Chapter 7. Arrays in awk - describes how arrays work in awk, how to use array elements, how to scan through every element in an array, and how to remove array elements. It also describes how awk simulates multidimensional arrays, as well as some of the less obvious points about array usage. The chapter finishes with a discussion of gawk's facility for sorting an array based on its indices.

Chapter 8. Functions - describes awk's built-in functions, which fall into three categories: numeric, string, and I/O. gawk provides additional groups of functions to work with values that represent time, do bit manipulation, and internationalize and localize programs.

Chapter 9. Internationalization with gawk - describes the underlying library gawk uses for internationalization, as well as how gawk makes internationalization features available at the awk program level. Having internationalization available at the awk level gives software developers additional flexibility - they are no longer required to write in C when internationalization is a requirement.

Chapter 10. Advanced Features of gawk - a "grab bag" of items that are otherwise unrelated to each other. First, a command-line option allows gawk to recognize nondecimal numbers in input data, not just in awk programs. Next, two-way I/O, discussed briefly in earlier parts of this book, is described in full detail, along with the basics of TCP/IP networking and BSD portal files. Finally, gawk can profile an awk program, making it possible to tune it for performance.

Chapter 11. Running awk and gawk - covers how to run awk, both POSIX-standard and gawk-specific command-line options, and what awk and gawk do with non-option arguments. It then proceeds to cover how gawk searches for source files, obsolete options and/or features, and known bugs in gawk. This chapter rounds out the discussion of awk as a program and as a language. While a number of the options and features described here were discussed in passing earlier in the book, this chapter provides the full details.

Chapter 12. A Library of awk Functions - One valuable way to learn a new programming language is to read programs in that language. To that end, this chapter and Chapter 13 provide a good-sized body of code for you to read, and hopefully, to learn from.

Chapter 13. Practical awk Programs - presents a potpourri of awk programs for your reading enjoyment. The first part describes how to run the programs presented in this chapter. The second presents awk versions of several common POSIX utilities. These are programs that you are hopefully already familiar with, and therefore, whose problems are understood. By reimplementing these programs in awk, you can focus on the awk-related aspects of solving the programming problem.

Chapter 14. Internetworking with gawk - describes gawk's networking features in depth, including a number of interesting examples and the reusable core of a gawk-based web server. The chapter is adapted from "TCP/IP Internetworking with gawk", by Jürgen Kahrs and Arnold Robbins, which is a separate document distributed with gawk.

Thus chapters 1-11 form a tutorial and reference on awk itself, and the last three chapters are additional material for reference or your own personal toolchest of programs. The last chapter is more of a curiosity than anything, since I don't know anyone who does internetworking with gawk, but it is still interesting material. I highly recommend this book if you plan to use awk extensively.

Summary of Effective awk Programming (3rd Edition)

Effective awk Programming,3rd Edition, focuses entirely on awk, exploring it in the greatest depth of the three awk titles we carry. It's an excellent companion piece to the more broadly focused second edition.

This book provides complete coverage of the gawk 3.1 language as well as the most up-to-date coverage of the POSIX standard for awk available anywhere. Author Arnold Robbins clearly distinguishes standard awk features from GNU awk (gawk)-specific features, shines light into many of the "dark corners" of the language (areas to watch out for when programming), and devotes two full chapters to example programs. A brand new chapter is devoted to TCP/IP networking with gawk. He includes a summary of how the awk language evolved.

The book also covers:

  • Internationalization of gawk
  • Interfacing to i18n at the awk level
  • Two-way pipes
  • TCP/IP networking via the two-way pipe interface
  • The new PROCINFO array, which provides information about running gawk
  • Profiling and pretty-printing awk programs

In addition to covering the awk language, this book serves as the official "User's Guide" for the GNU implementation of awk (gawk), describing in an integrated fashion the extensions available to the System V Release 4 version of awk that are also available in gawk.

As the official gawk User's Guide, this book will also be available electronically, and can be freely copied and distributed under the terms of the Free Software Foundation's Free Documentation License (FDL). A portion of the proceeds from sales of this book will go to the Free Software Foundation to support further development of free and open source software.

The third edition of Effective awk Programming is a GNU Manual and is published by O'Reilly & Associates under the Free Software Foundation's Free Documentation License (FDL). A portion of the proceeds from the sale of this book is donated to the Free Software Foundation to further development of GNU software. This book is also available in electronic form; you have the freedom to modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.


For anyone who writes scripts in the awk family of languages, the third edition of Effective awk Programming provides an in-depth guide to processing text files with plenty of working sample code. Whether you are starting out with awk or are an experienced developer, this book will help you extend the reach of your awk scripts.

This tutorial covers the entire spectrum of awk script development: From the basics of opening, searching, and transforming text files, to a comprehensive tutorial for regular expressions, to more advanced features like internetworking. The focus is on the practical side of creating and running awk scripts, and there's plenty of hands-on advice for installing and running today's awk (and gawk).

The book begins with the fundamentals of awk for opening and transforming text flat files. The coverage of regular expressions, from simple rules for matching text to more advanced options, is particularly solid. You learn how to add variables and expressions for more intelligent awk scripts, plus how to parse data into records and fields. You'll also find out how to redirect output from awk scripts to other programs, a useful technique that can cause awk to get a lot more done in real applications.

Later, you learn several valuable sample awk scripts that mimic existing Unix utilities (like grep, id, and split), plus samples for counting words in documents and printing mailing labels, and even a stream editor. This grab bag of sample code lets you try out the techniques presented earlier in the book. Other sections look at support for networking in today's gawk; for example, how gawk can read and write to URLs on the network almost just as easily as local files. Full sample code will teach the beginner or expert how to get productive with networks and awk. Final appendices trace the evolution of the awk language and show you how to download and install gawk.

Suitable for beginner and experienced awk developers, Effective awk Programming, Third Edition, is an extremely worthwhile source of information on a wide range of programming techniques for today's awk. --Richard Dragan

Topics covered:

  • Introduction to the awk programming language
  • Running awk scripts
  • Basic file processing
  • Tutorial for regular expressions
  • Strategies for matching text
  • Dynamic regular expressions
  • Parsing data into records and lines (including separating fields and handling multiple-line records)
  • Using print and printf for printed output with awk (including format specifiers)
  • Redirecting awk scripts output to other processes
  • Basic and advanced awk expressions (constants, variables, and function calls)
  • Patterns
  • Shell variables and actions
  • Arrays (including multidimensional arrays and sorting)
  • Built-in and custom awk functions
  • Internationalizing and localizing awk scripts
  • Advanced gawk (communicating with other processes and networking programming)
  • Running awk and gawk
  • Sample awk scripts
  • Internetworking with awk
  • History and evolution of awk
  • Downloading and installing gawk

Linux Books

Book Subjects
Most talked about in Linux Books
Linux TCP/IP Network Administration ImageLinux TCP/ IP Network Administration
by Scott Mann
Prentice Hall; Published: 2001-07-26; Paperback; Book
Best price: $8.89
Price in other shops: $54.99
Linux and Windows: A Guide to Interoperability ImageLinux and Windows: A Guide to Interoperability
by Ed Bradford, Lou Mauget
Pearson Education; Published: 2001-12-14; Paperback; Book
Best price: $10.25
Price in other shops: $44.99
Integrating Linux and Windows ImageIntegrating Linux and Windows
by Mike McCune
Prentice Hall PTR; Published: 2000-12-19; Paperback; Book
Best price: $26.56
Price in other shops: $39.99
Real World Linux Security: Intrusion Prevention, Detection and Recovery (Open Source Technology) ImageReal World Linux Security: Intrusion Prevention, Detection and Recovery (Open Source Technology)
by Bob Toxen
Prentice Hall PTR; Published: 2000-11-30; Paperback; Book
Best price: $3.99
Price in other shops: $44.99
The UNIX and Windows 2000 Handbook: Planning, Integration and Administration ImageThe UNIX and Windows 2000 Handbook: Planning, Integration and Administration
by Lonnie Harvel, David Webb, Steven Flynn, Todd Whitehurst
Prentice Hall; Published: 2000-05-14; Paperback; Book
Best price: $4.45
Price in other shops: $64.00
Linux Desk Reference (Open Source Technology Series) ImageLinux Desk Reference (Open Source Technology Series)
by Scott Hawkins
Prentice Hall; Published: 1999-11-30; Paperback; Book
Best price: $2.44
Price in other shops: $29.99
Linux User's Guide : Using the Command Line and Gnome With Red Hat Linux 9.0 - Textbook Only ImageLinux User's Guide : Using the Command Line and Gnome With Red Hat Linux 9.0 - Textbook Only
by Carolyn Gillay
Franklin Beedle & Associates; Published: 2004; Paperback; Book
Best price: $999.00
Linux: The Textbook ImageLinux: The Textbook
by Syed Mansoor Sarwar, Robert Koretsky, Syed Aqeel Sarwar
Addison Wesley; Published: 2001-07-12; Paperback; Book
Best price: $100.44
Price in other shops: $117.00
UNIX to Linux® Porting: A Comprehensive Reference ImageUNIX to Linux® Porting: A Comprehensive Reference
by Alfredo Mendoza, Chakarat Skawratananond, Artis Walker
Prentice Hall; Published: 2006-04-22; Paperback; Book
Best price: $41.20
Price in other shops: $69.99
RHCE Red Hat Certified Engineer Linux (Exam RH302) ImageRHCE Red Hat Certified Engineer Linux (Exam RH302)
by Michael Jang
McGraw-Hill Osborne Media; Published: 2004-03-30; Paperback; Book
Best price: $23.29
Price in other shops: $59.99
Similar Books and other products
Expert Shell Scripting (Expert's Voice in Open Source) ImageExpert Shell Scripting (Expert's Voice in Open Source)
by Ron Peters
Apress; Published: 2009-01-07; Paperback; Book
Best price: $23.36
Price in other shops: $39.99
Learning the vi and Vim Editors ImageLearning the vi and Vim Editors
by Arnold Robbins, Elbert Hannah, Linda Lamb
O'Reilly Media; Published: 2008-07-22; Paperback; Book
Best price: $19.79
Price in other shops: $34.99
Grep Pocket Reference (Pocket Reference (O'Reilly)) ImageGrep Pocket Reference (Pocket Reference (O'Reilly))
by John Bambenek, Agnieszka Klus
O'Reilly Media; Published: 2009-01-30; Paperback; Book
Best price: $7.29
Price in other shops: $12.99
Bash Cookbook: Solutions and Examples for Bash Users (Cookbooks (O'Reilly)) ImageBash Cookbook: Solutions and Examples for Bash Users (Cookbooks (O'Reilly))
by Carl Albing, JP Vossen, Cameron Newham
O'Reilly Media; Published: 2007-05-31; Paperback; Book
Best price: $28.26
Price in other shops: $49.99
Mastering Regular Expressions ImageMastering Regular Expressions
by Jeffrey E.F. Friedl
O'Reilly Media; Published: 2006-08-15; Paperback; Book
Best price: $24.88
Price in other shops: $44.99
Learning the bash Shell: Unix Shell Programming (In a Nutshell (O'Reilly)) ImageLearning the bash Shell: Unix Shell Programming (In a Nutshell (O'Reilly))
by Cameron Newham
O'Reilly Media; Published: 2005-04-05; Paperback; Book
Best price: $19.47
Price in other shops: $34.95
sed and awk Pocket Reference, 2nd Edition Imagesed and awk Pocket Reference, 2nd Edition
by Arnold Robbins
O'Reilly Media; Published: 2002-06; Paperback; Book
Best price: $5.32
Price in other shops: $9.95
Classic Shell Scripting ImageClassic Shell Scripting
by Arnold Robbins, Nelson H.F. Beebe
O'Reilly Media; Published: 2005-02-01; Paperback; Book
Best price: $20.55
Price in other shops: $39.99
The AWK Programming Language ImageThe AWK Programming Language
by Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
Addison Wesley; Published: 1988-01-11; Paperback; Book
Best price: $50.00
Price in other shops: $110.00
sed & awk (2nd Edition) Imagesed & awk (2nd Edition)
by Dale Dougherty, Arnold Robbins
O'Reilly Media; Published: 1997-03-08; Paperback; Book
Best price: $17.55
Price in other shops: $39.99
Book store. Illustrated catalog of books on different categories