\unnumbchapentry{Preface}{1}
\unnumbsecentry{History of \code {awk} and \code {gawk}}{1}
\unnumbsecentry{The GNU Project and This Book}{1}
\unnumbsecentry{Acknowledgements}{3}
\chapentry{Introduction}{1}{5}
\secentry {Using This Book}{1}{1}{5}
\unnumbsubsecentry{Dark Corners}{6}
\secentry {Typographical Conventions}{1}{2}{6}
\secentry {Data Files for the Examples}{1}{3}{7}
\chapentry{Getting Started with \code {awk}}{2}{9}
\secentry {A Rose By Any Other Name}{2}{1}{9}
\secentry {How to Run \code {awk} Programs}{2}{2}{10}
\subsecentry {One-shot Throw-away \code {awk} Programs}{2}{2}{1}{10}
\subsecentry {Running \code {awk} without Input Files}{2}{2}{2}{11}
\subsecentry {Running Long Programs}{2}{2}{3}{11}
\subsecentry {Executable \code {awk} Programs}{2}{2}{4}{12}
\subsecentry {Comments in \code {awk} Programs}{2}{2}{5}{13}
\secentry {A Very Simple Example}{2}{3}{14}
\secentry {An Example with Two Rules}{2}{4}{14}
\secentry {A More Complex Example}{2}{5}{15}
\secentry {\code {awk} Statements Versus Lines}{2}{6}{17}
\secentry {Other Features of \code {awk}}{2}{7}{18}
\secentry {When to Use \code {awk}}{2}{8}{19}
\chapentry{Useful One Line Programs}{3}{21}
\chapentry{Regular Expressions}{4}{23}
\secentry {How to Use Regular Expressions}{4}{1}{23}
\secentry {Escape Sequences}{4}{2}{24}
\secentry {Regular Expression Operators}{4}{3}{26}
\secentry {Additional Regexp Operators Only in \code {gawk}}{4}{4}{31}
\secentry {Case-sensitivity in Matching}{4}{5}{33}
\secentry {How Much Text Matches?}{4}{6}{34}
\secentry {Using Dynamic Regexps}{4}{7}{35}
\chapentry{Reading Input Files}{5}{37}
\secentry {How Input is Split into Records}{5}{1}{37}
\secentry {Examining Fields}{5}{2}{40}
\secentry {Non-constant Field Numbers}{5}{3}{41}
\secentry {Changing the Contents of a Field}{5}{4}{42}
\secentry {Specifying How Fields are Separated}{5}{5}{44}
\subsecentry {The Basics of Field Separating}{5}{5}{1}{44}
\subsecentry {Using Regular Expressions to Separate Fields}{5}{5}{2}{45}
\subsecentry {Making Each Character a Separate Field}{5}{5}{3}{46}
\subsecentry {Setting \code {FS} from the Command Line}{5}{5}{4}{47}
\subsecentry {Field Splitting Summary}{5}{5}{5}{48}
\secentry {Reading Fixed-width Data}{5}{6}{49}
\secentry {Multiple-Line Records}{5}{7}{51}
\secentry {Explicit Input with \code {getline}}{5}{8}{53}
\subsecentry {Introduction to \code {getline}}{5}{8}{1}{54}
\subsecentry {Using \code {getline} with No Arguments}{5}{8}{2}{54}
\subsecentry {Using \code {getline} Into a Variable}{5}{8}{3}{55}
\subsecentry {Using \code {getline} from a File}{5}{8}{4}{56}
\subsecentry {Using \code {getline} Into a Variable from a File}{5}{8}{5}{56}
\subsecentry {Using \code {getline} from a Pipe}{5}{8}{6}{57}
\subsecentry {Using \code {getline} Into a Variable from a Pipe}{5}{8}{7}{58}
\subsecentry {Summary of \code {getline} Variants}{5}{8}{8}{59}
\chapentry{Printing Output}{6}{61}
\secentry {The \code {print} Statement}{6}{1}{61}
\secentry {Examples of \code {print} Statements}{6}{2}{62}
\secentry {Output Separators}{6}{3}{63}
\secentry {Controlling Numeric Output with \code {print}}{6}{4}{64}
\secentry {Using \code {printf} Statements for Fancier Printing}{6}{5}{64}
\subsecentry {Introduction to the \code {printf} Statement}{6}{5}{1}{65}
\subsecentry {Format-Control Letters}{6}{5}{2}{65}
\subsecentry {Modifiers for \code {printf} Formats}{6}{5}{3}{66}
\subsecentry {Examples Using \code {printf}}{6}{5}{4}{68}
\secentry {Redirecting Output of \code {print} and \code {printf}}{6}{6}{70}
\secentry {Special File Names in \code {gawk}}{6}{7}{72}
\secentry {Closing Input and Output Files and Pipes}{6}{8}{74}
\chapentry{Expressions}{7}{77}
\secentry {Constant Expressions}{7}{1}{77}
\subsecentry {Numeric and String Constants}{7}{1}{1}{77}
\subsecentry {Regular Expression Constants}{7}{1}{2}{77}
\secentry {Using Regular Expression Constants}{7}{2}{78}
\secentry {Variables}{7}{3}{79}
\subsecentry {Using Variables in a Program}{7}{3}{1}{79}
\subsecentry {Assigning Variables on the Command Line}{7}{3}{2}{80}
\secentry {Conversion of Strings and Numbers}{7}{4}{81}
\secentry {Arithmetic Operators}{7}{5}{82}
\secentry {String Concatenation}{7}{6}{83}
\secentry {Assignment Expressions}{7}{7}{84}
\secentry {Increment and Decrement Operators}{7}{8}{87}
\secentry {True and False in \code {awk}}{7}{9}{88}
\secentry {Variable Typing and Comparison Expressions}{7}{10}{88}
\secentry {Boolean Expressions}{7}{11}{91}
\secentry {Conditional Expressions}{7}{12}{92}
\secentry {Function Calls}{7}{13}{93}
\secentry {Operator Precedence (How Operators Nest)}{7}{14}{94}
\chapentry{Patterns and Actions}{8}{97}
\secentry {Pattern Elements}{8}{1}{97}
\subsecentry {Kinds of Patterns}{8}{1}{1}{97}
\subsecentry {Regular Expressions as Patterns}{8}{1}{2}{97}
\subsecentry {Expressions as Patterns}{8}{1}{3}{98}
\subsecentry {Specifying Record Ranges with Patterns}{8}{1}{4}{99}
\subsecentry {The \code {BEGIN} and \code {END} Special Patterns}{8}{1}{5}{100}
\subsubsecentry{Startup and Cleanup Actions} {8}{1}{5}{1} {100}
\subsubsecentry{Input/Output from \code {BEGIN} and \code {END} Rules} {8}{1}{5}{2} {102}
\subsecentry {The Empty Pattern}{8}{1}{6}{102}
\secentry {Overview of Actions}{8}{2}{102}
\chapentry{Control Statements in Actions}{9}{105}
\secentry {The \code {if}-\code {else} Statement}{9}{1}{105}
\secentry {The \code {while} Statement}{9}{2}{106}
\secentry {The \code {do}-\code {while} Statement}{9}{3}{106}
\secentry {The \code {for} Statement}{9}{4}{107}
\secentry {The \code {break} Statement}{9}{5}{109}
\secentry {The \code {continue} Statement}{9}{6}{110}
\secentry {The \code {next} Statement}{9}{7}{111}
\secentry {The \code {nextfile} Statement}{9}{8}{112}
\secentry {The \code {exit} Statement}{9}{9}{112}
\chapentry{Built-in Variables}{10}{115}
\secentry {Built-in Variables that Control \code {awk}}{10}{1}{115}
\secentry {Built-in Variables that Convey Information}{10}{2}{117}
\secentry {Using \code {ARGC} and \code {ARGV}}{10}{3}{120}
\chapentry{Arrays in \code {awk}}{11}{123}
\secentry {Introduction to Arrays}{11}{1}{123}
\secentry {Referring to an Array Element}{11}{2}{124}
\secentry {Assigning Array Elements}{11}{3}{125}
\secentry {Basic Array Example}{11}{4}{125}
\secentry {Scanning All Elements of an Array}{11}{5}{127}
\secentry {The \code {delete} Statement}{11}{6}{128}
\secentry {Using Numbers to Subscript Arrays}{11}{7}{129}
\secentry {Using Uninitialized Variables as Subscripts}{11}{8}{130}
\secentry {Multi-dimensional Arrays}{11}{9}{130}
\secentry {Scanning Multi-dimensional Arrays}{11}{10}{132}
\chapentry{Built-in Functions}{12}{135}
\secentry {Calling Built-in Functions}{12}{1}{135}
\secentry {Numeric Built-in Functions}{12}{2}{136}
\secentry {Built-in Functions for String Manipulation}{12}{3}{137}
\secentry {Built-in Functions for Input/Output}{12}{4}{146}
\secentry {Functions for Dealing with Time Stamps}{12}{5}{148}
\chapentry{User-defined Functions}{13}{153}
\secentry {Function Definition Syntax}{13}{1}{153}
\secentry {Function Definition Examples}{13}{2}{154}
\secentry {Calling User-defined Functions}{13}{3}{156}
\secentry {The \code {return} Statement}{13}{4}{158}
\chapentry{Running \code {awk}}{14}{161}
\secentry {Command Line Options}{14}{1}{161}
\secentry {Other Command Line Arguments}{14}{2}{165}
\secentry {The \code {AWKPATH} Environment Variable}{14}{3}{166}
\secentry {Obsolete Options and/or Features}{14}{4}{167}
\secentry {Undocumented Options and Features}{14}{5}{167}
\secentry {Known Bugs in \code {gawk}}{14}{6}{167}
\chapentry{A Library of \code {awk} Functions}{15}{169}
\secentry {Simulating \code {gawk}-specific Features}{15}{1}{169}
\secentry {Implementing \code {nextfile} as a Function}{15}{2}{170}
\secentry {Assertions}{15}{3}{172}
\secentry {Rounding Numbers}{15}{4}{173}
\secentry {Translating Between Characters and Numbers}{15}{5}{174}
\secentry {Merging an Array Into a String}{15}{6}{176}
\secentry {Turning Dates Into Timestamps}{15}{7}{177}
\secentry {Managing the Time of Day}{15}{8}{183}
\secentry {Noting Data File Boundaries}{15}{9}{185}
\secentry {Processing Command Line Options}{15}{10}{186}
\secentry {Reading the User Database}{15}{11}{192}
\secentry {Reading the Group Database}{15}{12}{197}
\secentry {Naming Library Function Global Variables}{15}{13}{202}
\chapentry{Practical \code {awk} Programs}{16}{205}
\secentry {Re-inventing Wheels for Fun and Profit}{16}{1}{205}
\subsecentry {Cutting Out Fields and Columns}{16}{1}{1}{205}
\subsecentry {Searching for Regular Expressions in Files}{16}{1}{2}{210}
\subsecentry {Printing Out User Information}{16}{1}{3}{215}
\subsecentry {Splitting a Large File Into Pieces}{16}{1}{4}{217}
\subsecentry {Duplicating Output Into Multiple Files}{16}{1}{5}{219}
\subsecentry {Printing Non-duplicated Lines of Text}{16}{1}{6}{220}
\subsecentry {Counting Things}{16}{1}{7}{225}
\secentry {A Grab Bag of \code {awk} Programs}{16}{2}{227}
\subsecentry {Finding Duplicated Words in a Document}{16}{2}{1}{228}
\subsecentry {An Alarm Clock Program}{16}{2}{2}{228}
\subsecentry {Transliterating Characters}{16}{2}{3}{231}
\subsecentry {Printing Mailing Labels}{16}{2}{4}{233}
\subsecentry {Generating Word Usage Counts}{16}{2}{5}{235}
\subsecentry {Removing Duplicates from Unsorted Text}{16}{2}{6}{238}
\subsecentry {Extracting Programs from Texinfo Source Files}{16}{2}{7}{238}
\subsecentry {A Simple Stream Editor}{16}{2}{8}{242}
\subsecentry {An Easy Way to Use Library Functions}{16}{2}{9}{244}
\chapentry{The Evolution of the \code {awk} Language}{17}{253}
\secentry {Major Changes between V7 and SVR3.1}{17}{1}{253}
\secentry {Changes between SVR3.1 and SVR4}{17}{2}{254}
\secentry {Changes between SVR4 and POSIX \code {awk}}{17}{3}{255}
\secentry {Extensions in the Bell Laboratories \code {awk}}{17}{4}{255}
\secentry {Extensions in \code {gawk} Not in POSIX \code {awk}}{17}{5}{256}
\chapentry{\code {gawk} Summary}{Appendix{} \char65}{259}
\secentry {Command Line Options Summary}{\char65}{1}{259}
\secentry {Language Summary}{\char65}{2}{261}
\secentry {Variables and Fields}{\char65}{3}{261}
\subsecentry {Fields}{\char65}{3}{1}{262}
\subsecentry {Built-in Variables}{\char65}{3}{2}{262}
\subsecentry {Arrays}{\char65}{3}{3}{264}
\subsecentry {Data Types}{\char65}{3}{4}{264}
\secentry {Patterns}{\char65}{4}{265}
\subsecentry {Pattern Summary}{\char65}{4}{1}{266}
\subsecentry {Regular Expressions}{\char65}{4}{2}{267}
\secentry {Actions}{\char65}{5}{268}
\subsecentry {Operators}{\char65}{5}{1}{269}
\subsecentry {Control Statements}{\char65}{5}{2}{270}
\subsecentry {I/O Statements}{\char65}{5}{3}{270}
\subsecentry {\code {printf} Summary}{\char65}{5}{4}{271}
\subsecentry {Special File Names}{\char65}{5}{5}{273}
\subsecentry {Built-in Functions}{\char65}{5}{6}{274}
\subsecentry {Time Functions}{\char65}{5}{7}{276}
\subsecentry {String Constants}{\char65}{5}{8}{276}
\secentry {User-defined Functions}{\char65}{6}{277}
\secentry {Historical Features}{\char65}{7}{277}
\chapentry{Installing \code {gawk}}{Appendix{} \char66}{279}
\secentry {The \code {gawk} Distribution}{\char66}{1}{279}
\subsecentry {Getting the \code {gawk} Distribution}{\char66}{1}{1}{279}
\subsecentry {Extracting the Distribution}{\char66}{1}{2}{281}
\subsecentry {Contents of the \code {gawk} Distribution}{\char66}{1}{3}{281}
\secentry {Compiling and Installing \code {gawk} on Unix}{\char66}{2}{284}
\subsecentry {Compiling \code {gawk} for Unix}{\char66}{2}{1}{284}
\subsecentry {The Configuration Process}{\char66}{2}{2}{285}
\secentry {How to Compile and Install \code {gawk} on VMS}{\char66}{3}{285}
\subsecentry {Compiling \code {gawk} on VMS}{\char66}{3}{1}{285}
\subsecentry {Installing \code {gawk} on VMS}{\char66}{3}{2}{286}
\subsecentry {Running \code {gawk} on VMS}{\char66}{3}{3}{287}
\subsecentry {Building and Using \code {gawk} on VMS POSIX}{\char66}{3}{4}{287}
\secentry {MS-DOS and OS/2 Installation and Compilation}{\char66}{4}{288}
\secentry {Installing \code {gawk} on the Atari ST}{\char66}{5}{289}
\subsecentry {Compiling \code {gawk} on the Atari ST}{\char66}{5}{1}{289}
\subsecentry {Running \code {gawk} on the Atari ST}{\char66}{5}{2}{290}
\secentry {Installing \code {gawk} on an Amiga}{\char66}{6}{291}
\secentry {Reporting Problems and Bugs}{\char66}{7}{292}
\secentry {Other Freely Available \code {awk} Implementations}{\char66}{8}{293}
\chapentry{Implementation Notes}{Appendix{} \char67}{295}
\secentry {Downward Compatibility and Debugging}{\char67}{1}{295}
\secentry {Making Additions to \code {gawk}}{\char67}{2}{295}
\subsecentry {Adding New Features}{\char67}{2}{1}{295}
\subsecentry {Porting \code {gawk} to a New Operating System}{\char67}{2}{2}{297}
\secentry {Probable Future Extensions}{\char67}{3}{299}
\secentry {Suggestions for Improvements}{\char67}{4}{300}
\chapentry{Glossary}{Appendix{} \char68}{301}
\unnumbchapentry{GNU GENERAL PUBLIC LICENSE}{309}
\unnumbsecentry{Preamble}{309}
\unnumbsecentry{TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION}{310}
\unnumbsecentry{How to Apply These Terms to Your New Programs}{315}
\unnumbchapentry{Index}{317}
