What do you think?
Rate this book
The journey begins with an overview of the basic operations of sed and awk, showing a progression in functionality from grep to sed to awk. The next stop is writing sed scripts. You'll learn the syntax of sed commands, and advanced features, including multiple pattern space and hold space commands.
The book then moves to writing scripts for awk. Discussions include pattern matching, expressions, relational and Boolean operators, and informal retrieval. The text also explains awk's built-in functions and user-defined functions. The authors keep you learn by outlining the development of an index processing application, and they offer the readers contact information on how to obtain various versions of awk. This tutorial includes a miscellany of sed and awk scripting styles and techniques.
Paperback
First published November 8, 1990
grep '["[{(]*book[]})\"?:'s]* ' bookwords
I have found a couple of circumstances where larger scripts failed, reporting syntax errors that I could not track down. Removing all the comments made the program run fine. I concur [sic] from this that the size of the program was the problem, which seemed to be a machine-specific limitation of awk. The program, comments included, ran fine on two other systems.
Altering the flow of control makes a script much more difficult to read and understand. In fact, the scripts may be easier to write than they are to read. When you are writing a difficult script, you have the benefit of testing it to see how and why commands work.
Placing multiple commands on the same line is highly discouraged because sed scripts are difficult enough to read even when each command is written on its own line.
In some ways, writing a script is like devising a hypothesis, given a certain set of facts. You try to prove the validity of the hypothesis by increasing the amount of data that you test it against.