- Shopping Bag ( 0 items )
Implementations of the awk language are available for many different computing environments. Effective AWK Programming, while describing the awk language in general, also describes a particular implementation of awk called gawk (which stands for "GNU Awk"). gawk runs on a broad range of Unix systems, ranging from 80386 PC-based computers, up through large scale systems, such as Crays. Gawk has also been ported to MS-DOS and OS/2 PC's, Atari and Amiga micro-computers, and VMS.
iUniverse.com computer books are composed of freely available online computer manuals, industry standard specifications, and electronically distributed computer programming guides. They include open documents collections of industry specifications and standards and a collection of the best open source documentation on the Web...the most complete open source library available anywhere.
Each book contains the complete, unabridged text of the original document. Our on-demand publishing process gives you the actual text of the online document in a convenient, inexpensive, easy-to-use format.
And remember...iUniverse.com donates a portion of the profits from open document and open source books to support the mission of the free software community.
| GNU General Public License | xix | |
| Preamble | xix | |
| Terms and Conditions for Copying, Distribution and Modification | xx | |
| End of Terms and Conditions | xxv | |
| How to Apply These Terms to Your New Programs | xxv | |
| History of awk and gawk | xxvii | |
| The GNU Project and This Book | xxviii | |
| Acknowledgements | xxix | |
| Using This Book | xxxiv | |
| Typographical Conventions | xxxv | |
| Data Files for the Examples | xxxvi | |
| Chapter 1 | Getting Started with awk | 1 |
| A Rose By Any Other Name | 1 | |
| How to Run awk Programs | 2 | |
| A Very Simple Example | 6 | |
| An Example with Two Rules | 7 | |
| A More Complex Example | 8 | |
| awk Statements Versus Lines | 10 | |
| Other Features of AWKp11 | ||
| When to Use AWK | 12 | |
| Chapter 2 | Useful One Line Programs | 14 |
| Chapter 3 | Regular Expressions | 16 |
| How to Use Regular Expressions | 16 | |
| Escape Sequences | 18 | |
| Regular Expression Operators | 21 | |
| Additional Regexp Operators Only in gawk | 28 | |
| Case-sensitivity in Matching | 30 | |
| How Much Text Matches? | 32 | |
| Using Dynamic Regexps | 32 | |
| Chapter 4 | Reading Input Files | 34 |
| How Input is Split into Records | 34 | |
| Examining Fields | 37 | |
| Non-constant Field Numbers | 39 | |
| Changing the Contents of a Field | 40 | |
| Specifying How Fields are Separated | 42 | |
| Reading Fixed-width Data | 48 | |
| Multiple-Line Records | 50 | |
| Explicit Input with getline | 53 | |
| Chapter 5 | Printing Output | 61 |
| The print Statement | 61 | |
| Examples of print Statements | 62 | |
| Output Separators | 63 | |
| Controlling Numeric Output with print | 64 | |
| Using printf Statements for Fancier Printing | 65 | |
| Redirecting Output of print and printf | 72 | |
| Special File Names in gawk | 74 | |
| Closing Input and Output Files and Pipes | 77 | |
| Chapter 6 | Expressions | 80 |
| Constant Expressions | 80 | |
| Using Regular Expression Constants | 81 | |
| Variables | 83 | |
| Conversion of Strings and Numbers | 85 | |
| Arithmetic Operators | 86 | |
| String Concatenation | 88 | |
| Assignment Expressions | 89 | |
| Increment and Decrement Operators | 93 | |
| True and False in AWK | 94 | |
| Variable Typing and Comparison Expressions | 95 | |
| Boolean Expressions | 99 | |
| Conditional Expressions | 101 | |
| Function Calls | 102 | |
| Operator Precedence (How Operators Nest) | 103 | |
| Chapter 7 | Patterns and Actions | 106 |
| Pattern Elements | 106 | |
| Overview of Actions | 113 | |
| Chapter 8 | Control Statements in Actions | 115 |
| The if-else Statement | 115 | |
| The while Statement | 116 | |
| The do-while Statement | 117 | |
| The for Statement | 118 | |
| The break Statement | 120 | |
| The continue Statement | 121 | |
| The next Statement | 122 | |
| The next file Statement | 123 | |
| The exit Statement | 124 | |
| Chapter 9 | Built-in Variables | 126 |
| Built-in Variables that Control AWK | 126 | |
| Built-in Variables that Convey Information | 128 | |
| Using ARGC and ARGV | 131 | |
| Chapter 10 | Arrays in AWK | 134 |
| Introduction to Arrays | 134 | |
| Referring to an Array Element | 136 | |
| Assigning Array Elements | 137 | |
| Basic Array Example | 137 | |
| Scanning All Elements of an Array | 138 | |
| The delete Statement | 140 | |
| Using Numbers to Subscript Arrays | 141 | |
| Using Uninitialized Variables as Subscripts | 142 | |
| Multi-dimensional Arrays | 143 | |
| Scanning Multi-dimensional Arrays | 145 | |
| Chapter 11 | Built-in Functions | 147 |
| Calling Built-in Functions | 147 | |
| Numeric Built-in Functions | 148 | |
| Built-in Functions for String Manipulation | 150 | |
| Built-in Functions for Input/Output | 157 | |
| Functions for Dealing with Time Stamps | 160 | |
| Chapter 12 | User-defined Functions | 168 |
| Function Definition Syntax | 168 | |
| Function Definition Examples | 170 | |
| Calling User-defined Functions | 172 | |
| The return Statement | 174 | |
| Chapter 13 | Running AWK | 176 |
| Command Line Options | 176 | |
| Other Command Line Arguments | 181 | |
| The AWKAPTH Environment Variable | 183 | |
| Obsolete Options and/or Features | 184 | |
| Undocumented Options and Features | 184 | |
| Known Bugs in GAWK | 184 | |
| Chapter 14 | A Library of awk Functions | 185 |
| Simulating gawk-specific Features | 185 | |
| Implementing next file as a Function | 186 | |
| Assertions | 188 | |
| Rounding Numbers | 190 | |
| Translating Between Characters and Numbers | 191 | |
| Merging an Array Into a String | 193 | |
| Turning Dates Into Timestamps | 194 | |
| Managing the Time of Day | 200 | |
| Noting Data File Boundaries | 202 | |
| Processing Command Line Options | 204 | |
| Reading the User Database | 210 | |
| Reading the Group Database | 215 | |
| Naming Library Function Global Variables | 221 | |
| Chapter 15 | Practical AWK Programs | 223 |
| Re-inventing Wheels for Fun and Profit | 223 | |
| A Grab Bag of awk Programs | 249 | |
| Chapter 16 | The Evolution of the AWK Language | 275 |
| Major Changes between V7 and SVR3.1 | 275 | |
| Changes between SVR3.1 and SVR4 | 277 | |
| Changes between SVR4 and POSIX AWK | 278 | |
| Extensions in the Bell Laboratories awk | 279 | |
| Extensions in gawk Not in POSIX AWK | 279 | |
| Chapter 17 | gawk Summary | 283 |
| Command Line Options Summary | 283 | |
| Language Summary | 286 | |
| Variables and Fields | 287 | |
| Patterns | 292 | |
| Actions | 298 | |
| User-defined Functions | 312 | |
| Historical Features | 313 | |
| Chapter 18 | Installing GAWK | 315 |
| The GAWK Distribution | 315 | |
| Compiling and Installing GAWK on Unix | 324 | |
| How to Compile and Install GAWK on VMS | 326 | |
| MS-DOS and OS/2 Installation and Compilation | 329 | |
| Installing gawk on the Atari ST | 330 | |
| Installing gawk on an Amiga | 332 | |
| Reporting Problems and Bugs | 333 | |
| Other Freely Available awk Implementations | 335 | |
| Chapter 19 | Implementation Notes | 337 |
| Downward Compatibility and Debugging | 337 | |
| Making Additions to GAWK | 337 | |
| Probable Future Extensions | 342 | |
| Suggestions for Improvements | 343 | |
| Chapter 20 | Glossary | 345 |
| Footnotes | 357 | |
| GNU Free Documentation License | 363 | |
| Table of Contents | 363 | |
| GNU Free Documentation License | 363 | |
| How to use this License for your documents | 371 | |
| The GNU Project | 373 | |
| The first software-sharing community | 373 | |
| The collapse of the community | 374 | |
| A stark moral choice | 375 | |
| Free as in freedom | 377 | |
| GNU software and the GNU system | 378 | |
| Commencing the project | 378 | |
| The first steps | 378 | |
| GNU Emacs | 379 | |
| Is a program free for every user? | 380 | |
| Copyleft and the GNU GPL | 380 | |
| The Free Software Foundation | 381 | |
| Free software support | 382 | |
| Technical goals | 383 | |
| The GNU Task List | 384 | |
| The GNU Library GPL | 384 | |
| Scratching an itch? | 385 | |
| Unexpected developments | 386 | |
| The GNU Hurd | 386 | |
| Alix | 387 | |
| Linux and GNU/Linux | 387 | |
| Challenges in our future | 388 | |
| Secret hardware | 388 | |
| Non-free libraries | 388 | |
| Software patents | 390 | |
| Free documentation | 390 | |
| We must talk about freedom | 391 | |
| "Open Source" | 392 | |
| Try! | 393 |
Overview
Implementations of the awk language are available for many different computing environments. Effective AWK Programming, while describing the awk language in general, also describes a particular implementation of awk called ...