8 GAWK: Effective AWK Programming
GNU/Linux distributions are often available in computer stores or bundled on CD-ROMs
with books about Linux. (There are three other freely available, Unix-like operating systems
for 80386 and other systems: NetBSD, FreeBSD, and OpenBSD. All are based on the 4.4-
Lite Berkeley Software Distribution, and they use recent versions of gawk for their versions
of awk.)
The book you are reading is actually free—at least, the information in it is free to
anyone. The machine-readable source code for the book comes with gawk; anyone may take
this book to a copying machine and make as many copies as they like. (Take a moment to
check the Free Documentation License in [GNU Free Documentation License], page 328.)
Although you could just print it out yourself, bound books are much easier to read and
use. Furthermore, the proceeds from sales of this book go back to the FSF to help fund
development of more free software.
The book itself has gone through a number of previous editions. Paul Rubin wrote the
very first draft of The GAWK Manual; it was around 40 pages in size. Diane Close and
Richard Stallman improved it, yielding a version that was around 90 pages long and barely
described the original, “old” version of awk.
I started working with that version in the fall of 1988. As work on it progressed, the FSF
published several preliminary versions (numbered 0.x). In 1996, Edition 1.0 was released
with gawk 3.0.0. The FSF published the first two editions under the title The GNU Awk
User’s Guide.
This edition maintains the basic structure of Edition 1.0, but with significant additional
material, reflecting the host of new features in gawk version 3.1. Of particular note is
Section 7.11 [Sorting Array Values and Indices with gawk], page 127, as well as Section 8.1.6
[Bit-Manipulation Functions of gawk], page 150, Chapter 9 [Internationalization with gawk],
page 160, and also Chapter 10 [Advanced Features of gawk], page 169, and Section C.3
[Adding New Built-in Functions to gawk], page 288.
GAWK: Effective AWK Programming will undoubtedly continue to evolve. An electronic
version comes with the gawk distribution from the FSF. If you find an error in this book,
please report it! See Section B.5 [Reporting Problems and Bugs], page 281, for information
on submitting problem reports electronically, or write to me in care of the publisher.
How to Contribute
As the maintainer of GNU awk, I once thought that I would be able to manage a collection of
publicly available awk programs and I even solicited contributions. Making things available
on the Internet helps keep the gawk distribution down to manageable size.
The initial collection of material, such as it is, is still available at
ftp://ftp.freefriends.org/arnold/Awkstuff. In the hopes of doing some-
thing more broad, I acquired the awk.info domain.
However, I found that I could not dedicate enough time to managing contributed code:
the archive did not grow and the domain went unused for several years.
Fortunately, late in 2008, a volunteer took on the task of setting up an awk-related web
site http://awk.info and did a very nice job.
If you have written an interesting awk program, or have written a gawk extension that you
would like to share with the rest of the world, please see http://awk.info/?contribute
for how to contribute it to the web site.