
|
 |
|
sed & awk (2nd Edition)x$25.77
    (39 reviews)
Best Price: $29.95 $25.77
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. To master sed and awk you must thoroughly understand UNIX regular expressions, and understand the syntax of sed and awk commands. This handbook treats regular expressions as a foundation for learning about sed and awk and contains a comprehensive treatment of sed and awk syntax. It emphasizes the kinds of practical problems that sed and awk can help users to solve, with many useful example scripts and programs. Contents include: - A tutorial showing basic operations of sed and awk
- Regular expression syntax and examples
- Basic and advanced sed commands
- Features of awk (plus gawk and nawk)
- Common programming constructs
- Advanced topics
- User-contributed scripts
|
Customer Reviews
|
2 cute little guys who will work hard for you      By A3TLY1A7NGVCQM on 2004-07-01
I've had this book for 3-4 years now and find it to be my handiest reference. I even use ot more than my vi book.
The raw power of sed and awk will humble even the proudest VB programmer and this book will help you get the most out of both the "Aho, Weinberg and Kernigan" and the "stream editor".
The first chapter section is entitled "May You Solve Interesting Problems" a paraphrase of the old Chinese curse, but with sed and awk no problem seems insurmountable and will make all problems appear interesting.
This book is an outstanding reference and will get you up and running with both of these handy little programs in no time.
Just to give you an example - the first time I ever used these programs (sed and awk) I developed a cron script to query a database every day at midnight, sort the results, grabbed lines with tagged values within certain limits, added a few totals, did some averaging, "starred" the lines that departed from certain parameters, then formatted the results into a report with a header showing the dates, times and query results, statistics then packed them into a report file and e-mailed them to a dozen recipients and added a few recipients if the data was outside certain values.
I did this remarkable feat by copying a few examples from the book, changing a thing or two and in the end had a little shell script that was a few K-bytes at the most.
This VB guy from corporate worked on a VB version of the same function and ended up with six revisions, several megs in the executable and never was able to get it formatted right. Not to say that it couldn't be done but..... I wrote mine before lunch one day. He worked on his for weeks and weeks.
Such is the power contained within should you want to tap it Grasshopper.
Great book. Amaze your friends and colleagues. Have the office women ( or men) throw flowers at your feet as you enter every day - well maybe not, but this will make you more productive.
You real nerds will hardly get finished with a single box of Pop Tarts before you are writing really cool scripts when using this book.
Like all O'Reilly books this one is terse, practical and highly usable - just like UNIX.
You'll not regret this one!      By AG45XGJ3ULJBV on 2001-09-25
My primarily profession is database administration on Windows NT/2000 platform so I'm pretty new to Unix tools. Several months ago I needed some inexpensive, yet powerful tools to manipulate some large text files for our data warehouse project -- basically I was looking for a way to avoid expensive commercial ETL tools. PERL was my first choice, but it seemed to me that learning curve is too steep for what I needed, so I ended with GNU sed and awk. I was happy with the GNU version of Guide for Awk "Effective AWK Programming" written by one of the author of this book, Mr. Arnold D. Robbins -- but I needed some good reference for sed as well and this book was logical choice for me. Not only that it helped me to learn SED, now I'm using the book mostly as reference and user guide for awk. It's well written and will certainly satisfy both the advanced and the novice users. The only objections that I have are examples at the end of the book. Not many readers will find them interesting and useful, especially chapter 12 Full-Featured Applications. Overall good choice if you want to learn either of the two tools!
Powerful tools for text manipulation      By A1OTXAIOE5ETEW on 2000-04-15
Unix has earned itself quite a reputation for its potent tools, used for batch editing of text files (like program output). Sed and Awk are two of these tools. Sed is a direct descendent of Ed, the original Unix line editor, which employs regular expressions, a powerful method for description of patterns in text, for operations like substitute, append or delete. Awk is a complete scripting language with programming structures like conditionals, loops, functions etc., developed in 1970's by Alfred Aho, Brian Kernighan and Peter Weinberger (hence A-W-K). The trio has also written a book on Awk.Dale Dougherty (in the 2nd edition with Arnold Robbins, maintainer of GNU Awk and author of several more books on Awk programming language) have made a good job in making a thoroughly readable tutorial on Sed and Awk. However, it remains a mystery to me how they succeeded to fill no less than 407 pages with it. Mind you, Sed and Awk are not really some big monsters. There exist something like two dozens of operators in Sed (most of them you will probably never use), and the syntax of Awk mimics those of C programming language, so it is likely that you know it already. Once you grok the idea of regular expressions, you should become a proficient user of Awk in about 30 minutes. In conclusion, go buy the book if your need to manipulate text files on Unix and you think you need a lengthy tutorial with a gentle learning curve. Otherwise, short references on Awk and Sed, like the ones in "Unix Power Tools" and a bunch of examples showing some tricks you might not think of, will probably be more useful. In addition, it is good to know that during the nineties, much of the focus has drifted from Awk to Perl, so you might consider a book on Perl as well.
Great introduction, mediocre reference      By A3DFYO2BQKH67T on 2000-05-13
I was very interested in learning sed and awk, and so picked up this book. Like most O'Reilly titles, it is an excellent piece of work. I learned a great deal and was able to get started and pump out some useful code after spending some time with this book. However, I soon found that when it came to tackling some very difficult tasks with sed and awk, this book didn't seem to serve me very well as a reference. I have a feeling that sed and awk are not the sort of thing that one could learn with just one book; there are so many applications for these tools that one must choose what one wishes to do, and find the right books to supplement this excellent text.
Not good      By ANU0JFC3NUD26 on 2002-05-29
Unlike the other Oriely books, this one is a disappointment. There is just lot of text and not much examples. Also things are introduced out of sequence thus making it difficult to get things properly. The examples do not go from simple to difficult. Also there is much talk about troff nroff etc. and then people not familiar with these things get unnecessarily distracted. There are 6 chapters on sed but the amount of information is litte.
- Good intro to Sed and Awk, plus more
     By A987W7WUQE2RP on 2000-12-09
This book had far more information on Sed and Awk than I really wanted to read, but objectively speaking, this book did a fabulous job explaining how to use both. The idea of linking them together in one book seems odd, but the author did a pretty nice job utilizing both. I particularly liked the section on debugging awk because the techniques he explained are very applicable to program debugging in general. I also found the section on regular expressions very clearly written and easy to understand (the best I have seen thus far). I wish I had read this book sooner. Also, to the credit of this book, I saved quite a lot of time recently updating about 90 flat files in seconds using sed. Awk has proven quite useful recently in another project too. Thank you Dale and Arnold!
- Good first book on Awk & Sed
     By A2CBIB1NYHOH87 on 2004-03-20
This is a great first book on awk and sed. It also has one of the clearest explanations of regular expressions I could find. I use it all the time in my database programming/data processing work. It has served me well. There are probably more advanced features of awk that are not covered in this book but for the price it is a great bargain. If you want to learn awk buy this book and you won't be disappointed. You can ignore the sections on sed if you like.
- Great manual on a pair of essential tools
     By A2E3F04ZK7FG66 on 2007-01-15
"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.
- Good tutorial, problematic reference
     By ADO5UU6E3NJJZ on 1999-05-26
I suppose if the proof of the teaching is in the learning, the authors' idea (in this edition) of interlacing their discussions of Sed and Awk throughout the volume is vindicated, because I am learning easily from the book. Yet this organization detracts seriously from its reference value, especially when one uses the index. You can look up a feature which you need to review, turn to one of the listed pages, begin reading, and then realize that you have no idea which program is being described. While the approach is an interesting experiment, I question whether its benefits are worth such drawbacks. If the authors decide to continue the approach in later edition, a simple device such as different type faces of page references in the index (e.g. Roman for Awk, the more elaborate package, and Italic for Sed) would help relieve this problem.
- sed, awk ... useful tools
     By A1DIZO95XRBLPO on 2003-12-23
sed and awk typically get a bum rap from perl users. "why learn sed or awk when perl can do both?" yes, it can. and so much more.but what if you just need to print, say, the first field of a file? or just replace a few characters in a stream? what about the situations when you dont have perl handy (ie a freshly installed IRIX box)? the sed & awk book is *the* standard. it's not written by anyone famous or whatnot, but it does a fantastic job of covering the basics, the meat, and advanced uses of sed and awk (and variants). if you spend time on the command line and need to know a few quick tips, this is the book to have for sed and awk. you'll learn regexp material, how to use sed and awk and a bunch of useful routines. highly reccomended for UNIX shell geeks.
- Excellent!
     By A1RZQNOOP3PGXV on 2004-08-04
Sed and awk are, as the book adequately puts it, UNIX "powertools". Sed is quite handy and awk is even better. This book presents a breathtaking introduction to both of them, and yet still delves into the more advanced details as it constantly presents exciting and useful examples. Both sed and awk are an essential part of any UNIX operating system, and both echo with the prestige of the master programmers that designed them. Well done, Mr. Dougherty!
- Useful to learn it, not for experienced users, and not a reference book either.
     By AGMKFWUQEEZUQ on 2007-07-01
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.
- A Must !
     By AMLIQQ2VTMEOX on 2000-01-13
This book from the GREAT O'reilly Collection is a must for anyone who wants to master 'sed' and 'awk', a POWERFUL set of Unix tools, which are too often ignored or under-utilized. Written in plain english, this book will satisfy the advanced and the novice users. Greatly recommended !
- Another brilliant book from the O'Reilly crew.
     By A35UIYSKD6PVEG on 2001-03-30
This is a typically great book from O'Reilly Press. I find this book to be invaluable when I need to look up how to do something with sed or awk. 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.
- I must be the only one who hates this book!
     By AIVQ2HSHLFUST on 2007-07-05
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.
- Easy. Organized. To the point.
     By on 1999-10-19
I grabbed this old edition from my co-worker and found it very well written. I am sure the new (2nd) edition is even better and up to date.
- the best desktop reference
     By A8DWKC3ASB91K on 2004-11-22
Some good reviews on here -- my only additon is that this book has been the best desktop reference for me. I am constantly referring back to it to answer questions. A MUST HAVE for any novice/intermediate user.
- Are you serious?
     By A3D7I4UXMG1DQ3 on 2007-08-23
In a nutshell, if you don't have this book, you are probably not a serious programmer or system administrator.
Both sed and awk have been around for ages, and they are part of the fundamental toolkit of any Unix/Linux professional. Furthermore, there are versions available both for native Windows and for Linux-like environments under Windows (cygwin, MKS, mingw.)
If you are a Perl hacker, you probably use Perl for a lot of the tasks that would otherwise be performed with one of these tools. Nevertheless, they are worth your time.
- A must have for the wannabe UNIX wizard
     By on 1999-04-24
This is a good book. Although I find some of the information that I need. There seems to be a fair amount that's concealed by the books approach to each topic.
- if you are a sys admin you need this book
     By A13QNBQB54O6HP on 2002-11-26
This is the definitive book on both sed and awk. my only gripe is that it is a bit tedieous at times but that is because hte author doesn't assume any pre knowledge of the subject. A great book for new admins or seasoned hackers.
- This is the ONLY way to learn Sed and Awk
     By A2RNMSNX5Y5J3T on 2006-08-02
If you want to move from a beginning unix user to a unix power user/shell scripter, you MUST learn sed. I can't count how many install scripts/build scripts/startup scripts/etc. rely on this simple tool. Although sed and awk do seem to naturally complement each other, I tend to view awk as sort of a stripped-down perl (in all fairness, it did come before perl, so perl is a "souped-up awk"). That's not to say that awk isn't useful; I constantly find myself using dirt-simple awk scripts to answer questions like, "which hosts are connected on port 80 and how many connections are they holding open right now?" (answer: netstat -nt | awk '{split($4,dst,":");split($5,src,":");if(dst[2] == "80") print src[1]}' | sort | uniq -c). Awk is always there, it's tiny and it's fast.
This book is really the only decent reference in existence on either of these two tools. The manual pages are useful as references, but you'll never learn how to use the tools without a good introductory guide, and this book is it.
- The best (only?) book to learn these tools from A to Z
     By A18NG1YL889EX2 on 2007-08-01
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.
- This book saved me from carpal tunnel
     By on 1997-11-27
No lie.
- A strong reference for sed and awk users
     By AD8FYA9HDKCR9 on 2000-12-20
It is a quality and authoritiative book. I first learned awk and sed with Ellen Quigleys 'Unix Shells' and found this book to assist with the more complex issues not covered in her book. (Like working with unstructured, dirty data, and defining a template to pull relevant data from the flat file. I didn't use this as a 'start at the beginning and read all the way through it,' like the 'Mastering Regular Expressions' book. This is more of a reference book.
- Pretty good
     By A1BDJK501QH72G on 2006-12-06
I agree with the sentiments expressed by others: this is a good book to learn from, but it's horrible for flipping through in search of a quick answer. It would have been nice if they would have put the content from the smaller pocket reference in the back as an appendix, but then I guess they wouldn't get to sell you two books.
- Definitive
     By A2816SOJEPHCV9 on 2007-03-30
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
- Come for the sed, stay for the awk!
     By A12OC8CWWGZ8P1 on 2008-02-16
This book is a timeless classic, the information on sed is invaluable to anyone who regularly works with text files or streams (after all sed is short for stream editor). Not only is it very informative it's also a fun and easy read... You'll be seeing uses for sed almost every day once you learn how powerful it can be!
The last 1/2 or so is on awk and although it's also very well written and informative it's not quite as useful if you're already experienced with a high level language with excellent text processing facilities like Python or Perl. However, it's work reading even if you keep thinking "I could do this in _____" because sometimes awk really is the right answer.
- Amaze & Astound your work mates :)
     By on 1999-02-26
simple yet powerful commands, you'll wonder how you ever did without it
- Very straigtforward instructions with good examples
     By on 1999-06-16
I found this book useful and entertaining
- A necessity for every Unix System Administrator
     By on 1998-11-10
This is a well written technical book. It will lead you from the very basic to the most advance concept of sed & awk. It will first build a good foundation by explaining the basics of reg. exps. then gradually teach you how to apply it using the editors.
|
|
You may also be interested in...
|
|
|
|
|
|