Book Review - sed & awk

Networking/Security Forums -> News // Columns // Articles

Author: alt.don PostPosted: Thu Nov 20, 2003 5:58 pm    Post subject: Book Review - sed & awk
    ----
sed & awk
Author(s): Dale Dougherty & Arnold Robbins
Publisher: O’Reilly
Book Specifications: Soft-Cover, 407 pages
Category: UNIX, Linux Utilities
User Level: Beginner
Suggested Publisher Price: $34.95 USA/ $51.95 CAN/ £28.74 Net UK (inc of VAT)
ISBN: 1-56592-225-5
Amazon.co.uk: sed & awk
Amazon.com: sed & awk



Info from Back: "sed and awk are tools used by users, programmers, and administrators. sed, so called because it is a stream editor, is perfect for applying a series of edits to a numbers of files. awk, named after its developers, Aho, Weinberger, and Kernighan, is a programming language that lets you manipulate structured data easily and generate formatted reports. This second edition covers awk as described by the POSIX standard, as well as a number of both freely available and commercial versions of awk.”


Introduction

Anyone who has to deal with large volumes of text on a daily basis will greatly benefit by taking the time to use these two tools. Everyone from the system administrator to power users, and the average home user can benefit from learning how to use sed and awk. The ability of these two programs to allow one to manipulate large volumes of text is pretty much unrivalled. Some programs such as Microsoft Word will allow you to do substitutions although it will have difficulty with large files. This is not the case with sed as it runs at the command prompt be it DOS or a shell prompt in UNIX, or Linux. Being able to pull out certain portions of files using awk to populate databases is also a very useful option to have. The awk program can do that and much more complex tasks as well. Due to the popularity of these two programs they have now been ported to DOS so that users of the Windows operating system can also reap their benefits.

Content & Overview

This book begins with the usual well written “Table of Contents” that one has come to expect from O’Reilly books. Within this table each chapter is broken down into several different topics should you wish to quickly go to a specific one. Following this is the preface where the authors go over sed and awk quickly in a brief overview. Also in this portion is a quick description of each chapter, followed by some url’s where one can download both sed and awk. There are also links to where one can download example code for both sed and awk, and the conventions used in this book are shown as well.

The book itself is laid out over 13 chapters, three references, and the appendix at the end of the book. Usage of both sed and awk starts at the beginning and interestingly enough the use of grep is also shown. This is a very good for it shows how you can tie in this other well known command into sed and awk. Contents of the books are as follows;

Chapter 1. Power Tools for Editing
Chapter 2. Understanding Basic Operations
Chapter 3. Understanding Regular Expression Syntax
Chapter 4. Writing sed Scripts
Chapter 5. Basic sed Commands
Chapter 6. Advanced sed Commands
Chapter 7. Writing Sripts for awk
Chapter 8. Conditionals, Loops, and Arrays
Chapter 9. Functions
Chapter 10. The Bottom Drawer
Chapter 11. A Flock of awks
Chapter 12. Full-Featured Applications
Chapter 13. A Miscellany of Scripts

Also included is three appendixes which supply a quick reference for both sed and awk command syntax, as well as supplementary material for Chapter 12.

Style and Detail

As would befit a book on tools which are used at the command line interface level is a plethora of examples showing command syntax examples. Points are made about the usage of these tools, and then followed up by clear and concise snippets of its syntax. What is quite striking about this book is the inclusion of ancillary material to help explain the potential and various uses of sed and awk. The authors cover the tool grep, and also go over in good detail regular expressions. Covering regular expressions is especially noteworthy for it can be very difficult to understand just how to build them. Shown and explained over an entire chapter (chapter 3) is the sometime confusing syntax used for building regular expressions. To truly get a full understanding on how to build regular expressions I would suggest another excellent book from O'reilly which can be found here.

There are no real diagrams in the book to help explain the subject matter which is fine, as it is not required. The authors have spent far more time documenting quality examples of syntax usage for the two programs that they are covering in this book. One thing you will not find wanting in this book is a shortage of syntax examples or other programs used often with both sed and awk such as grep and the building of regular expressions. The inclusion of the last two are a nice touch as you will definitely be using the two of them to manipulate and filter your text documents.

Conclusion

I have used both sed and awk in the past to help me sort huge volumes of network data from our alarm sensors. The job would have been much more difficult without the use of both sed and awk. Anyone who is required to deal with large amounts of data on a daily basis would be wise to buy this book. It would take little time to come up with some working examples due to the well structured explanation/example format of the book. I highly recommend the book for every type of user who wishes to simplify what can be at times a lengthy and irritating task through the use of these two tools.

This book gets an SFDC 8/10 from me



Keywords for this post: sed & awk

This review is copyright 2003 by the author and Security-Forums Dot Com, and may not be reproduced in any form in any media without the express permission of the author, or Security-Forums Dot Com.


Last edited by alt.don on Sat Nov 22, 2003 1:02 am; edited 1 time in total



Networking/Security Forums -> News // Columns // Articles


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group