Publisher: O'Reilly, 1990, 394 pages
ISBN: 0-937175-59-5
Keywords: Programming
sed & awk are tools used by users, programmers and administrators, sed, so called because it is a stream editor, perfect for applying a series of edits to a number of files, awk, named after its developers, Aho, Weinberger and Kernighan, is a programming language that permits easy manipulation of structured data and the generation of formatted reports. This book covers the original awk and the new awk (nawk) as well as the GNU project's gawk.
The book begins with an overview and a tutorial that demonstrate a progression in functionality from grep to sed to awk. All three programs share a similar command-line syntax, accepting user instructions in the form of a script. Because all three programs use UNIX regular expressions, an entire chapter is devoted to understanding UNIX regular expression syntax.
The first chapter on sed describes how to write a sed script using only a few sed commands. The chapters that follows divide the sed command set into basic and advanced commands. The basic commands are ones that parallel manual editing actions while the advanced commands introduce simple programming constructs. Among the advanced commands are those that manipulate the hold space, a set-aside temporary buffer.
The first of five chapters on awk introduces the primary features of the language and how to write simple scripts. The next chapter looks at common programming constructs. The third chapter explains how to use awk's built-in functions as well as how to write user-defined functions that are available with nawk. The next chapter also covers advanced topics and includes a discussion of awkcc, and awk -to-C translator. The last chapter covers the development of an application that takes awk to its limits, the processing of an index.
Finally, there is a miscellany of user-contributed sed and awk scripts that demonstrate a wide range of scripting styles and techniques.
A very good book about the subject.
Comments
There are currently no comments
New Comment