As a technical book, the objective of the authors is to motivate and teach the reader how to use SED and AWK. These two tools are bundled in a book because they are similar: both derive from another tool called ED, both are especially suited for text processing problems, both have similar syntax, both operate on streams of text, and both work one line at a time. The power of both tools is interesting because by working one line at a time, they don’t have memory problems when operating on big files.
There are other books concerning SED and AWK in the market. Perhaps what sets this book apart is the experience of the authors (p. 123). Dale Dougherty was one of the founders of O’Reilly and Associates, is director of O’Reilly research, has written several books, and works at the University of California at Berkeley. Arnold Robbins is the maintainer of GAWK and has worked on Unix since 1980. Both authors have indeed plenty of experience on this topic. It’s great to learn from people with plenty of experience.
This book is very specific in its scope: it is a walk-around of two specific tools SED and AWK. Both of these tools are frequently used by System Administrators and Unix/Linux developers for different purposes. Being both stream-oriented allows the user to use them as part of more complex scripts by piping their input and output with other command-line tools. Hence, it is common to see them as part of System Administrator’s and developer’s scripts.
The pertinent question to ask is if it’s necessary to buy this book to learn SED and AWK or if simply following a tutorial on the internet is enough to learn both tools. In my case, I knew both SED and AWK before reading the book. I had followed tutorials for both and wrote scripts using them. Then it is not necessary to buy the book to learn the basics of both tools.
However, the key insight concerning SED and AWK is they are not only tools but instead they are power tools. The greatest benefit of using SED and AWK is not gained by knowing the basics, but instead by mastering them. As an artisan needs to master its tools to gain the benefit they produce, so developers and administrators need to master their tools. Concerning this point, I like the following extract from the book:
“My wife won’t let me buy a power saw. She is afraid of an accident if I use one. So I rely on a hand saw for a variety of weekend projects like building shelves. However, if I made my living as a carpenter, I would have to use a power saw. The speed and efficiency provided by power tools would be essential to being productive. [D.D.]
For people who create and modify text files, sed and awk are power tools for editing. Most of the things that you can do with these programs can be done interactively with a text editor. However, using sed and awk can save many hours of repetitive work in achieving the same result.
Sed and awk are peculiar and it takes time to learn them, but the capabilities they provide can repay the learning many times over, especially if text editing is a normal part of your trade." (p. 12)
Finally, I would recommend the book for both System Administrators and Developers. Knowing SED and AWK makes the difference. Spending some time reading the book might save you days and hours in the future. Not only this but scripting in SED and AWK converts a dull task, into something interesting. Perhaps this is the best gain of mastering these tools.