PROGRAMMER TUTORIALS
solutions to programmer problems

ASP
C#
C++
COBOL
Delphi
HTML
Java
J2EE
JavaScript
JSP
.NET
Perl
PHP
SQL
Visual Basic
XML
View Shopping Cart


Get a FREE Apple iPod Photo

  Books sed & awk (2nd Edition)

Rating: 3 out of 5 stars - The best (only?) book to learn these tools from A to Z
I had to do some text processing and I wanted to learn sed & awk so I picked this book that is, to my knowledge, the only book completely dedicated to these tools. The chapter on 'advanced' sed programming is very scary because when using 'advanced' sed features, the syntax is cryptic. It is nice to know that these features are there but I want to stay away from them and perhaps use awk or perl for the tasks that would require those 'advanced' features. Still, when you stick with the 'basic' and 'intermediate' sed features, you can do cool things easily in shell scripts.

Overall, the book was not thrilling to read but it does a good job to teach you these text processing tools.



Rating: 2 out of 5 stars - I must be the only one who hates this book!
I have looked in this book again and again in an attempt to find out "how do I do xxx with awk or sed?" I just need a quick and dirty script to do something. The way the book is written prevents getting such answers. It is TERRIBLE as a resource for solutions to real problems. Presumably you can "learn sed and awk" from it, but what I want are answers, and this book gets in the way of that. It has literally never helped me solve a problem -- I always end up finding what I want with google somehow. Example: my latest experience was trying to write a script to simply go through a long shell script, and for each line, if it started with "if", "case" or "done", I wanted to prepend "echo line#" (echo the line number) to the line, so it would echo the line number when the script ran. If it had a certain other string in it, I wanted to replace that string with another, and if none, then just preserve the line. Should be pretty simple as a programmer, but I could not get the answer out of this book. It does not mention the FNS variable which allows you to echo the line number, for one thing. Sigh, I could go on... I'm in the minority, but I've made my point. I'm still looking for a good sed/awk reference.



Rating: 3 out of 5 stars - Useful to learn it, not for experienced users, and not a reference book either.
I have a science background and am a regular user of unix systems, although I am not a professional IT'er. Therefore I was already familiar with sed and awk. I was looking for a single book that would give a good overview of all functions on a more-than-beginners-level and at the same time could serve as a reference. Perhaps not as 'the ultimate reference' but good enough for professionals who want to use sed and awk in a pragmatic way. With this I mean: a book you can turn to if you just want to write a little program/script that get's the job done.

This is not that book. I found this book useful in explaining the basics of sed and awk. There is also a quick reference section on both sed and awk. However, my overall observation is that the level of this book is not very advanced and therefore did not do the job for me. I would recommend this book to beginners and not to people who have already used sed and awk themselves. The level is basic, the reference sections are too brief and incomplete to be really 'reference sections'. I am still looking for a real reference book.

Tip: if you want to get started with sed and awk, search the internet for "sed one-liners" and "awk one-liners": these are one-line example 'programs' or commands that most likely will do what you are looking for. And if not, they are helpful to get you going and make some trivial changes so that the program does do what you need. No need for buying a book.



Rating: 5 out of 5 stars - Definitive
I've been into Unix since the 80s... Minix on an Atari ST for the nostalgic... including being system admin on various Unix platforms at work (Solaris, HP-UX, DRS-NX, SCO Unix, BSD, etc.) and this has always been the definite work on both SED and AWK and has helped me out with various admin tasks over the years...

Highly recommended and essential for sysadmins

GMD



Rating: 5 out of 5 stars - Great manual on a pair of essential tools
"sed" is one of the very early Unix commands that permitted command line processing of data files. It evolved as the natural successor to the popular "grep" command and is cousin to the later "awk", which is somewhat more flexible. sed and awk are often cited as the progenitors and inspiration for Perl. These two utilities have many things in common, including the use of regular expressions for pattern matching. Since pattern matching is such an important part of their use, the book explains UNIX regular expression syntax very thoroughly. Because there is a natural progression in learning from grep to sed to awk, all three programs are actually covered here, although the focus is on sed and awk.

The focus of this book is on writing scripts for sed and awk that quickly solve an assortment of problems for the user. The book also covers scripts for solving larger problems that require more careful design and development. This book is written in the "old style" of O'Reilly manuals, in that it is a thorough and very understandable tutorial, although it may not be written in the most exciting style in the world. It can also function as a reference manual that you come back to after you learn the mechanics of the language. The following is an overview of the book from the context of the table of contents:

Chapter 1 is an overview of the features and capabilities of sed and awk. Chapter 2 demonstrates their basic operations, showing a progression in functionality from sed to awk. Both share a similar command-line syntax, accepting user instructions in the form of a script. Chapter 3 describes UNIX regular expression syntax in full detail. Many new users are often intimidated by these strange looking expressions, used for pattern matching. The pattern-matching examples in this chapter largely rely on grep and egrep.

Chapter 4 begins three chapters on sed, and covers the basic elements of writing a sed script using only a few sed commands. It also presents a shell script that simplifies invoking sed scripts. Chapters 5 and 6 divide the sed command set into basic and advanced commands. The basic commands parallel manual editing actions, while the advanced commands introduce simple programming capabilities. Among the advanced commands are those that manipulate the hold space, a set-aside temporary buffer.

Chapter 7, begins a five-chapter section on awk, and presents awk's primary features. A number of scripts are explained, including one that modifies the output of the "ls" command. Chapter 8 describes how to use common programming constructs such as conditionals, loops, and arrays. Chapter 9 describes how to use awk's built-in functions as well as how to write user-defined functions. Chapter 10, "The Bottom Drawer", covers a set of miscellaneous awk topics that don't seem to fit anywhere else. It describes how to execute UNIX commands from an awk script and how to direct output to files and pipes. It then offers some brief advice on debugging awk scripts. Chapter 11 describes the original V7 version of awk, the current Bell Labs awk, GNU awk (gawk) from the Free Software Foundation, and mawk, by Michael Brennan. The latter three all have freely available source code. This chapter also describes two commercial implementations, MKS awk and Thomson Automation awk (tawk), as well as VSAwk, which brings awk-like capabilities to the Visual Basic environment.

Chapter 12 presents two long and rather complex awk scripts that together demonstrate nearly all the features of the language. The first script is an interactive spelling checker. The second script processes and formats the index for a book or a master index for a set of books. Chapter 13 presents a number of user-contributed scripts that show different styles and techniques of writing scripts for sed and awk. Each program is introduced with a brief description by the program's author and some comments from the book's author. Then the full program listing is shown. If the author did not supply an example, the book has generated one and describes it after the listing. Finally the book talks briefly about the program, highlighting some interesting points. It's a helpful toolchest of methods.

There are three appendices. The first is a quick reference describing sed's commands and command-line options. The next is a quick reference to awk's command-line options and a full description of its scripting language. The last appendix presents the full listings for the spellcheck.awk script and the masterindex shell script described in Chapter 12.

If you are familiar with O'Reilly's book on Lex and Yacc, this book has a very similar style. It goes through various aspects of the two commands in minute detail with lots of well-commented examples. I highly recommend it if you think you're going to be working with either sed or awk in the future.


page 2 of  8
 1  2  3  4  5  6  7  8 


2000-2006 ProgrammerTutorials.com


Top100WebShops.com