sed & awk, 2nd Edition
Publisher: O'Reilly Media
Final Release Date: March 1997
Pages: 434

sed & awk describes two text processing programs that are mainstays of the UNIX programmer's toolbox.sed is a "stream editor" for editing streams of text that might be too large to edit as a single file, or that might be generated on the fly as part of a larger data processing step. The most common operation done with sed is substitution, replacing one block of text with another.awk is a complete programming language. Unlike many conventional languages, awk is "data driven" -- you specify what kind of data you are interested in and the operations to be performed when that data is found. awk does many things for you, including automatically opening and closing data files, reading records, breaking the records up into fields, and counting the records. While awk provides the features of most conventional programming languages, it also includes some unconventional features, such as extended regular expression matching and associative arrays. sed & awk describes both programs in detail and includes a chapter of example sed and awk scripts.This edition covers features of sed and awk that are mandated by the POSIX standard. This most notably affects awk, where POSIX standardized a new variable, CONVFMT, and new functions, toupper() and tolower(). The CONVFMT variable specifies the conversion format to use when converting numbers to strings (awk used to use OFMT for this purpose). The toupper() and tolower() functions each take a (presumably mixed case) string argument and return a new version of the string with all letters translated to the corresponding case.In addition, this edition covers GNU sed, newly available since the first edition. It also updates the first edition coverage of Bell Labs nawk and GNU awk (gawk), covers mawk, an additional freely available implementation of awk, and briefly discusses three commercial versions of awk, MKS awk, Thompson Automation awk (tawk), and Videosoft (VSAwk).

Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
O'Reilly Mediased & awk, 2nd Edition
 
4.4

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (5)

  • 4 Stars

     

    (2)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

67%

of respondents would recommend this to a friend.

Reviewed by 8 customers

Sort by

Displaying reviews 1-8

Back to top

(0 of 3 customers found this review helpful)

 
4.0

Waiting for a 3rd Edition!

By Jules Lefalot

from France

Comments about O'Reilly Media sed & awk, 2nd Edition:

The OLD second edition should be free!

(3 of 4 customers found this review helpful)

 
5.0

Who knew sed & awk were so powerful?

By Jim Schubert

from Richmond, VA

About Me Software Engineer

Verified Reviewer

Pros

  • Accurate
  • Concise
  • Easy to understand
  • Helpful examples
  • Well-written

Cons

    Best Uses

    • Expert
    • Intermediate
    • Novice
    • Student

    Comments about O'Reilly Media sed & awk, 2nd Edition:

    While I had used sed before, I never considered myself very proficient in it-- I had only used it to replace strings from a piped command. I had really only seen awk used to extract a word from some known string (e.g. pulling a version number as in: git --version | awk '{print $3}').

    I am so glad I bought this book to familiarize myself with these tools. There are many alternatives out there for parsing and generating reports, but sed & awk are pretty simple to learn. If you're familiar with Perl-syntax regular expressions, sed is a piece of cake. The programming style of awk is taken from C-style languages, so anyone can pick it up easily. In fact, I ended up only skimming the parts discussing most of the syntax.

    I am impressed by how quickly and easily sed and awk can be combined in a bash script to parse some input, transform it, and generate some meaningful output in a way that (in most languages) would otherwise be a non-trivial task. After reading this book, I now feel comfortable enough to use these programs to resolve text processing issues.

    (2 of 2 customers found this review helpful)

     
    5.0

    Awesome Book!

    By Roger

    from North Pole, AK

    Pros

    • Accurate
    • Concise
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice
      • Student

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      This is a well written book. It's obviously well proof read as well!

      Robbins, as usual, really shines on this one. I look for to reading his Awk programming book as well!

      (5 of 5 customers found this review helpful)

       
      5.0

      sed & awk, 2nd Edition Review

      By leon

      from Undisclosed

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      I loved this book. Very well and clear written. I downloaded examples from o'reilly site and was able to play with it through the reading. Not much theory plenty of examples, so you can see how everything works "in real life". I highly recommend this book, especially for beginners.

      (4 of 4 customers found this review helpful)

       
      5.0

      sed & awk, 2nd Edition Review

      By MML VERMA

      from Undisclosed

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      Excellent book for anyone interacting with UNIX or awk !

      (5 of 9 customers found this review helpful)

       
      4.0

      sed & awk, 2nd Edition Review

      By Stein B. Sylvarnes

      from Undisclosed

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      This is a difficult book to review and rate. I gave it a 4, but from another point of view, it deserves a 2. More on this later. If you look at the other reviews, they differ widely. But let's get on with the review shall we? I divide it into four sections. First an overview, then I consentrate on sed and awk. Finally I'll sum it all up.

      Overview

      This book start with introducing sed, gradually increasing difficulty. Then it go back to basics with awk. Awk is covered more in-depth than sed, becuse it is a bigger language. The appendices contain real-world examples of sed and awk programs, some of which I use today. It allso have a good refernce section, as it should.

      This book generally focus on writings and typesetting, but extraction of information and report generating is allso covered. Overall I find that it cover most of my uses with these tools.

      Sed

      The sed-part begin nicely with a general intro to sed and regexps, and explain the difference between sed and ed. As I said earlier, it gradually increases in difficulty and usability. In the end you are able to advnced multiline search-and-replace, format touchups and much more.

      Awk

      As I said, Awk is covered more in-depth than sed. But allso this part begin with the basics, assuming no prior knowledge to awk. It do, however asume some knowledge with regexps, as that was covered in the sed section. It show you interaction with shell-scripts, as well as all the usual features in text manipulation. It is interesting to note that the authors have chosen to use 'old' awk as much as possible to ensure their examples will work on as many platforms as possible. They do, however poiont out when another awk, like nawk or gawk, can do the job more efficiently. They have allso used an entire chapter discussing the differences between the different awks. The last chapter discuss a rather large real-world example used when typesetting this book very in-depth. And in the appendices there are many useful awk-scripts.

      Summary

      All in all a good book. I particularly liked the awk section. The sed section was a bit terse for me in the beginning. But what can you expect, a young cub like me don't know how it was done in the good ol'days. The focus in this book is on typesetting. Not nesecerily bad, but my use of sed and awk is mainly report extraction and, to a lesser degree presentation.

      As I said in the beginning, I might as well hve given this book a '2'. Here's why; This book focus on beginners to intermediate users. So their text and examples should reflect that. Their intermediate examples do, however, tend to be a bit too difficult if you skip on the first chapters, especially in the sed aprt. Again, not nesecerily bad, it might even be intentional from the authors; You can't move on until you have a firm grip on the basics. So if I was looking for a book to jump-start me into being an intermediate sed&awk programmer, I'd definately give this book a '2'.

      I do recommend this book to anyone interested in a basic and thurough introduction to sed&awk. Mastering this book will let you do most things these languages were written to do

      (4 of 4 customers found this review helpful)

       
      5.0

      sed & awk, 2nd Edition Review

      By Fabio Rotondo

      from Undisclosed

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      This book rocks. It has a deep coverage of the two tools in the title, but it is

      also a very valuable reference for regular expressions. I already knew and used both sed and awk before reading this book, but it pointed

      me out so many new solutions and ideas I couldn't imagine at all.

      The part I liked more was sed section. I always considered sed like a small yet handy tool, but after I have read sed & awk I was able to exploit all sed's power.

      I read this book almost one year ago, but I still use it, and everytime I open it, I learn something more.

      Great book.

      (5 of 8 customers found this review helpful)

       
      2.0

      sed & awk, 2nd Edition Review

      By Chris Bidmead

      from Undisclosed

      Comments about O'Reilly Media sed & awk, 2nd Edition:

      Not one of O'Reilly's better books, IMHO.

      I think the essential problem is bundling together awk and sed, two philosophically very different tools. The result seems to be a book that is bitty, has no clear narrative line, with arbitrarily chosen examples that seem to be hard to track down when you're trying to use the book for reference. What I mean by that, I think, is that although the detailed discussions are useful and instructive if the problem you're trying to solve is a close match to an example focussed in the book, it's not at all easy to derive general principles, or extrapolate from the rather narrow selection of cases under consideration.

      The problems inherent in writing a book about awk (and gawk, and nawk...) are a difficult enough hurdle by themselves. The addition of sed was a language too far. And heaven's knows, sed -- an indispensible tool, but a formidably difficult one for beginners and cognoscenti alike -- surely deserves a book on its own.

      The O'Reilly UNIX books set a very high standard. I'm sorry to say I don't think this one quite makes the grade.

      el bid

      Displaying reviews 1-8

      Back to top

       
      Buy 2 Get 1 Free Free Shipping Guarantee
      Buying Options
      Immediate Access - Go Digital what's this?
      Ebook: $31.99
      Formats:  APK, DAISY, ePub, Mobi, PDF
      Print & Ebook: $43.99
      Print: $39.99