Book description
Effective awk Programming,3rd Edition, focuses entirely onawk, exploring it in the greatest depth of the threeawk titles we carry. It's an excellent companion piece tothe more broadly focused second edition. This book providescomplete coverage of the gawk 3.1 language as well as themost up-to-date coverage of the POSIX standard for awkavailable anywhere. Author Arnold Robbins clearly distinguishesstandard awk features from GNU awk(gawk)-specific features, shines light into many of the"dark corners" of the language (areas to watch out for whenprogramming), and devotes two full chapters to example programs. Abrand new chapter is devoted to TCP/IP networking with gawk. Heincludes a summary of how the awk language evolved. The bookalso covers:
Internationalization of gawk
Interfacing to i18n at the awk level
Two-way pipes
TCP/IP networking via the two-way pipe interface
The new PROCINFO array, which provides information aboutrunning gawk
Profiling and pretty-printing awk programs
In addition to covering the awk language, this book servesas the official "User's Guide" for the GNU implementation ofawk (gawk), describing in an integrated fashion theextensions available to the System V Release 4 version ofawk that are also available in gawk. As the officialgawk User's Guide, this book will also be availableelectronically, and can be freely copied and distributed under theterms of the Free Software Foundation's Free Documentation License(FDL). A portion of the proceeds from sales of this book will go tothe Free Software Foundation to support further development of freeand open source software. The third edition of Effective awkProgramming is a GNU Manual and is published by O'Reilly &Associates under the Free Software Foundation'sFreeDocumentation License (FDL). A portion of the proceeds fromthe sale of this book is donated to the Free Software Foundation tofurther development of GNU software. This book is also available inelectronic form; you have the freedom to modify this GNU Manual,like GNU software. Copies published by the Free Software Foundationraise funds for GNU development.
Publisher resources
Table of contents
- A Note Regarding Supplemental Files
- Dedication
- Foreword
- Preface
-
I. The awk Language and gawk
- 1. Getting Started with awk
- 2. Regular Expressions
-
3. Reading Input Files
- 3.1. How Input Is Split into Records
- 3.2. Examining Fields
- 3.3. Non-constant Field Numbers
- 3.4. Changing the Contents of a Field
- 3.5. Specifying How Fields Are Separated
- 3.6. Reading Fixed-Width Data
- 3.7. Multiple-Line Records
-
3.8. Explicit Input with getline
- 3.8.1. Using getline with No Arguments
- 3.8.2. Using getline into a Variable
- 3.8.3. Using getline from a File
- 3.8.4. Using getline into a Variable from a File
- 3.8.5. Using getline from a Pipe
- 3.8.6. Using getline into a Variable from a Pipe
- 3.8.7. Using getline from a Coprocess
- 3.8.8. Using getline into a Variable from a Coprocess
- 3.8.9. Points to Remember About getline
- 3.8.10. Summary of getline Variants
- 4. Printing Output
-
5. Expressions
- 5.1. Constant Expressions
- 5.2. Using Regular Expression Constants
- 5.3. Variables
- 5.4. Conversion of Strings and Numbers
- 5.5. Arithmetic Operators
- 5.6. String Concatenation
- 5.7. Assignment Expressions
- 5.8. Increment and Decrement Operators
- 5.9. True and False in awk
- 5.10. Variable Typing and Comparison Expressions
- 5.11. Boolean Expressions
- 5.12. Conditional Expressions
- 5.13. Function Calls
- 5.14. Operator Precedence (How Operators Nest)
- 6. Patterns, Actions, and Variables
-
7. Arrays in awk
- 7.1. Introduction to Arrays
- 7.2. Referring to an Array Element
- 7.3. Assigning Array Elements
- 7.4. Basic Array Example
- 7.5. Scanning All Elements of an Array
- 7.6. The delete Statement
- 7.7. Using Numbers to Subscript Arrays
- 7.8. Using Uninitialized Variables as Subscripts
- 7.9. Multidimensional Arrays
- 7.10. Scanning Multidimensional Arrays
- 7.11. Sorting Array Values and Indices with gawk
-
8. Functions
- 8.1. Built-in Functions
- 8.2. User-Defined Functions
- 9. Internationalization with gawk
- 10. Advanced Features of gawk
- 11. Running awk and gawk
-
II. Using awk and gawk
- 12. A Library of awk Functions
-
13. Practical awk Programs
- 13.1. Running the Example Programs
- 13.2. Reinventing Wheels for Fun and Profit
-
13.3. A Grab Bag of awk Programs
- 13.3.1. Finding Duplicated Words in a Document
- 13.3.2. An Alarm Clock Program
- 13.3.3. Transliterating Characters
- 13.3.4. Printing Mailing Labels
- 13.3.5. Generating Word-Usage Counts
- 13.3.6. Removing Duplicates from Unsorted Text
- 13.3.7. Extracting Programs from Texinfo Source Files
- 13.3.8. A Simple Stream Editor
- 13.3.9. An Easy Way to Use Library Functions
-
14. Internetworking with gawk
-
14.1. Networking with gawk
- 14.1.1. gawk’s Networking Mechanisms
- 14.1.2. Establishing a TCP Connection
- 14.1.3. Troubleshooting Connection Problems
- 14.1.4. Interacting with a Network Service
- 14.1.5. Setting up a Service
- 14.1.6. Reading Email
- 14.1.7. Reading a Web Page
- 14.1.8. A Primitive Web Service
- 14.1.9. A Web Service with Interaction
- 14.1.10. A Simple Web Server
- 14.1.11. Network Programming Caveats
-
14.2. Some Applications and Techniques
- 14.2.1. PANIC: An Emergency Web Server
- 14.2.2. GETURL: Retrieving Web Pages
- 14.2.3. REMCONF: Remote Configuration of Embedded Systems
- 14.2.4. URLCHK: Look for Changed Web Pages
- 14.2.5. WEBGRAB: Extract Links from a Page
- 14.2.6. STATIST: Graphing a Statistical Distribution
- 14.2.7. MOBAGWHO: A Simple Mobile Agent
- 14.3. Related Links
-
14.1. Networking with gawk
-
III. Appendixes
- A. The Evolution of the awk Language
- B. Installing gawk
- C. Implementation Notes
- D. Basic Programming Concepts
- E. GNU General Public License
- F. GNU Free Documentation License
- Glossary
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Effective awk Programming, 3rd Edition
- Author(s):
- Release date: May 2001
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9780596000707
You might also like
book
Effective awk Programming, 4th Edition
This practical guide serves as both a reference and tutorial for POSIX-standard awk and for the …
book
Learning AWK Programming
Text processing and pattern matching simplified About This Book Master the fastest and most elegant big …
book
The AWK Programming Language, 2nd Edition
Awk was developed in 1977 at Bell Labs, and it’s still a remarkably useful tool for …
book
Linux Shell Scripting Cookbook - Third Edition
Do amazing things with the shell About This Book Become an expert in creating powerful shell …