gawk: This Manual

1 
1 Using This Book
1 ===============
1 
1 The term 'awk' refers to a particular program as well as to the language
1 you use to tell this program what to do.  When we need to be careful, we
1 call the language "the 'awk' language," and the program "the 'awk'
1 utility."  This Info file explains both how to write programs in the
1 'awk' language and how to run the 'awk' utility.  The term "'awk'
1 program" refers to a program written by you in the 'awk' programming
1 language.
1 
1    Primarily, this Info file explains the features of 'awk' as defined
1 in the POSIX standard.  It does so in the context of the 'gawk'
1 implementation.  While doing so, it also attempts to describe important
1 differences between 'gawk' and other 'awk' implementations.(1)  Finally,
1 it notes any 'gawk' features that are not in the POSIX standard for
1 'awk'.
1 
1    There are sidebars scattered throughout the Info file.  They add a
1 more complete explanation of points that are relevant, but not likely to
1 be of interest on first reading.  All appear in the index, under the
1 heading "sidebar."
1 
1    Most of the time, the examples use complete 'awk' programs.  Some of
1 the more advanced minor nodes show only the part of the 'awk' program
1 that illustrates the concept being described.
1 
1    Although this Info file is aimed principally at people who have not
1 been exposed to 'awk', there is a lot of information here that even the
1 'awk' expert should find useful.  In particular, the description of
1 POSIX 'awk' and the example programs in ⇒Library Functions, and
1 in ⇒Sample Programs, should be of interest.
1 
1    This Info file is split into several parts, as follows:
1 
1    * Part I describes the 'awk' language and the 'gawk' program in
1      detail.  It starts with the basics, and continues through all of
1      the features of 'awk'.  It contains the following chapters:
1 
1         - ⇒Getting Started, provides the essentials you need to
1           know to begin using 'awk'.
1 
1         - ⇒Invoking Gawk, describes how to run 'gawk', the
1           meaning of its command-line options, and how it finds 'awk'
1           program source files.
1 
1         - ⇒Regexp, introduces regular expressions in general, and
1           in particular the flavors supported by POSIX 'awk' and 'gawk'.
1 
1         - ⇒Reading Files, describes how 'awk' reads your data.
1           It introduces the concepts of records and fields, as well as
1           the 'getline' command.  I/O redirection is first described
1           here.  Network I/O is also briefly introduced here.
1 
1         - ⇒Printing, describes how 'awk' programs can produce
1           output with 'print' and 'printf'.
1 
1         - ⇒Expressions, describes expressions, which are the
1           basic building blocks for getting most things done in a
1           program.
1 
1         - ⇒Patterns and Actions, describes how to write patterns
1           for matching records, actions for doing something when a
1           record is matched, and the predefined variables 'awk' and
1           'gawk' use.
1 
1         - ⇒Arrays, covers 'awk''s one-and-only data structure:
1           the associative array.  Deleting array elements and whole
1           arrays is described, as well as sorting arrays in 'gawk'.  The
1           major node also describes how 'gawk' provides arrays of
1           arrays.
1 
1         - ⇒Functions, describes the built-in functions 'awk' and
1           'gawk' provide, as well as how to define your own functions.
1           It also discusses how 'gawk' lets you call functions
1           indirectly.
1 
1    * Part II shows how to use 'awk' and 'gawk' for problem solving.
1      There is lots of code here for you to read and learn from.  This
1      part contains the following chapters:
1 
1         - ⇒Library Functions, provides a number of functions
1           meant to be used from main 'awk' programs.
1 
1         - ⇒Sample Programs, provides many sample 'awk' programs.
1 
1      Reading these two chapters allows you to see 'awk' solving real
1      problems.
1 
1    * Part III focuses on features specific to 'gawk'.  It contains the
1      following chapters:
1 
1         - ⇒Advanced Features, describes a number of advanced
1           features.  Of particular note are the abilities to control the
1           order of array traversal, have two-way communications with
1           another process, perform TCP/IP networking, and profile your
1           'awk' programs.
1 
1         - ⇒Internationalization, describes special features for
1           translating program messages into different languages at
1           runtime.
1 
1         - ⇒Debugger, describes the 'gawk' debugger.
1 
1         - ⇒Arbitrary Precision Arithmetic, describes advanced
1           arithmetic facilities.
1 
1         - ⇒Dynamic Extensions, describes how to add new variables
1           and functions to 'gawk' by writing extensions in C or C++.
1 
1    * Part IV provides the appendices, the Glossary, and two licenses
1      that cover the 'gawk' source code and this Info file, respectively.
1      It contains the following appendices:
1 
1         - ⇒Language History, describes how the 'awk' language has
1           evolved since its first release to the present.  It also
1           describes how 'gawk' has acquired features over time.
1 
1         - ⇒Installation, describes how to get 'gawk', how to
1           compile it on POSIX-compatible systems, and how to compile and
1           use it on different non-POSIX systems.  It also describes how
1           to report bugs in 'gawk' and where to get other freely
1           available 'awk' implementations.
1 
1         - ⇒Notes, describes how to disable 'gawk''s extensions,
1           as well as how to contribute new code to 'gawk', and some
1           possible future directions for 'gawk' development.
1 
1         - ⇒Basic Concepts, provides some very cursory background
1           material for those who are completely unfamiliar with computer
1           programming.
1 
1           The ⇒Glossary, defines most, if not all, of the
1           significant terms used throughout the Info file.  If you find
1           terms that you aren't familiar with, try looking them up here.
1 
1         - ⇒Copying, and ⇒GNU Free Documentation License,
1           present the licenses that cover the 'gawk' source code and
1           this Info file, respectively.
1 
1    ---------- Footnotes ----------
1 
1    (1) All such differences appear in the index under the entry
1 "differences in 'awk' and 'gawk'."
1