GNU Awk

2y ago
120 Views
3 Downloads
2.08 MB
572 Pages
Last View : 1m ago
Last Download : 2m ago
Upload by : Esmeralda Toy
Transcription

GNU Awk

GAWK: Effective AWK ProgrammingA User’s Guide for GNU AwkEdition 5.1March, 2020Arnold D. Robbins

“To boldly go where no man has gone before” is a Registered Trademark of ParamountPictures Corporation.Published by:Free Software Foundation51 Franklin Street, Fifth FloorBoston, MA 02110-1301 USAPhone: 1-617-542-5942Fax: 1-617-542-2652Email: gnu@gnu.orgURL: https://www.gnu.org/ISBN 1-882114-28-0Copyright c 1989, 1991, 1992, 1993, 1996–2005, 2007, 2009–2020Free Software Foundation, Inc.This is Edition 5.1 of GAWK: Effective AWK Programming: A User’s Guide for GNU Awk,for the 5.1.0 (or later) version of the GNU implementation of AWK.Permission is granted to copy, distribute and/or modify this document under the termsof the GNU Free Documentation License, Version 1.3 or any later version published bythe Free Software Foundation; with the Invariant Sections being “GNU General PublicLicense”, with the Front-Cover Texts being “A GNU Manual”, and with the Back-CoverTexts as in (a) below. A copy of the license is included in the section entitled “GNU FreeDocumentation License”.a. The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNUmanual.”

To my parents, for their love, and for the wonderful example they set for me.To my wife, Miriam, for making me complete.Thank you for building your life together with me.To our children, Chana, Rivka, Nachum, and Malka, for enrichening our lives in innumerable ways.

iShort ContentsForeword to the Third Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Foreword to the Fourth Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Part I: The awk Language1Getting Started with awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723Running awk and gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474Reading Input Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615Printing Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9367Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113Patterns, Actions, and Variables . . . . . . . . . . . . . . . . . . . . . . . . 1418Arrays in awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1719Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187Part II: Problem Solving with awk10 A Library of awk Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23311 Practical awk Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269Part III: Moving Beyond Standard awk with gawk12 Advanced Features of gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31713 Internationalization with gawk . . . . . . . . . . . . . . . . . . . . . . . . . 33514 Debugging awk Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34515 Namespaces in gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36116 Arithmetic and Arbitrary-Precision Arithmetic with gawk . . . 36717 Writing Extensions for gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . 381Part IV: AppendicesAThe Evolution of the awk Language . . . . . . . . . . . . . . . . . . . . . 447BCInstalling gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465Implementation Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483DBasic Programming Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 493Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497GNU General Public License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509GNU Free Documentation License . . . . . . . . . . . . . . . . . . . . . . . . . . 521

ii GAWK: Effective AWK ProgrammingIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529

iiiTable of ContentsForeword to the Third Edition . . . . . . . . . . . . . . . . . . . . . 1Foreword to the Fourth Edition . . . . . . . . . . . . . . . . . . . . 3Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5History of awk and gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6A Rose by Any Other Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Using This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Dark Corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10The GNU Project and This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10How to Contribute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Part I: The awk Language1Getting Started with awk . . . . . . . . . . . . . . . . . . . . . . 171.1How to Run awk Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171.1.1 One-Shot Throwaway awk Programs . . . . . . . . . . . . . . . . . . . . . . 171.1.2 Running awk Without Input Files . . . . . . . . . . . . . . . . . . . . . . . . . 181.1.3 Running Long Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181.1.4 Executable awk Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191.1.5 Comments in awk Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201.1.6 Shell Quoting Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211.1.6.1 Quoting in MS-Windows Batch Files . . . . . . . . . . . . . . . . . 231.2 Data files for the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.3 Some Simple Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.4 An Example with Two Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.5 A More Complex Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271.6 awk Statements Versus Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.7 Other Features of awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291.8 When to Use awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301.9 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302Running awk and gawk . . . . . . . . . . . . . . . . . . . . . . . . . . 312.12.22.32.42.5Invoking awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Other Command-Line Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Naming Standard Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39The Environment Variables gawk Uses . . . . . . . . . . . . . . . . . . . . . . . . . 392.5.1 The AWKPATH Environment Variable . . . . . . . . . . . . . . . . . . . . . . . 39

iv GAWK: Effective AWK Programming2.5.2 The AWKLIBPATH Environment Variable . . . . . . . . . . . . . . . . . . . 412.5.3 Other Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.6 gawk’s Exit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.7 Including Other Files into Your Program. . . . . . . . . . . . . . . . . . . . . . . 432.8 Loading Dynamic Extensions into Your Program . . . . . . . . . . . . . . . 442.9 Obsolete Options and/or Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452.10 Undocumented Options and Features . . . . . . . . . . . . . . . . . . . . . . . . . 452.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.13.23.3How to Use Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Escape Sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Regular Expression Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.3.1 Regexp Operators in awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.3.2 Some Notes On Interval Expressions . . . . . . . . . . . . . . . . . . . . . . 523.4 Using Bracket Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.5 How Much Text Matches? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.6 Using Dynamic Regexps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.7 gawk-Specific Regexp Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563.8 Case Sensitivity in Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583.9 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594Reading Input Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.1How Input Is Split into Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.1.1 Record Splitting with Standard awk . . . . . . . . . . . . . . . . . . . . . . . 614.1.2 Record Splitting with gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634.2 Examining Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654.3 Nonconstant Field Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664.4 Changing the Contents of a Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674.5 Specifying How Fields Are Separated . . . . . . . . . . . . . . . . . . . . . . . . . . 694.5.1 Whitespace Normally Separates Fields . . . . . . . . . . . . . . . . . . . . 704.5.2 Using Regular Expressions to Separate Fields . . . . . . . . . . . . . 704.5.3 Making Each Character a Separate Field . . . . . . . . . . . . . . . . . . 714.5.4 Setting FS from the Command Line . . . . . . . . . . . . . . . . . . . . . . . 714.5.5 Making the Full Line Be a Single Field . . . . . . . . . . . . . . . . . . . . 734.5.6 Field-Splitting Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734.6 Reading Fixed-Width Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.6.1 Processing Fixed-Width Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744.6.2 Skipping Intervening Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764.6.3 Capturing Optional Trailing Data . . . . . . . . . . . . . . . . . . . . . . . . . 764.6.4 Field Values With Fixed-Width Data . . . . . . . . . . . . . . . . . . . . . 764.7 Defining Fields by Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774.7.1 More on CSV Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784.8 Checking How gawk Is Splitting Records . . . . . . . . . . . . . . . . . . . . . . . 794.9 Multiple-Line Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804.10 Explicit Input with getline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824.10.1 Using getline with No Arguments . . . . . . . . . . . . . . . . . . . . . . 83

v4.10.2 Using getline into a Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 844.10.3 Using getline from a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844.10.4 Using getline into a Variable from a File . . . . . . . . . . . . . . . 854.10.5 Using getline from a Pipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864.10.6 Using getline into a Variable from a Pipe . . . . . . . . . . . . . . . 874.10.7 Using getline from a Coprocess . . . . . . . . . . . . . . . . . . . . . . . . . 874.10.8 Using getline into a Variable from a Coprocess . . . . . . . . . 874.10.9 Points to Remember About getline . . . . . . . . . . . . . . . . . . . . . 874.10.10 Summary of getline Variants . . . . . . . . . . . . . . . . . . . . . . . . . . 884.11 Reading Input with a Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 894.12 Retrying Reads After Certain Input Errors . . . . . . . . . . . . . . . . . . . 904.13 Directories on the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914.14 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914.15 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925Printing Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935.1 The print Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935.2 print Statement Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935.3 Output Separators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 955.4 Controlling Numeric Output with print . . . . . . . . . . . . . . . . . . . . . . . 965.5 Using printf Statements for Fancier Printing . . . . . . . . . . . . . . . . . . 965.5.1 Introduction to the printf Statement. . . . . . . . . . . . . . . . . . . . . 965.5.2 Format-Control Letters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 975.5.3 Modifiers for printf Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 995.5.4 Examples Using printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015.6 Redirecting Output of print and printf . . . . . . . . . . . . . . . . . . . . . 1025.7 Special Files for Standard Preopened Data Streams . . . . . . . . . . . 1045.8 Special File names in gawk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055.8.1 Accessing Other Open Files with gawk . . . . . . . . . . . . . . . . . . . 1065.8.2 Special Files for Network Communications . . . . . . . . . . . . . . . 1065.8.3 Special File name Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065.9 Closing Input and Output Redirections . . . . . . . . . . . . . . . . . . . . . . . 1065.10 Enabling Nonfatal Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1095.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1105.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1106Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1136.1Constants, Variables, and Conversions . . . . . . . . . . . . . . . . . . . . . . . . 1136.1.1 Constant Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1136.1.1.1 Numeric and String Constants . . . . . . . . . . . . . . . . . . . . . . 1136.1.1.2 Octal and Hexadecimal Numbers . . . . . . . . . . . . . . . . . . . . 1146.1.1.3 Regular Expression Constants. . . . . . . . . . . . . . . . . . . . . . . 1156.1.2 Using Regular Expression Constants . . . . . . . . . . . . . . . . . . . . . 1156.1.2.1 Standard Regular Expression Constants . . . . . . . . . . . . . 1166.1.2.2 Strongly Typed Regexp Constants . . . . . . . . . . . . . . . . . . 1176.1.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1186.1.3.1 Using Variables in a Program . . . . . . . . . . . . . . . . . . . . . . . 118

vi GAWK: Effective AWK Programming6.1.3.2 Assigning Variables on the Command Line . . . . . . . . . . 1186.1.4 Conversion of Strings and Numbers . . . . . . . . . . . . . . . . . . . . . . 1196.1.4.1 How awk Converts Between Strings and Numbers . . . 1196.1.4.2 Locales Can Influence Conversion . . . . . . . . . . . . . . . . . . . 1206.2 Operators: Doing Something with Values . . . . . . . . . . . . . . . . . . . . . 1226.2.1 Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1226.2.2 String Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1236.2.3 Assignment Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1246.2.4 Increment and Decrement Operators . . . . . . . . . . . . . . . . . . . . . 1276.3 Truth Values and Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286.3.1 True and False in awk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286.3.2 Variable Typing and Comparison Expressions . . . . . . . . . . . . 1286.3.2.1 String Type versus Numeric Type . . . . . . . . . . . . . . . . . . . 1296.3.2.2 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316.3.2.3 String Comparison Based on Locale Collating Order . . 1336.3.3 Boolean Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1336.3.4 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1356.4 Function Calls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1366.5 Operator Precedence (How Operators Nest). . . . . . . . . . . . . . . . . . . 1376.6 Where You Are Makes a Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . 1386.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1397Patterns, Actions, and Variables . . . . . . . . . . . . 1417.1Pattern Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1417.1.1 Regular Expressions as Patterns . . . . . . . . . . . . . . . . . . . . . . . . . 1417.1.2 Expressions as Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1417.1.3 Specifying Record Ranges with Patterns . . . . . . . . . . . . . . . . . 1437.1.4 The BEGIN and END Special Patterns . . . . . . . . . . . . . . . . . . . . . 1447.1.4.1 Startup and Cleanup Actions . . . . . . . . . . . . . . . . . . . . . . . 1447.1.4.2 Input/Output from BEGIN and END Rules. . . . . . . . . . . . 1457.1.5 The BEGINFILE and ENDFILE Special Patterns. . . . . . . . . . . . 1457.1.6 The Empty Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1467.2 Using Shell Variables in Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1467.3 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1477.4 Control Statements in Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1487.4.1 The if-else Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1487.4.2 The while Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1497.4.3 The do-while Statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1507.4.4 The for Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1507.4.5 The switch Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

This is Edition 5.1 of GAWK: Effective AWK Programming: A User’s Guide for GNU Awk, for the 5.1.0 (or later) version of the GNU implementation of AWK. Permission is granted to cop

Related Documents:

-This makes awk one of the most powerful of the Unix utilities awk processes fields while sed only processes lines nawk (new awk) is the new standard for awk -Designed to facilitate large awk programs -gawk is a free nawk clone from GNU awk gets it's input from -files -redirection and pipes -directly from standard input

This is Edition 4.1 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 4.1.4 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by

This is Edition 4.1 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 4.1.1 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the

This is Edition 3 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 3.1.4 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the

This is Edition 4.2 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 4.2.0 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by

This is Edition 5.0 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 5.0.0 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by

This is Edition 4.1 of GAWK: Effective AWK Programming: A User's Guide for GNU Awk, for the 4.1.0 (or later) version of the GNU implementation of AWK. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the

“Accounting is the art of recording, classifying and summarizing in a significant manner and in terms of money, transactions and events which are, in part at least, of a financial character, and interpreting the result thereof”. Definition by the American Accounting Association (Year 1966): “The process of identifying, measuring and communicating economic information to permit informed .