12/19/2009

Review of Effective awk Programming (3rd Edition) (Paperback)

Awk is one of those handy Unix tools with which you can easily impress people. Using a simple

/pattern/ { action }

syntax, you can construct powerful one-liners. Do you want to how much time in total you spent surfing the Internet? Here it is:

awk '/Connect time/ { s += $8 } END { print s }' /var/log/messages

It doesn't get much shorter in any other programming language, does it? Need to strip text of HTML tags? Need a frequency count of words in a text? Awk is the perfect tool for tasks like this. With its pattern-action structure, powerful regular expression mechanism, associative arrays and basic program flow control, it provides a powerful tool for manipulating flat text files. Even though other scripting languages may be richer in features, there exists a niche where Awk is just the right tool to do the job.

Arnold Robbins, the author of this book as well as of several other books on Awk, serves also as the maintainer of GNU Awk (gawk for short), the most influential version of Awk available today. With the version 3.10, released in 2001, GNU Awk became richer for a handful of new extensions over traditional Awk, most important among them are the TCP/IP networking and the support for internationalization. All new extensions are described in the book. How successful these new extensions will be is doubtful, however. Networking scripting niche is already well covered with Perl and Python, and internationalization doesn't really matter much in short throw-away scripts Awk is usually used for.

With all due respect to the creators of Awk and their book (Alfred V. Aho, Peter J. Weinberger, Brian W. Kernighan, The Awk Programming Language, Addison-Wesley, 1988), I have to say that "Effective Awk Programming" is probably the best Awk tutorial on the market today. If you are serious about learning Awk, you shouldn't be without it. If you are still hesitating whether it wouldn't be wiser investing those 28 USD elsewhere, here is chance to read it before you buy it: install GNU Awk 3.10, and the Texinfo source of the book comes with it. But sooner or later you will find O'Reilly RepKover binding too tempting...



Click Here to see more reviews about: Effective awk Programming (3rd Edition) (Paperback)

No comments:

Post a Comment