- Paperback: 434 pages
- Publisher: O'Reilly Media; 2 edition (1997)
- Language: English
- ISBN-10: 1565922255
- ISBN-13: 978-1565922259
- Product Dimensions: 7 x 1 x 9.2 inches
- Shipping Weight: 1.8 pounds (View shipping rates and policies)
- Average Customer Review: 70 customer reviews
- Amazon Best Sellers Rank: #226,232 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
sed & awk 2nd Edition
Use the Amazon App to scan ISBNs and compare prices.
Frequently bought together
Customers who bought this item also bought
From the Publisher
sed & awk, one of the most popular books in O'Reilly & Associates' Nutshell series, 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 new edition covers features of sed and awk that are now 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).
From the Back Cover
Top customer reviews
Dated material aside, I found the book difficult to use, even though I've been learning programming languages since 1982 -- including that early, primitive BASIC, 8086 assembly, Pascal, C, C++, Perl, HTML, Java, VB, and others. The flow of its materials presentation doesn't seem to build naturally from ground zero. Perhaps if I'd learned programming on a UNIX machine, the references in this book would be clearer.
So, heads up if you're looking to learn sed and awk. This book can probably be of some help (especially if you're a UNIX geek), but you may well need to augment it with a lot of on-line or other research.
It takes you through the basics of sed and awk, shows you regular expression syntax and delves deeper into both programs. For sed it shows you all of the basic sed commands as well as many of the more advanced commands such as multiline pattern spaces. With awk it goes even deeper as awk is a more powerful program. It shows the basics for writing awk scripts then takes you into flow control, functions and debugging.
I find the writing to be concise and clear with many examples to show you how it works in the real world.
All in all it's a great book for the unix admin or programmer to have on their bookshelf.
You can either spend the rest of eternity with a text editor or get these guys, and learn a bit to instruct them to do totally boring but useful drudgery. And perhaps learn about regular expressions and pattern matching. And then do something interesting.
Don't worry, you will have do do it again, if for no other reason than the entity that controls the format of the data decided to change it, for no other reason than to annoy and confound you. But, since you have learned about pattern matching, a minor change will fix it, and you can go back to whatever.
The specific purpose this time was to avoid subscribing to a listing service for cable tv programming. Zap2it publishes the listings on most newspaper websites, and program called wget allows me to write these listings to a file. Then using sed to slice and dice allows me to read simply formatted listings, and eventually feed them to a recording system.
A more modern version would probably include a CD with bunch of lessons ideas to get one started.