aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.info')
-rw-r--r--doc/gawk.info4127
1 files changed, 2067 insertions, 2060 deletions
diff --git a/doc/gawk.info b/doc/gawk.info
index 32d86905..e01a794b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -690,24 +690,24 @@ circumstances--and our favorite programming language, AWK. The
circumstances started a couple of years earlier. I was working at a new
job and noticed an unplugged Unix computer sitting in the corner. No
one knew how to use it, and neither did I. However, a couple of days
-later it was running, and I was `root' and the one-and-only user. That
-day, I began the transition from statistician to Unix programmer.
+later, it was running, and I was `root' and the one-and-only user.
+That day, I began the transition from statistician to Unix programmer.
On one of many trips to the library or bookstore in search of books
-on Unix, I found the gray AWK book, a.k.a. Aho, Kernighan and
-Weinberger, `The AWK Programming Language', Addison-Wesley, 1988.
-AWK's simple programming paradigm--find a pattern in the input and then
-perform an action--often reduced complex or tedious data manipulations
-to a few lines of code. I was excited to try my hand at programming in
-AWK.
+on Unix, I found the gray AWK book, a.k.a. Alfred V. Aho, Brian W.
+Kernighan, and Peter J. Weinberger's `The AWK Programming Language'
+(Addison-Wesley, 1988). `awk''s simple programming paradigm--find a
+pattern in the input and then perform an action--often reduced complex
+or tedious data manipulations to a few lines of code. I was excited to
+try my hand at programming in AWK.
Alas, the `awk' on my computer was a limited version of the
-language described in the AWK book. I discovered that my computer had
-"old `awk'" and the AWK book described "new `awk'." I learned that
-this was typical; the old version refused to step aside or relinquish
-its name. If a system had a new `awk', it was invariably called
-`nawk', and few systems had it. The best way to get a new `awk' was to
-`ftp' the source code for `gawk' from `prep.ai.mit.edu'. `gawk' was a
+language described in the gray book. I discovered that my computer had
+"old `awk'" and the book described "new `awk'." I learned that this
+was typical; the old version refused to step aside or relinquish its
+name. If a system had a new `awk', it was invariably called `nawk',
+and few systems had it. The best way to get a new `awk' was to `ftp'
+the source code for `gawk' from `prep.ai.mit.edu'. `gawk' was a
version of new `awk' written by David Trueman and Arnold, and available
under the GNU General Public License.
@@ -718,14 +718,15 @@ almost any system; my wife uses `gawk' on her VMS box.)
My Unix system started out unplugged from the wall; it certainly was
not plugged into a network. So, oblivious to the existence of `gawk'
and the Unix community in general, and desiring a new `awk', I wrote my
-own, called `mawk'. Before I was finished I knew about `gawk', but it
+own, called `mawk'. Before I was finished, I knew about `gawk', but it
was too late to stop, so I eventually posted to a `comp.sources'
newsgroup.
A few days after my posting, I got a friendly email from Arnold
introducing himself. He suggested we share design and algorithms and
attached a draft of the POSIX standard so that I could update `mawk' to
-support language extensions added after publication of the AWK book.
+support language extensions added after publication of `The AWK
+Programming Language'.
Frankly, if our roles had been reversed, I would not have been so
open and we probably would have never met. I'm glad we did meet. He
@@ -739,9 +740,9 @@ a definitive reference to the AWK language as defined by the 1987 Bell
Laboratories release and codified in the 1992 POSIX Utilities standard.
On the other hand, the novice AWK programmer can study a wealth of
-practical programs that emphasize the power of AWK's basic idioms: data
-driven control-flow, pattern matching with regular expressions, and
-associative arrays. Those looking for something new can try out
+practical programs that emphasize the power of AWK's basic idioms:
+data-driven control flow, pattern matching with regular expressions,
+and associative arrays. Those looking for something new can try out
`gawk''s interface to network protocols via special `/inet' files.
The programs in this book make clear that an AWK program is
@@ -764,7 +765,7 @@ want to learn how, then read this book.
Michael Brennan
Author of `mawk'
- March, 2001
+ March 2001

File: gawk.info, Node: Foreword4, Next: Preface, Prev: Foreword3, Up: Top
@@ -798,7 +799,7 @@ help you learn the ins and outs.
Michael Brennan
Author of `mawk'
- October, 2014
+ October 2014

File: gawk.info, Node: Preface, Next: Getting Started, Prev: Foreword4, Up: Top
@@ -814,12 +815,12 @@ rest of the file alone. Such jobs are often easy with `awk'. The
makes it easy to handle simple data-reformatting jobs.
The GNU implementation of `awk' is called `gawk'; if you invoke it
-with the proper options or environment variables it is fully compatible
-with the POSIX(1) specification of the `awk' language and with the Unix
-version of `awk' maintained by Brian Kernighan. This means that all
-properly written `awk' programs should work with `gawk'. So most of
-the time, we don't distinguish between `gawk' and other `awk'
-implementations.
+with the proper options or environment variables, it is fully
+compatible with the POSIX(1) specification of the `awk' language and
+with the Unix version of `awk' maintained by Brian Kernighan. This
+means that all properly written `awk' programs should work with `gawk'.
+So most of the time, we don't distinguish between `gawk' and other
+`awk' implementations.
Using `awk' you can:
@@ -892,7 +893,7 @@ File: gawk.info, Node: History, Next: Names, Up: Preface
History of `awk' and `gawk'
===========================
- Recipe For A Programming Language
+ Recipe for a Programming Language
1 part `egrep' 1 part `snobol'
2 parts `ed' 3 parts C
@@ -904,7 +905,7 @@ release.
Document very well and release.
The name `awk' comes from the initials of its designers: Alfred V.
-Aho, Peter J. Weinberger and Brian W. Kernighan. The original version
+Aho, Peter J. Weinberger, and Brian W. Kernighan. The original version
of `awk' was written in 1977 at AT&T Bell Laboratories. In 1985, a new
version made the programming language more powerful, introducing
user-defined functions, multiple input streams, and computed regular
@@ -924,7 +925,7 @@ Circa 1994, I became the primary maintainer. Current development
focuses on bug fixes, performance improvements, standards compliance
and, occasionally, new features.
- In May of 1997, Ju"rgen Kahrs felt the need for network access from
+ In May 1997, Ju"rgen Kahrs felt the need for network access from
`awk', and with a little help from me, set about adding features to do
this for `gawk'. At that time, he also wrote the bulk of `TCP/IP
Internetworking with `gawk'' (a separate document, available as part of
@@ -946,7 +947,7 @@ A Rose by Any Other Name
The `awk' language has evolved over the years. Full details are
provided in *note Language History::. The language described in this
-Info file is often referred to as "new `awk'". By analogy, the
+Info file is often referred to as "new `awk'." By analogy, the
original version of `awk' is referred to as "old `awk'."
Today, on most systems, when you run the `awk' utility, you get some
@@ -1001,110 +1002,120 @@ heading "sidebar."
the more advanced sections show only the part of the `awk' program that
illustrates the concept being described.
- While this Info file is aimed principally at people who have not been
-exposed to `awk', there is a lot of information here that even the `awk'
-expert should find useful. In particular, the description of POSIX
-`awk' and the example programs in *note Library Functions::, and in
-*note Sample Programs::, should be of interest.
+ Although this Info file is aimed principally at people who have not
+been exposed to `awk', there is a lot of information here that even the
+`awk' expert should find useful. In particular, the description of
+POSIX `awk' and the example programs in *note Library Functions::, and
+in *note Sample Programs::, should be of interest.
This Info file is split into several parts, as follows:
- Part I describes the `awk' language and `gawk' program in detail.
-It starts with the basics, and continues through all of the features of
-`awk'. It contains the following chapters:
+ * Part I describes the `awk' language and `gawk' program in detail.
+ It starts with the basics, and continues through all of the
+ features of `awk'. It contains the following chapters:
- *note Getting Started::, provides the essentials you need to know to
-begin using `awk'.
+ - *note Getting Started::, provides the essentials you need to
+ know to begin using `awk'.
- *note Invoking Gawk::, describes how to run `gawk', the meaning of
-its command-line options, and how it finds `awk' program source files.
+ - *note Invoking Gawk::, describes how to run `gawk', the
+ meaning of its command-line options, and how it finds `awk'
+ program source files.
- *note Regexp::, introduces regular expressions in general, and in
-particular the flavors supported by POSIX `awk' and `gawk'.
+ - *note Regexp::, introduces regular expressions in general,
+ and in particular the flavors supported by POSIX `awk' and
+ `gawk'.
- *note Reading Files::, describes how `awk' reads your data. It
-introduces the concepts of records and fields, as well as the `getline'
-command. I/O redirection is first described here. Network I/O is also
-briefly introduced here.
+ - *note Reading Files::, describes how `awk' reads your data.
+ It introduces the concepts of records and fields, as well as
+ the `getline' command. I/O redirection is first described
+ here. Network I/O is also briefly introduced here.
- *note Printing::, describes how `awk' programs can produce output
-with `print' and `printf'.
+ - *note Printing::, describes how `awk' programs can produce
+ output with `print' and `printf'.
- *note Expressions::, describes expressions, which are the basic
-building blocks for getting most things done in a program.
+ - *note Expressions::, describes expressions, which are the
+ basic building blocks for getting most things done in a
+ program.
- *note Patterns and Actions::, describes how to write patterns for
-matching records, actions for doing something when a record is matched,
-and the predefined variables `awk' and `gawk' use.
+ - *note Patterns and Actions::, describes how to write patterns
+ for matching records, actions for doing something when a
+ record is matched, and the predefined variables `awk' and
+ `gawk' use.
- *note Arrays::, covers `awk''s one-and-only data structure:
-associative arrays. Deleting array elements and whole arrays is also
-described, as well as sorting arrays in `gawk'. It also describes how
-`gawk' provides arrays of arrays.
+ - *note Arrays::, covers `awk''s one-and-only data structure:
+ associative arrays. Deleting array elements and whole arrays
+ is also described, as well as sorting arrays in `gawk'. It
+ also describes how `gawk' provides arrays of arrays.
- *note Functions::, describes the built-in functions `awk' and `gawk'
-provide, as well as how to define your own functions. It also
-discusses how `gawk' lets you call functions indirectly.
+ - *note Functions::, describes the built-in functions `awk' and
+ `gawk' provide, as well as how to define your own functions.
+ It also discusses how `gawk' lets you call functions
+ indirectly.
- Part II shows how to use `awk' and `gawk' for problem solving.
-There is lots of code here for you to read and learn from. It contains
-the following chapters:
+ * Part II shows how to use `awk' and `gawk' for problem solving.
+ There is lots of code here for you to read and learn from. It
+ contains the following chapters:
- *note Library Functions::, which provides a number of functions
-meant to be used from main `awk' programs.
+ - *note Library Functions::, which provides a number of
+ functions meant to be used from main `awk' programs.
- *note Sample Programs::, which provides many sample `awk' programs.
+ - *note Sample Programs::, which provides many sample `awk'
+ programs.
- Reading these two chapters allows you to see `awk' solving real
-problems.
+ Reading these two chapters allows you to see `awk' solving real
+ problems.
- Part III focuses on features specific to `gawk'. It contains the
-following chapters:
+ * Part III focuses on features specific to `gawk'. It contains the
+ following chapters:
- *note Advanced Features::, describes a number of advanced features.
-Of particular note are the abilities to control the order of array
-traversal, have two-way communications with another process, perform
-TCP/IP networking, and profile your `awk' programs.
+ - *note Advanced Features::, describes a number of advanced
+ features. Of particular note are the abilities to control
+ the order of array traversal, have two-way communications
+ with another process, perform TCP/IP networking, and profile
+ your `awk' programs.
- *note Internationalization::, describes special features for
-translating program messages into different languages at runtime.
+ - *note Internationalization::, describes special features for
+ translating program messages into different languages at
+ runtime.
- *note Debugger::, describes the `gawk' debugger.
+ - *note Debugger::, describes the `gawk' debugger.
- *note Arbitrary Precision Arithmetic::, describes advanced
-arithmetic facilities.
+ - *note Arbitrary Precision Arithmetic::, describes advanced
+ arithmetic facilities.
- *note Dynamic Extensions::, describes how to add new variables and
-functions to `gawk' by writing extensions in C or C++.
+ - *note Dynamic Extensions::, describes how to add new
+ variables and functions to `gawk' by writing extensions in C
+ or C++.
- Part IV provides the appendices, the Glossary, and two licenses that
-cover the `gawk' source code and this Info file, respectively. It
-contains the following appendices:
+ * Part IV provides the appendices, the Glossary, and two licenses
+ that cover the `gawk' source code and this Info file, respectively.
+ It contains the following appendices:
- *note Language History::, describes how the `awk' language has
-evolved since its first release to present. It also describes how
-`gawk' has acquired features over time.
+ - *note Language History::, describes how the `awk' language
+ has evolved since its first release to present. It also
+ describes how `gawk' has acquired features over time.
- *note Installation::, describes how to get `gawk', how to compile it
-on POSIX-compatible systems, and how to compile and use it on different
-non-POSIX systems. It also describes how to report bugs in `gawk' and
-where to get other freely available `awk' implementations.
+ - *note Installation::, describes how to get `gawk', how to
+ compile it on POSIX-compatible systems, and how to compile
+ and use it on different non-POSIX systems. It also describes
+ how to report bugs in `gawk' and where to get other freely
+ available `awk' implementations.
- *note Notes::, describes how to disable `gawk''s extensions, as well
-as how to contribute new code to `gawk', and some possible future
-directions for `gawk' development.
+ - *note Notes::, describes how to disable `gawk''s extensions,
+ as well as how to contribute new code to `gawk', and some
+ possible future directions for `gawk' development.
- *note Basic Concepts::, provides some very cursory background
-material for those who are completely unfamiliar with computer
-programming.
+ - *note Basic Concepts::, provides some very cursory background
+ material for those who are completely unfamiliar with
+ computer programming.
- The *note Glossary::, defines most, if not all, the significant
-terms used throughout the Info file. If you find terms that you aren't
-familiar with, try looking them up here.
+ The *note Glossary::, defines most, if not all of, the
+ significant terms used throughout the Info file. If you find
+ terms that you aren't familiar with, try looking them up here.
- *note Copying::, and *note GNU Free Documentation License::, present
-the licenses that cover the `gawk' source code and this Info file,
-respectively.
+ - *note Copying::, and *note GNU Free Documentation License::,
+ present the licenses that cover the `gawk' source code and
+ this Info file, respectively.
---------- Footnotes ----------
@@ -1149,7 +1160,7 @@ Versions::, for information on his and other versions.)
Dark Corners
------------
- Dark corners are basically fractal -- no matter how much you
+ Dark corners are basically fractal--no matter how much you
illuminate, there's always a smaller but darker one. -- Brian
Kernighan
@@ -1185,7 +1196,7 @@ always available to the end user. A copy of the GPL is included for
your reference (*note Copying::). The GPL applies to the C language
source code for `gawk'. To find out more about the FSF and the GNU
Project online, see the GNU Project's home page (http://www.gnu.org).
-This Info file may also be read from their web site
+This Info file may also be read from GNU's website
(http://www.gnu.org/software/gawk/manual/).
A shell, an editor (Emacs), highly portable optimizing C, C++, and
@@ -1202,9 +1213,9 @@ from the Internet.
The Info file itself has gone through multiple previous editions.
Paul Rubin wrote the very first draft of `The GAWK Manual'; it was
-around 40 pages in size. Diane Close and Richard Stallman improved it,
-yielding a version that was around 90 pages long and barely described
-the original, "old" version of `awk'.
+around 40 pages long. Diane Close and Richard Stallman improved it,
+yielding a version that was around 90 pages and barely described the
+original, "old" version of `awk'.
I started working with that version in the fall of 1988. As work on
it progressed, the FSF published several preliminary versions (numbered
@@ -1251,12 +1262,12 @@ contributed code: the archive did not grow and the domain went unused
for several years.
Late in 2008, a volunteer took on the task of setting up an
-`awk'-related web site--`http://awk.info'--and did a very nice job.
+`awk'-related website--`http://awk.info'--and did a very nice job.
If you have written an interesting `awk' program, or have written a
`gawk' extension that you would like to share with the rest of the
world, please see `http://awk.info/?contribute' for how to contribute
-it to the web site.
+it to the website.

File: gawk.info, Node: Acknowledgments, Prev: How To Contribute, Up: Preface
@@ -1336,7 +1347,7 @@ of people. *Note Contributors::, for the full list.
Karl Berry who continues to work to keep the Texinfo markup language
sane.
- Robert P.J. Day, Michael Brennan and Brian Kernighan kindly acted as
+ Robert P.J. Day, Michael Brennan, and Brian Kernighan kindly acted as
reviewers for the 2015 edition of this Info file. Their feedback helped
improve the final work.
@@ -1347,8 +1358,8 @@ have done nearly as good a job on either `gawk' or its documentation
without his help.
Brian is in a class by himself as a programmer and technical author.
-I have to thank him (yet again) for his ongoing friendship and the role
-model he has been for me for close to 30 years! Having him as a
+I have to thank him (yet again) for his ongoing friendship and for
+being a role model to me for close to 30 years! Having him as a
reviewer is an exciting privilege. It has also been extremely
humbling...
@@ -1369,22 +1380,22 @@ File: gawk.info, Node: Getting Started, Next: Invoking Gawk, Prev: Preface,
The basic function of `awk' is to search files for lines (or other
units of text) that contain certain patterns. When a line matches one
of the patterns, `awk' performs specified actions on that line. `awk'
-keeps processing input lines in this way until it reaches the end of
-the input files.
+continues to process input lines in this way until it reaches the end
+of the input files.
Programs in `awk' are different from programs in most other
-languages, because `awk' programs are "data-driven"; that is, you
-describe the data you want to work with and then what to do when you
-find it. Most other languages are "procedural"; you have to describe,
-in great detail, every step the program is to take. When working with
+languages, because `awk' programs are "data driven" (i.e., you describe
+the data you want to work with and then what to do when you find it).
+Most other languages are "procedural"; you have to describe, in great
+detail, every step the program should take. When working with
procedural languages, it is usually much harder to clearly describe the
data your program will process. For this reason, `awk' programs are
often refreshingly easy to read and write.
When you run `awk', you specify an `awk' "program" that tells `awk'
-what to do. The program consists of a series of "rules". (It may also
+what to do. The program consists of a series of "rules" (it may also
contain "function definitions", an advanced feature that we will ignore
-for now. *Note User-defined::.) Each rule specifies one pattern to
+for now; *note User-defined::). Each rule specifies one pattern to
search for and one action to perform upon finding the pattern.
Syntactically, a rule consists of a pattern followed by an action.
@@ -1473,7 +1484,8 @@ programs from shell scripts, because it avoids the need for a separate
file for the `awk' program. A self-contained shell script is more
reliable because there are no other files to misplace.
- *note Very Simple::, presents several short, self-contained programs.
+ Later in this chapter, *note Very Simple::, presents several short,
+self-contained programs.

File: gawk.info, Node: Read Terminal, Next: Long, Prev: One-shot, Up: Running gawk
@@ -1515,7 +1527,7 @@ ugly shell quoting tricks.
This next simple `awk' program emulates the `cat' utility; it copies
whatever you type on the keyboard to its standard output (why this
-works is explained shortly).
+works is explained shortly):
$ awk '{ print }'
Now is the time for all good men
@@ -1607,7 +1619,7 @@ the instructions in your program. (This is different from a "compiled"
language such as C, where your program is first compiled into machine
code that is executed directly by your system's processor.) The `awk'
utility is thus termed an "interpreter". Many modern languages are
-interperted.
+interpreted.
The line beginning with `#!' lists the full file name of an
interpreter to run and a single optional initial command-line argument
@@ -1635,8 +1647,8 @@ the name of your script (`advice'). (d.c.) Don't rely on the value of
---------- Footnotes ----------
- (1) The `#!' mechanism works on GNU/Linux systems, BSD-based systems
-and commercial Unix systems.
+ (1) The `#!' mechanism works on GNU/Linux systems, BSD-based
+systems, and commercial Unix systems.

File: gawk.info, Node: Comments, Next: Quoting, Prev: Executable Scripts, Up: Running gawk
@@ -1650,13 +1662,13 @@ Comments can explain what the program does and how it works. Nearly all
programming languages have provisions for comments, as programs are
typically hard to understand without them.
- In the `awk' language, a comment starts with the sharp sign
+ In the `awk' language, a comment starts with the number sign
character (`#') and continues to the end of the line. The `#' does not
have to be the first character on the line. The `awk' language ignores
-the rest of a line following a sharp sign. For example, we could have
+the rest of a line following a number sign. For example, we could have
put the following into `advice':
- # This program prints a nice friendly message. It helps
+ # This program prints a nice, friendly message. It helps
# keep novice users from being afraid of the computer.
BEGIN { print "Don't Panic!" }
@@ -1665,15 +1677,15 @@ programs, but this usually isn't very useful; the purpose of a comment
is to help you or another person understand the program when reading it
at a later time.
- CAUTION: As mentioned in *note One-shot::, you can enclose small
- to medium programs in single quotes, in order to keep your shell
- scripts self-contained. When doing so, _don't_ put an apostrophe
- (i.e., a single quote) into a comment (or anywhere else in your
- program). The shell interprets the quote as the closing quote for
- the entire program. As a result, usually the shell prints a
- message about mismatched quotes, and if `awk' actually runs, it
- will probably print strange messages about syntax errors. For
- example, look at the following:
+ CAUTION: As mentioned in *note One-shot::, you can enclose short
+ to medium-sized programs in single quotes, in order to keep your
+ shell scripts self-contained. When doing so, _don't_ put an
+ apostrophe (i.e., a single quote) into a comment (or anywhere else
+ in your program). The shell interprets the quote as the closing
+ quote for the entire program. As a result, usually the shell
+ prints a message about mismatched quotes, and if `awk' actually
+ runs, it will probably print strange messages about syntax errors.
+ For example, look at the following:
$ awk 'BEGIN { print "hello" } # let's be cute'
>
@@ -1689,8 +1701,8 @@ at a later time.
error--> source line number 1
Putting a backslash before the single quote in `let's' wouldn't
- help, since backslashes are not special inside single quotes. The
- next node describes the shell's quoting rules.
+ help, because backslashes are not special inside single quotes.
+ The next node describes the shell's quoting rules.

File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk
@@ -1702,7 +1714,7 @@ File: gawk.info, Node: Quoting, Prev: Comments, Up: Running gawk
* DOS Quoting:: Quoting in Windows Batch Files.
- For short to medium length `awk' programs, it is most convenient to
+ For short to medium-length `awk' programs, it is most convenient to
enter the program on the `awk' command line. This is best done by
enclosing the entire program in single quotes. This is true whether
you are entering the program interactively at the shell prompt, or
@@ -1722,15 +1734,15 @@ string.
The null string is character data that has no value. In other
words, it is empty. It is written in `awk' programs like this: `""'.
In the shell, it can be written using single or double quotes: `""' or
-`'''. While the null string has no characters in it, it does exist.
-Consider this command:
+`'''. Although the null string has no characters in it, it does exist.
+For example, consider this command:
$ echo ""
Here, the `echo' utility receives a single argument, even though that
argument has no characters in it. In the rest of this Info file, we use
the terms "null string" and "empty string" interchangeably. Now, on to
-the quoting rules.
+the quoting rules:
* Quoted items can be concatenated with nonquoted items as well as
with other quoted items. The shell turns everything into one
@@ -1751,7 +1763,7 @@ the quoting rules.
on the quoted text. Different shells may do additional kinds of
processing on double-quoted text.
- Since certain characters within double-quoted text are processed
+ Because certain characters within double-quoted text are processed
by the shell, they must be "escaped" within the text. Of note are
the characters `$', ``', `\', and `"', all of which must be
preceded by a backslash within double-quoted text if they are to
@@ -1790,7 +1802,7 @@ shell quoting tricks, like this:
-| Here is a single quote <'>
This program consists of three concatenated quoted strings. The first
-and the third are single-quoted, the second is double-quoted.
+and the third are single quoted, the second is double quoted.
This can be "simplified" to:
@@ -1865,7 +1877,7 @@ about monthly shipments. In both files, each line is considered to be
one "record".
In `mail-list', each record contains the name of a person, his/her
-phone number, his/her email-address, and a code for their relationship
+phone number, his/her email address, and a code for his/her relationship
with the author of the list. The columns are aligned using spaces. An
`A' in the last column means that the person is an acquaintance. An
`F' in the last column means that the person is a friend. An `R' means
@@ -1961,13 +1973,13 @@ that does nothing (i.e., no lines are printed).
collection of useful, short programs to get you started. Some of these
programs contain constructs that haven't been covered yet. (The
description of the program will give you a good idea of what is going
-on, but please read the rest of the Info file to become an `awk'
-expert!) Most of the examples use a data file named `data'. This is
-just a placeholder; if you use these programs yourself, substitute your
-own file names for `data'. For future reference, note that there is
-often more than one way to do things in `awk'. At some point, you may
-want to look back at these examples and see if you can come up with
-different ways to do the same things shown here:
+on, but you'll need to read the rest of the Info file to become an
+`awk' expert!) Most of the examples use a data file named `data'.
+This is just a placeholder; if you use these programs yourself,
+substitute your own file names for `data'. For future reference, note
+that there is often more than one way to do things in `awk'. At some
+point, you may want to look back at these examples and see if you can
+come up with different ways to do the same things shown here:
* Print every line that is longer than 80 characters:
@@ -1989,7 +2001,7 @@ different ways to do the same things shown here:
expand data | awk '{ if (x < length($0)) x = length($0) }
END { print "maximum line length is " x }'
- This example differs slightly from the previous one: The input is
+ This example differs slightly from the previous one: the input is
processed by the `expand' utility to change TABs into spaces, so
the widths compared are actually the right-margin columns, as
opposed to the number of input characters on each line.
@@ -2183,10 +2195,10 @@ or a string.
the C shell._ It works for `awk' programs in files and for
one-shot programs, _provided_ you are using a POSIX-compliant
shell, such as the Unix Bourne shell or Bash. But the C shell
- behaves differently! There, you must use two backslashes in a
- row, followed by a newline. Note also that when using the C
- shell, _every_ newline in your `awk' program must be escaped with
- a backslash. To illustrate:
+ behaves differently! There you must use two backslashes in a row,
+ followed by a newline. Note also that when using the C shell,
+ _every_ newline in your `awk' program must be escaped with a
+ backslash. To illustrate:
% awk 'BEGIN { \
? print \\
@@ -2291,8 +2303,8 @@ edit-compile-test-debug cycle of software development.
Complex programs have been written in `awk', including a complete
retargetable assembler for eight-bit microprocessors (*note Glossary::,
for more information), and a microcode assembler for a special-purpose
-Prolog computer. While the original `awk''s capabilities were strained
-by tasks of such complexity, modern versions are more capable.
+Prolog computer. The original `awk''s capabilities were strained by
+tasks of such complexity, but modern versions are more capable.
If you find yourself writing `awk' scripts of more than, say, a few
hundred lines, you might consider using a different programming
@@ -2340,10 +2352,10 @@ File: gawk.info, Node: Invoking Gawk, Next: Regexp, Prev: Getting Started, U
This major node covers how to run `awk', both POSIX-standard and
`gawk'-specific command-line options, and what `awk' and `gawk' do with
-non-option arguments. It then proceeds to cover how `gawk' searches
-for source files, reading standard input along with other files,
-`gawk''s environment variables, `gawk''s exit status, using include
-files, and obsolete and undocumented options and/or features.
+nonoption arguments. It then proceeds to cover how `gawk' searches for
+source files, reading standard input along with other files, `gawk''s
+environment variables, `gawk''s exit status, using include files, and
+obsolete and undocumented options and/or features.
Many of the options and features described here are discussed in
more detail later in the Info file; feel free to skip over things in
@@ -2377,8 +2389,8 @@ enclosed in [...] in these templates are optional:
`awk' [OPTIONS] `-f' PROGFILE [`--'] FILE ...
`awk' [OPTIONS] [`--'] `'PROGRAM'' FILE ...
- Besides traditional one-letter POSIX-style options, `gawk' also
-supports GNU long options.
+ In addition to traditional one-letter POSIX-style options, `gawk'
+also supports GNU long options.
It is possible to invoke `awk' with an empty program:
@@ -2414,7 +2426,7 @@ The following list describes options mandated by the POSIX standard:
`-f SOURCE-FILE'
`--file SOURCE-FILE'
Read `awk' program source from SOURCE-FILE instead of in the first
- non-option argument. This option may be given multiple times; the
+ nonoption argument. This option may be given multiple times; the
`awk' program consists of the concatenation of the contents of
each specified SOURCE-FILE.
@@ -2593,7 +2605,7 @@ The following list describes options mandated by the POSIX standard:
`-M'
`--bignum'
- Force arbitrary precision arithmetic on numbers. This option has
+ Force arbitrary-precision arithmetic on numbers. This option has
no effect if `gawk' is not compiled to use the GNU MPFR and MP
libraries (*note Arbitrary Precision Arithmetic::).
@@ -2603,9 +2615,8 @@ The following list describes options mandated by the POSIX standard:
input data (*note Nondecimal Data::).
CAUTION: This option can severely break old programs. Use
- with care.
-
- This option may disappear in a future version of `gawk'.
+ with care. Also note that this option may disappear in a
+ future version of `gawk'.
`-N'
`--use-lc-numeric'
@@ -2628,7 +2639,8 @@ The following list describes options mandated by the POSIX standard:
`-O'
`--optimize'
Enable some optimizations on the internal representation of the
- program. At the moment this includes just simple constant folding.
+ program. At the moment, this includes just simple constant
+ folding.
`-p'[FILE]
`--profile'[`='FILE]
@@ -2671,8 +2683,8 @@ The following list describes options mandated by the POSIX standard:
`--re-interval'
Allow interval expressions (*note Regexp Operators::) in regexps.
This is now `gawk''s default behavior. Nevertheless, this option
- remains both for backward compatibility, and for use in
- combination with `--traditional'.
+ remains (both for backward compatibility and for use in
+ combination with `--traditional').
`-S'
`--sandbox'
@@ -2708,7 +2720,7 @@ it is, `awk' reads its program source from all of the named files, as
if they had been concatenated together into one big file. This is
useful for creating libraries of `awk' functions. These functions can
be written once and then retrieved from a standard place, instead of
-having to be included into each individual program. The `-i' option is
+having to be included in each individual program. The `-i' option is
similar in this regard. (As mentioned in *note Definition Syntax::,
function names must be unique.)
@@ -2716,7 +2728,7 @@ function names must be unique.)
the program is entered at the keyboard, by specifying `-f /dev/tty'.
After typing your program, type `Ctrl-d' (the end-of-file character) to
terminate it. (You may also use `-f -' to read program source from the
-standard input but then you will not be able to also use the standard
+standard input, but then you will not be able to also use the standard
input as a source of data.)
Because it is clumsy using the standard `awk' mechanisms to mix
@@ -2727,7 +2739,7 @@ source code (*note AWKPATH Variable::). As with `-f', the `-e' and `-i'
options may also be used multiple times on the command line.
If no `-f' or `-e' option is specified, then `gawk' uses the first
-non-option command-line argument as the text of the program source code.
+nonoption command-line argument as the text of the program source code.
If the environment variable `POSIXLY_CORRECT' exists, then `gawk'
behaves in strict POSIX mode, exactly as if you had supplied `--posix'.
@@ -2776,8 +2788,8 @@ not a file name:
program in the `ARGV' array (*note Built-in Variables::). Command-line
options and the program text (if present) are omitted from `ARGV'. All
other arguments, including variable assignments, are included. As
-each element of `ARGV' is processed, `gawk' sets the variable `ARGIND'
-to the index in `ARGV' of the current element.
+each element of `ARGV' is processed, `gawk' sets `ARGIND' to the index
+in `ARGV' of the current element.
Changing `ARGC' and `ARGV' in your `awk' program lets you control
how `awk' processes the input files; this is described in more detail
@@ -2921,11 +2933,11 @@ this means that you will rarely need to change the value of `AWKPATH'.
`ENVIRON["AWKPATH"]'. This provides access to the actual search path
value from within an `awk' program.
- While you can change `ENVIRON["AWKPATH"]' within your `awk' program,
-this has no effect on the running program's behavior. This makes
-sense: the `AWKPATH' environment variable is used to find the program
-source files. Once your program is running, all the files have been
-found, and `gawk' no longer needs to use `AWKPATH'.
+ Although you can change `ENVIRON["AWKPATH"]' within your `awk'
+program, this has no effect on the running program's behavior. This
+makes sense: the `AWKPATH' environment variable is used to find the
+program source files. Once your program is running, all the files have
+been found, and `gawk' no longer needs to use `AWKPATH'.
---------- Footnotes ----------
@@ -2968,7 +2980,7 @@ File: gawk.info, Node: Other Environment Variables, Prev: AWKLIBPATH Variable,
A number of other environment variables affect `gawk''s behavior, but
they are more specialized. Those in the following list are meant to be
-used by regular users.
+used by regular users:
`GAWK_MSEC_SLEEP'
Specifies the interval between connection retries, in
@@ -2985,7 +2997,7 @@ used by regular users.
Networking::.
`POSIXLY_CORRECT'
- Causes `gawk' to switch to POSIX compatibility mode, disabling all
+ Causes `gawk' to switch to POSIX-compatibility mode, disabling all
traditional and GNU extensions. *Note Options::.
The environment variables in the following list are meant for use by
@@ -3016,8 +3028,8 @@ change. The variables are:
If this variable exists, `gawk' includes the file name and line
number within the `gawk' source code from which warning and/or
fatal messages are generated. Its purpose is to help isolate the
- source of a message, since there are multiple places which produce
- the same warning or error message.
+ source of a message, as there are multiple places which produce the
+ same warning or error message.
`GAWK_NO_DFA'
If this variable exists, `gawk' does not use the DFA regexp matcher
@@ -3028,8 +3040,8 @@ change. The variables are:
don't coordinate with each other.)
`GAWK_NO_PP_RUN'
- If this variable exists, then when invoked with the
- `--pretty-print' option, `gawk' skips running the program.
+ When `gawk' is invoked with the `--pretty-print' option, it will
+ not run the program if this environment variable exists.
CAUTION: This variable will not survive into the next major
release.
@@ -3065,13 +3077,13 @@ with the value of the C constant `EXIT_SUCCESS'. This is usually zero.
If an error occurs, `gawk' exits with the value of the C constant
`EXIT_FAILURE'. This is usually one.
- If `gawk' exits because of a fatal error, the exit status is 2. On
-non-POSIX systems, this value may be mapped to `EXIT_FAILURE'.
+ If `gawk' exits because of a fatal error, the exit status is two.
+On non-POSIX systems, this value may be mapped to `EXIT_FAILURE'.

File: gawk.info, Node: Include Files, Next: Loading Shared Libraries, Prev: Exit Status, Up: Invoking Gawk
-2.7 Including Other Files Into Your Program
+2.7 Including Other Files into Your Program
===========================================
This minor node describes a feature that is specific to `gawk'.
@@ -3106,9 +3118,9 @@ and here is `test2':
-| This is script test1.
-| This is script test2.
- `gawk' runs the `test2' script which includes `test1' using the
-`@include' keyword. So, to include external `awk' source files you just
-use `@include' followed by the name of the file to be included,
+ `gawk' runs the `test2' script, which includes `test1' using the
+`@include' keyword. So, to include external `awk' source files, you
+just use `@include' followed by the name of the file to be included,
enclosed in double quotes.
NOTE: Keep in mind that this is a language construct and the file
@@ -3134,22 +3146,22 @@ Running `gawk' with the `test3' script produces the following results:
@include "../io_funcs"
-or:
+and:
@include "/usr/awklib/network"
-are valid. The `AWKPATH' environment variable can be of great value
-when using `@include'. The same rules for the use of the `AWKPATH'
-variable in command-line file searches (*note AWKPATH Variable::) apply
-to `@include' also.
+are both valid. The `AWKPATH' environment variable can be of great
+value when using `@include'. The same rules for the use of the
+`AWKPATH' variable in command-line file searches (*note AWKPATH
+Variable::) apply to `@include' also.
This is very helpful in constructing `gawk' function libraries. If
-you have a large script with useful, general purpose `awk' functions,
+you have a large script with useful, general-purpose `awk' functions,
you can break it down into library files and put those files in a
special directory. You can then include those "libraries," using
either the full pathnames of the files, or by setting the `AWKPATH'
environment variable accordingly and then using `@include' with just
-the file part of the full pathname. Of course you can have more than
+the file part of the full pathname. Of course, you can have more than
one directory to keep library files; the more complex the working
environment is, the more directories you may need to organize the files
to be included.
@@ -3168,7 +3180,7 @@ and this also applies to files named with `@include'.

File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev: Include Files, Up: Invoking Gawk
-2.8 Loading Dynamic Extensions Into Your Program
+2.8 Loading Dynamic Extensions into Your Program
================================================
This minor node describes a feature that is specific to `gawk'.
@@ -3183,7 +3195,7 @@ The `AWKLIBPATH' variable is used to search for the extension. Using
If the extension is not initially found in `AWKLIBPATH', another
search is conducted after appending the platform's default shared
library suffix to the file name. For example, on GNU/Linux systems,
-the suffix `.so' is used.
+the suffix `.so' is used:
$ gawk '@load "ordchr"; BEGIN {print chr(65)}'
-| A
@@ -3240,12 +3252,12 @@ File: gawk.info, Node: Invoking Summary, Prev: Undocumented, Up: Invoking Gaw
`-F' and `-v'. `gawk' supplies these and many others, as well as
corresponding GNU-style long options.
- * Non-option command-line arguments are usually treated as file
- names, unless they have the form `VAR=VALUE', in which case they
- are taken as variable assignments to be performed at that point in
+ * Nonoption command-line arguments are usually treated as file names,
+ unless they have the form `VAR=VALUE', in which case they are
+ taken as variable assignments to be performed at that point in
processing the input.
- * All non-option command-line arguments, excluding the program text,
+ * All nonoption command-line arguments, excluding the program text,
are placed in the `ARGV' array. Adjusting `ARGC' and `ARGV'
affects how `awk' processes input.
@@ -3284,7 +3296,7 @@ strings. Because regular expressions are such a fundamental part of
that matches every input record whose text belongs to that set. The
simplest regular expression is a sequence of letters, numbers, or both.
Such a regexp matches any string that contains that sequence. Thus,
-the regexp `foo' matches any string containing `foo'. Therefore, the
+the regexp `foo' matches any string containing `foo'. Thus, the
pattern `/foo/' matches any input record containing the three adjacent
characters `foo' _anywhere_ in the record. Other kinds of regexps let
you specify more complicated classes of strings.
@@ -3325,13 +3337,13 @@ expressions allow you to specify the string to match against; it need
not be the entire current input record. The two operators `~' and `!~'
perform regular expression comparisons. Expressions using these
operators can be used as patterns, or in `if', `while', `for', and `do'
-statements. (*Note Statements::.) For example:
+statements. (*Note Statements::.) For example, the following is true
+if the expression EXP (taken as a string) matches REGEXP:
EXP ~ /REGEXP/
-is true if the expression EXP (taken as a string) matches REGEXP. The
-following example matches, or selects, all input records with the
-uppercase letter `J' somewhere in the first field:
+This example matches, or selects, all input records with the uppercase
+letter `J' somewhere in the first field:
$ awk '$1 ~ /J/' inventory-shipped
-| Jan 13 25 15 115
@@ -3385,9 +3397,9 @@ string or regexp. Thus, the string whose contents are the two
characters `"' and `\' must be written `"\"\\"'.
Other escape sequences represent unprintable characters such as TAB
-or newline. While there is nothing to stop you from entering most
+or newline. There is nothing to stop you from entering most
unprintable characters directly in a string constant or regexp constant,
-they may look ugly.
+but they may look ugly.
The following list presents all the escape sequences used in `awk'
and what they represent. Unless noted otherwise, all these escape
@@ -3431,7 +3443,7 @@ sequences apply to both string constants and regexp constants:
more than two hexadecimal digits produces undefined results. (The
`\x' escape sequence is not allowed in POSIX `awk'.)
- CAUTION: The next major relase of `gawk' will change, such
+ CAUTION: The next major release of `gawk' will change, such
that a maximum of two hexadecimal digits following the `\x'
will be used.
@@ -3439,7 +3451,7 @@ sequences apply to both string constants and regexp constants:
A literal slash (necessary for regexp constants only). This
sequence is used when you want to write a regexp constant that
contains a slash (such as `/.*:\/home\/[[:alnum:]]+:.*/'; the
- `[[:alnum:]]' notation is discussed shortly, in *note Bracket
+ `[[:alnum:]]' notation is discussed in *note Bracket
Expressions::). Because the regexp is delimited by slashes, you
need to escape any slash that is part of the pattern, in order to
tell `awk' to keep processing the rest of the regexp.
@@ -3465,19 +3477,6 @@ characters `a+b'.
For complete portability, do not use a backslash before any
character not shown in the previous list and that is not an operator.
- To summarize:
-
- * The escape sequences in the list above are always processed first,
- for both string constants and regexp constants. This happens very
- early, as soon as `awk' reads your program.
-
- * `gawk' processes both regexp constants and dynamic regexps (*note
- Computed Regexps::), for the special operators listed in *note GNU
- Regexp Operators::.
-
- * A backslash before any other character means to treat that
- character literally.
-
Backslash Before Regular Characters
If you place a backslash in a string constant before something that
@@ -3496,6 +3495,19 @@ Leave the backslash alone
Some other `awk' implementations do this. In such
implementations, typing `"a\qc"' is the same as typing `"a\\qc"'.
+ To summarize:
+
+ * The escape sequences in the preceding list are always processed
+ first, for both string constants and regexp constants. This
+ happens very early, as soon as `awk' reads your program.
+
+ * `gawk' processes both regexp constants and dynamic regexps (*note
+ Computed Regexps::), for the special operators listed in *note GNU
+ Regexp Operators::.
+
+ * A backslash before any other character means to treat that
+ character literally.
+
Escape Sequences for Metacharacters
Suppose you use an octal or hexadecimal escape to represent a regexp
@@ -3528,15 +3540,15 @@ in processing regexps.
sequences and that are not listed in the following stand for themselves:
`\'
- This is used to suppress the special meaning of a character when
- matching. For example, `\$' matches the character `$'.
+ This suppresses the special meaning of a character when matching.
+ For example, `\$' matches the character `$'.
`^'
- This matches the beginning of a string. For example, `^@chapter'
- matches `@chapter' at the beginning of a string and can be used to
- identify chapter beginnings in Texinfo source files. The `^' is
- known as an "anchor", because it anchors the pattern to match only
- at the beginning of the string.
+ This matches the beginning of a string. `^@chapter' matches
+ `@chapter' at the beginning of a string, for example, and can be
+ used to identify chapter beginnings in Texinfo source files. The
+ `^' is known as an "anchor", because it anchors the pattern to
+ match only at the beginning of the string.
It is important to realize that `^' does not match the beginning of
a line (the point right after a `\n' newline character) embedded
@@ -3609,7 +3621,7 @@ sequences and that are not listed in the following stand for themselves:
First, the `*' applies only to the single preceding regular
expression component (e.g., in `ph*', it applies just to the `h').
To cause `*' to apply to a larger sub-expression, use parentheses:
- `(ph)*' matches `ph', `phph', `phphph' and so on.
+ `(ph)*' matches `ph', `phph', `phphph', and so on.
Second, `*' finds as many repetitions as possible. If the text to
be matched is `phhhhhhhhhhhhhhooey', `ph*' matches all of the `h's.
@@ -3693,7 +3705,7 @@ File: gawk.info, Node: Bracket Expressions, Next: Leftmost Longest, Prev: Reg
3.4 Using Bracket Expressions
=============================
-As mentioned earlier, a bracket expression matches any character amongst
+As mentioned earlier, a bracket expression matches any character among
those listed between the opening and closing square brackets.
Within a bracket expression, a "range expression" consists of two
@@ -3733,24 +3745,24 @@ character classes defined by the POSIX standard.
Class Meaning
--------------------------------------------------------------------------
-`[:alnum:]' Alphanumeric characters.
-`[:alpha:]' Alphabetic characters.
-`[:blank:]' Space and TAB characters.
-`[:cntrl:]' Control characters.
-`[:digit:]' Numeric characters.
-`[:graph:]' Characters that are both printable and visible. (A space is
- printable but not visible, whereas an `a' is both.)
-`[:lower:]' Lowercase alphabetic characters.
+`[:alnum:]' Alphanumeric characters
+`[:alpha:]' Alphabetic characters
+`[:blank:]' Space and TAB characters
+`[:cntrl:]' Control characters
+`[:digit:]' Numeric characters
+`[:graph:]' Characters that are both printable and visible (a space is
+ printable but not visible, whereas an `a' is both)
+`[:lower:]' Lowercase alphabetic characters
`[:print:]' Printable characters (characters that are not control
- characters).
+ characters)
`[:punct:]' Punctuation characters (characters that are not letters,
- digits, control characters, or space characters).
+ digits control characters, or space characters)
`[:space:]' Space characters (such as space, TAB, and formfeed, to name
- a few).
-`[:upper:]' Uppercase alphabetic characters.
-`[:xdigit:]'Characters that are hexadecimal digits.
+ a few)
+`[:upper:]' Uppercase alphabetic characters
+`[:xdigit:]'Characters that are hexadecimal digits
-Table 3.1: POSIX Character Classes
+Table 3.1: POSIX character classes
For example, before the POSIX standard, you had to write
`/[A-Za-z0-9]/' to match alphanumeric characters. If your character
@@ -3758,7 +3770,7 @@ set had other alphabetic characters in it, this would not match them.
With the POSIX character classes, you can write `/[[:alnum:]]/' to
match the alphabetic and numeric characters in your character set.
- Some utilities that match regular expressions provide a non-standard
+ Some utilities that match regular expressions provide a nonstandard
`[:ascii:]' character class; `awk' does not. However, you can simulate
such a construct using `[\x00-\x7F]'. This matches all values
numerically between zero and 127, which is the defined range of the
@@ -3951,9 +3963,9 @@ letters, digits, or underscores (`_'):
not match `dirty rat'. `\B' is essentially the opposite of `\y'.
There are two other operators that work on buffers. In Emacs, a
-"buffer" is, naturally, an Emacs buffer. For other programs, `gawk''s
-regexp library routines consider the entire string to match as the
-buffer. The operators are:
+"buffer" is, naturally, an Emacs buffer. Other GNU programs, including
+`gawk', consider the entire string to match as the buffer. The
+operators are:
`\`'
Matches the empty string at the beginning of a buffer (string).
@@ -3981,15 +3993,14 @@ No options
Operators::.
`--posix'
- Only POSIX regexps are supported; the GNU operators are not special
- (e.g., `\w' matches a literal `w'). Interval expressions are
- allowed.
+ Match only POSIX regexps; the GNU operators are not special (e.g.,
+ `\w' matches a literal `w'). Interval expressions are allowed.
`--traditional'
- Traditional Unix `awk' regexps are matched. The GNU operators are
- not special, and interval expressions are not available. The
- POSIX character classes (`[[:alnum:]]', etc.) are supported, as
- BWK `awk' supports them. Characters described by octal and
+ Match traditional Unix `awk' regexps. The GNU operators are not
+ special, and interval expressions are not available. Because BWK
+ `awk' supports them, the POSIX character classes (`[[:alnum:]]',
+ etc.) are available. Characters described by octal and
hexadecimal escape sequences are treated literally, even if they
represent regexp metacharacters.
@@ -4029,10 +4040,9 @@ works in any POSIX-compliant `awk'.
`IGNORECASE' is not zero, _all_ regexp and string operations ignore
case.
- Changing the value of `IGNORECASE' dynamically controls the
-case-sensitivity of the program as it runs. Case is significant by
-default because `IGNORECASE' (like most variables) is initialized to
-zero:
+ Changing the value of `IGNORECASE' dynamically controls the case
+sensitivity of the program as it runs. Case is significant by default
+because `IGNORECASE' (like most variables) is initialized to zero:
x = "aB"
if (x ~ /ab/) ... # this test will fail
@@ -4040,17 +4050,17 @@ zero:
IGNORECASE = 1
if (x ~ /ab/) ... # now it will succeed
- In general, you cannot use `IGNORECASE' to make certain rules
-case-insensitive and other rules case-sensitive, because there is no
+ In general, you cannot use `IGNORECASE' to make certain rules case
+insensitive and other rules case sensitive, as there is no
straightforward way to set `IGNORECASE' just for the pattern of a
particular rule.(1) To do this, use either bracket expressions or
`tolower()'. However, one thing you can do with `IGNORECASE' only is
-dynamically turn case-sensitivity on or off for all the rules at once.
+dynamically turn case sensitivity on or off for all the rules at once.
`IGNORECASE' can be set on the command line or in a `BEGIN' rule
(*note Other Arguments::; also *note Using BEGIN/END::). Setting
-`IGNORECASE' from the command line is a way to make a program
-case-insensitive without having to edit it.
+`IGNORECASE' from the command line is a way to make a program case
+insensitive without having to edit it.
In multibyte locales, the equivalences between upper- and lowercase
characters are tested based on the wide-character values of the
@@ -4087,11 +4097,11 @@ File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp
conditional expressions, or as part of matching expressions using
the `~' and `!~' operators.
- * Escape sequences let you represent non-printable characters and
+ * Escape sequences let you represent nonprintable characters and
also let you represent regexp metacharacters as literal characters
to be matched.
- * Regexp operators provide grouping, alternation and repetition.
+ * Regexp operators provide grouping, alternation, and repetition.
* Bracket expressions give you a shorthand for specifying sets of
characters that can match at a particular point in a regexp.
@@ -4103,8 +4113,8 @@ File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp
extent of the match, such as for text substitution and when the
record separator is a regexp.
- * Matching expressions may use dynamic regexps, that is, string
- values treated as regular expressions.
+ * Matching expressions may use dynamic regexps (i.e., string values
+ treated as regular expressions).
* `gawk''s `IGNORECASE' variable lets you control the case
sensitivity of regexp matching. In other `awk' versions, use
@@ -4163,7 +4173,7 @@ File: gawk.info, Node: Records, Next: Fields, Up: Reading Files
`awk' divides the input for your program into records and fields. It
keeps track of the number of records that have been read so far from
the current input file. This value is stored in a predefined variable
-called `FNR' which is reset to zero every time a new file is started.
+called `FNR', which is reset to zero every time a new file is started.
Another predefined variable, `NR', records the total number of input
records read so far from all data files. It starts at zero, but is
never automatically reset to zero.
@@ -4176,7 +4186,7 @@ never automatically reset to zero.

File: gawk.info, Node: awk split records, Next: gawk split records, Up: Records
-4.1.1 Record Splitting With Standard `awk'
+4.1.1 Record Splitting with Standard `awk'
------------------------------------------
Records are separated by a character called the "record separator". By
@@ -4188,7 +4198,7 @@ predefined variable `RS'.
Like any other variable, the value of `RS' can be changed in the
`awk' program with the assignment operator, `=' (*note Assignment
Ops::). The new record-separator character should be enclosed in
-quotation marks, which indicate a string constant. Often the right
+quotation marks, which indicate a string constant. Often, the right
time to do this is at the beginning of execution, before any input is
processed, so that the very first record is read with the proper
separator. To do this, use the special `BEGIN' pattern (*note
@@ -4198,7 +4208,7 @@ BEGIN/END::). For example:
{ print $0 }' mail-list
changes the value of `RS' to `u', before reading any input. This is a
-string whose first character is the letter "u;" as a result, records
+string whose first character is the letter "u"; as a result, records
are separated by the letter "u." Then the input file is read, and the
second rule in the `awk' program (the action with no pattern) prints
each record. Because each `print' statement adds a newline at the end
@@ -4304,7 +4314,7 @@ variable `RT' to the text in the input that matched `RS'.

File: gawk.info, Node: gawk split records, Prev: awk split records, Up: Records
-4.1.2 Record Splitting With `gawk'
+4.1.2 Record Splitting with `gawk'
----------------------------------
When using `gawk', the value of `RS' is not limited to a one-character
@@ -4344,7 +4354,7 @@ leading and trailing whitespace. The final value of `RT' is a newline.
`RT'.
If you set `RS' to a regular expression that allows optional
-trailing text, such as `RS = "abc(XYZ)?"' it is possible, due to
+trailing text, such as `RS = "abc(XYZ)?"', it is possible, due to
implementation constraints, that `gawk' may match the leading part of
the regular expression, but not the trailing part, particularly if the
input text that could match the trailing part is fairly long. `gawk'
@@ -4412,8 +4422,8 @@ When `awk' reads an input record, the record is automatically "parsed"
or separated by the `awk' utility into chunks called "fields". By
default, fields are separated by "whitespace", like words in a line.
Whitespace in `awk' means any string of one or more spaces, TABs, or
-newlines;(1) other characters, such as formfeed, vertical tab, etc.,
-that are considered whitespace by other languages, are _not_ considered
+newlines;(1) other characters that are considered whitespace by other
+languages (such as formfeed, vertical tab, etc.) are _not_ considered
whitespace by `awk'.
The purpose of fields is to make it more convenient for you to refer
@@ -4424,9 +4434,9 @@ simple `awk' programs so powerful.
You use a dollar-sign (`$') to refer to a field in an `awk' program,
followed by the number of the field you want. Thus, `$1' refers to the
first field, `$2' to the second, and so on. (Unlike the Unix shells,
-the field numbers are not limited to single digits. `$127' is the one
-hundred twenty-seventh field in the record.) For example, suppose the
-following is a line of input:
+the field numbers are not limited to single digits. `$127' is the
+127th field in the record.) For example, suppose the following is a
+line of input:
This seems like a pretty nice example.
@@ -4485,11 +4495,11 @@ example:
awk '{ print $NR }'
Recall that `NR' is the number of records read so far: one in the first
-record, two in the second, etc. So this example prints the first field
-of the first record, the second field of the second record, and so on.
-For the twentieth record, field number 20 is printed; most likely, the
-record has fewer than 20 fields, so this prints a blank line. Here is
-another example of using expressions as field numbers:
+record, two in the second, and so on. So this example prints the first
+field of the first record, the second field of the second record, and so
+on. For the twentieth record, field number 20 is printed; most likely,
+the record has fewer than 20 fields, so this prints a blank line. Here
+is another example of using expressions as field numbers:
awk '{ print $(2*2) }' mail-list
@@ -4519,7 +4529,7 @@ field number.
---------- Footnotes ----------
(1) A "binary operator", such as `*' for multiplication, is one that
-takes two operands. The distinction is required, since `awk' also has
+takes two operands. The distinction is required, because `awk' also has
unary (one-operand) and ternary (three-operand) operators.

@@ -4565,8 +4575,8 @@ subtracted from the second field of each line:
-| Mar 5 24 34 228
...
- It is also possible to also assign contents to fields that are out
-of range. For example:
+ It is also possible to assign contents to fields that are out of
+range. For example:
$ awk '{ $6 = ($5 + $4 + $3 + $2)
> print $6 }' inventory-shipped
@@ -4667,7 +4677,7 @@ separate the fields.
record simply by setting `FS' and `OFS', and then expecting a plain
`print' or `print $0' to print the modified record.
- But this does not work, since nothing was done to change the record
+ But this does not work, because nothing was done to change the record
itself. Instead, you must force the record to be rebuilt, typically
with a statement such as `$1 = $1', as described earlier.
@@ -4707,7 +4717,7 @@ is used by the POSIX-compliant shells (such as the Unix Bourne shell,
`sh', or Bash).
The value of `FS' can be changed in the `awk' program with the
-assignment operator, `=' (*note Assignment Ops::). Often the right
+assignment operator, `=' (*note Assignment Ops::). Often, the right
time to do this is at the beginning of execution before any input has
been processed, so that the very first record is read with the proper
separator. To do this, use the special `BEGIN' pattern (*note
@@ -4819,7 +4829,7 @@ was ignored when finding `$1', it is not part of the new `$0'.
Finally, the last `print' statement prints the new `$0'.
There is an additional subtlety to be aware of when using regular
-expressions for field splitting. It is not well-specified in the POSIX
+expressions for field splitting. It is not well specified in the POSIX
standard, or anywhere else, what `^' means when splitting fields. Does
the `^' match only at the beginning of the entire record? Or is each
field separator a new string? It turns out that different `awk'
@@ -4944,21 +4954,50 @@ the entries for users whose full name is not indicated:

File: gawk.info, Node: Full Line Fields, Next: Field Splitting Summary, Prev: Command Line Field Separator, Up: Field Separators
-4.5.5 Making The Full Line Be A Single Field
+4.5.5 Making the Full Line Be a Single Field
--------------------------------------------
Occasionally, it's useful to treat the whole input line as a single
field. This can be done easily and portably simply by setting `FS' to
-`"\n"' (a newline).(1)
+`"\n"' (a newline):(1)
awk -F'\n' 'PROGRAM' FILES ...
When you do this, `$1' is the same as `$0'.
+ Changing `FS' Does Not Affect the Fields
+
+ According to the POSIX standard, `awk' is supposed to behave as if
+each record is split into fields at the time it is read. In
+particular, this means that if you change the value of `FS' after a
+record is read, the value of the fields (i.e., how they were split)
+should reflect the old value of `FS', not the new one.
+
+ However, many older implementations of `awk' do not work this way.
+Instead, they defer splitting the fields until a field is actually
+referenced. The fields are split using the _current_ value of `FS'!
+(d.c.) This behavior can be difficult to diagnose. The following
+example illustrates the difference between the two methods. (The
+`sed'(2) command prints just the first line of `/etc/passwd'.)
+
+ sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }'
+
+which usually prints:
+
+ root
+
+on an incorrect implementation of `awk', while `gawk' prints the full
+first line of the file, something like:
+
+ root:nSijPlPhZZwgE:0:0:Root:/:
+
---------- Footnotes ----------
(1) Thanks to Andrew Schorr for this tip.
+ (2) The `sed' utility is a "stream editor." Its behavior is also
+defined by the POSIX standard.
+

File: gawk.info, Node: Field Splitting Summary, Prev: Full Line Fields, Up: Field Separators
@@ -4997,32 +5036,6 @@ value of `FS' (`==' means "is equal to"):
(This is a common extension; it is not specified by the POSIX
standard.)
- Changing `FS' Does Not Affect the Fields
-
- According to the POSIX standard, `awk' is supposed to behave as if
-each record is split into fields at the time it is read. In
-particular, this means that if you change the value of `FS' after a
-record is read, the value of the fields (i.e., how they were split)
-should reflect the old value of `FS', not the new one.
-
- However, many older implementations of `awk' do not work this way.
-Instead, they defer splitting the fields until a field is actually
-referenced. The fields are split using the _current_ value of `FS'!
-(d.c.) This behavior can be difficult to diagnose. The following
-example illustrates the difference between the two methods. (The
-`sed'(1) command prints just the first line of `/etc/passwd'.)
-
- sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }'
-
-which usually prints:
-
- root
-
-on an incorrect implementation of `awk', while `gawk' prints the full
-first line of the file, something like:
-
- root:nSijPlPhZZwgE:0:0:Root:/:
-
`FS' and `IGNORECASE'
The `IGNORECASE' variable (*note User-modified::) affects field
@@ -5037,23 +5050,17 @@ Thus, in the following code:
The output is `aCa'. If you really want to split fields on an
alphabetic character while ignoring case, use a regexp that will do it
-for you. E.g., `FS = "[c]"'. In this case, `IGNORECASE' will take
+for you (e.g., `FS = "[c]"'). In this case, `IGNORECASE' will take
effect.
- ---------- Footnotes ----------
-
- (1) The `sed' utility is a "stream editor." Its behavior is also
-defined by the POSIX standard.
-

File: gawk.info, Node: Constant Size, Next: Splitting By Content, Prev: Field Separators, Up: Reading Files
4.6 Reading Fixed-Width Data
============================
- NOTE: This minor node discusses an advanced feature of `gawk'. If
- you are a novice `awk' user, you might want to skip it on the
- first reading.
+This minor node discusses an advanced feature of `gawk'. If you are a
+novice `awk' user, you might want to skip it on the first reading.
`gawk' provides a facility for dealing with fixed-width fields with
no distinctive field separator. For example, data of this nature
@@ -5089,13 +5096,10 @@ use of `FIELDWIDTHS':
brent ttyp0 26Jun91 4:46 26:46 4:41 bash
dave ttyq4 26Jun9115days 46 46 wnewmail
- The following program takes the above input, converts the idle time
-to number of seconds, and prints out the first two fields and the
+ The following program takes this input, converts the idle time to
+number of seconds, and prints out the first two fields and the
calculated idle time:
- NOTE: This program uses a number of `awk' features that haven't
- been introduced yet.
-
BEGIN { FIELDWIDTHS = "9 6 10 6 7 7 35" }
NR > 2 {
idle = $4
@@ -5112,6 +5116,9 @@ calculated idle time:
print $1, $2, idle
}
+ NOTE: The preceding program uses a number of `awk' features that
+ haven't been introduced yet.
+
Running the program on the data produces the following results:
hzuo ttyV0 0
@@ -5155,12 +5162,11 @@ of such a function).

File: gawk.info, Node: Splitting By Content, Next: Multiple Line, Prev: Constant Size, Up: Reading Files
-4.7 Defining Fields By Content
+4.7 Defining Fields by Content
==============================
- NOTE: This minor node discusses an advanced feature of `gawk'. If
- you are a novice `awk' user, you might want to skip it on the
- first reading.
+This minor node discusses an advanced feature of `gawk'. If you are a
+novice `awk' user, you might want to skip it on the first reading.
Normally, when using `FS', `gawk' defines the fields as the parts of
the record that occur in between each field separator. In other words,
@@ -5168,13 +5174,13 @@ the record that occur in between each field separator. In other words,
However, there are times when you really want to define the fields by
what they are, and not by what they are not.
- The most notorious such case is so-called "comma separated value"
+ The most notorious such case is so-called "comma-separated values"
(CSV) data. Many spreadsheet programs, for example, can export their
data into text files, where each record is terminated with a newline,
and fields are separated by commas. If only commas separated the data,
there wouldn't be an issue. The problem comes when one of the fields
-contains an _embedded_ comma. While there is no formal standard
-specification for CSV data(1), in such cases, most programs embed the
+contains an _embedded_ comma. Although there is no formal standard
+specification for CSV data,(1) in such cases, most programs embed the
field in double quotes. So we might have data like this:
Robbins,Arnold,"1234 A Pretty Street, NE",MyTown,MyState,12345-6789,USA
@@ -5183,7 +5189,7 @@ field in double quotes. So we might have data like this:
value of `FPAT' should be a string that provides a regular expression.
This regular expression describes the contents of each field.
- In the case of CSV data as presented above, each field is either
+ In the case of CSV data as presented here, each field is either
"anything that is not a comma," or "a double quote, anything that is
not a double quote, and a closing double quote." If written as a
regular expression constant (*note Regexp::), we would have
@@ -5237,8 +5243,8 @@ being used.
NOTE: Some programs export CSV data that contains embedded
newlines between the double quotes. `gawk' provides no way to
- deal with this. Since there is no formal specification for CSV
- data, there isn't much more to be done; the `FPAT' mechanism
+ deal with this. Because no formal specification for CSV data
+ exists, there isn't much more to be done; the `FPAT' mechanism
provides an elegant solution for the majority of cases, and the
`gawk' developers are satisfied with that.
@@ -5364,7 +5370,7 @@ A simple program to process this file is as follows:
-|
...
- *Note Labels Program::, for a more realistic program that deals with
+ *Note Labels Program::, for a more realistic program dealing with
address lists. The following list summarizes how records are split,
based on the value of `RS'. (`==' means "is equal to.")
@@ -5429,7 +5435,7 @@ describing the error that occurred.
represents a shell command.
NOTE: When `--sandbox' is specified (*note Options::), reading
- lines from files, pipes and coprocesses is disabled.
+ lines from files, pipes, and coprocesses is disabled.
* Menu:
@@ -5546,7 +5552,7 @@ and produces these results:
free
The `getline' command used in this way sets only the variables `NR',
-`FNR' and `RT' (and of course, VAR). The record is not split into
+`FNR', and `RT' (and of course, VAR). The record is not split into
fields, so the values of the fields (including `$0') and the value of
`NF' do not change.
@@ -5590,8 +5596,8 @@ File: gawk.info, Node: Getline/Variable/File, Next: Getline/Pipe, Prev: Getli
-------------------------------------------------
Use `getline VAR < FILE' to read input from the file FILE, and put it
-in the variable VAR. As above, FILE is a string-valued expression that
-specifies the file from which to read.
+in the variable VAR. As earlier, FILE is a string-valued expression
+that specifies the file from which to read.
In this version of `getline', none of the predefined variables are
changed and the record is not split into fields. The only variable
@@ -5857,19 +5863,19 @@ COMMAND `|& getline' Sets `$0', `NF', and `RT' `gawk'
COMMAND `|& getline' Sets VAR and `RT' `gawk'
VAR
-Table 4.1: `getline' Variants and What They Set
+Table 4.1: `getline' variants and what they set

File: gawk.info, Node: Read Timeout, Next: Command-line directories, Prev: Getline, Up: Reading Files
-4.10 Reading Input With A Timeout
+4.10 Reading Input with a Timeout
=================================
This minor node describes a feature that is specific to `gawk'.
You may specify a timeout in milliseconds for reading input from the
keyboard, a pipe, or two-way communication, including TCP/IP sockets.
-This can be done on a per input, command or connection basis, by
+This can be done on a per input, command, or connection basis, by
setting a special element in the `PROCINFO' array (*note Auto-set::):
PROCINFO["input_name", "READ_TIMEOUT"] = TIMEOUT IN MILLISECONDS
@@ -5928,13 +5934,13 @@ input to arrive:
exactly after the tenth record has been printed. It is possible
that `gawk' will read and buffer more than one record's worth of
data the first time. Because of this, changing the value of
- timeout like in the above example is not very useful.
+ timeout like in the preceding example is not very useful.
- If the `PROCINFO' element is not present and the environment
-variable `GAWK_READ_TIMEOUT' exists, `gawk' uses its value to
-initialize the timeout value. The exclusive use of the environment
-variable to specify timeout has the disadvantage of not being able to
-control it on a per command or connection basis.
+ If the `PROCINFO' element is not present and the `GAWK_READ_TIMEOUT'
+environment variable exists, `gawk' uses its value to initialize the
+timeout value. The exclusive use of the environment variable to
+specify timeout has the disadvantage of not being able to control it on
+a per command or connection basis.
`gawk' considers a timeout event to be an error even though the
attempt to read from the underlying device may succeed in a later
@@ -5956,7 +5962,7 @@ writing.

File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Read Timeout, Up: Reading Files
-4.11 Directories On The Command Line
+4.11 Directories on the Command Line
====================================
According to the POSIX standard, files named on the `awk' command line
@@ -5967,7 +5973,7 @@ of `awk' treat a directory on the command line as a fatal error.
line, but otherwise ignores it. This makes it easier to use shell
wildcards with your `awk' program:
- $ gawk -f whizprog.awk * Directories could kill this progam
+ $ gawk -f whizprog.awk * Directories could kill this program
If either of the `--posix' or `--traditional' options is given, then
`gawk' reverts to treating a directory on the command line as a fatal
@@ -6001,8 +6007,8 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li
* `gawk' sets `RT' to the text matched by `RS'.
* After splitting the input into records, `awk' further splits the
- record into individual fields, named `$1', `$2' and so on. `$0' is
- the whole record, and `NF' indicates how many fields there are.
+ record into individual fields, named `$1', `$2', and so on. `$0'
+ is the whole record, and `NF' indicates how many fields there are.
The default way to split fields is between whitespace characters.
* Fields may be referenced using a variable, as in `$NF'. Fields
@@ -6013,7 +6019,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li
does the same thing. Decrementing `NF' throws away fields and
rebuilds the record.
- * Field splitting is more complicated than record splitting.
+ * Field splitting is more complicated than record splitting:
Field separator value Fields are split ... `awk' /
`gawk'
@@ -6230,14 +6236,15 @@ separated by commas. In the output, the items are normally separated
by single spaces. However, this doesn't need to be the case; a single
space is simply the default. Any string of characters may be used as
the "output field separator" by setting the predefined variable `OFS'.
-The initial value of this variable is the string `" "'--that is, a
-single space.
+The initial value of this variable is the string `" "' (i.e., a single
+space).
The output from an entire `print' statement is called an "output
record". Each `print' statement outputs one output record, and then
outputs a string called the "output record separator" (or `ORS'). The
-initial value of `ORS' is the string `"\n"'; i.e., a newline character.
-Thus, each `print' statement normally makes a separate line.
+initial value of `ORS' is the string `"\n"' (i.e., a newline
+character). Thus, each `print' statement normally makes a separate
+line.
In order to change how output fields and records are separated,
assign new values to the variables `OFS' and `ORS'. The usual place to
@@ -6336,10 +6343,10 @@ A simple `printf' statement looks like this:
printf FORMAT, ITEM1, ITEM2, ...
-As print `print', the entire list of arguments may optionally be
-enclosed in parentheses. Here too, the parentheses are necessary if any
-of the item expressions use the `>' relational operator; otherwise, it
-can be confused with an output redirection (*note Redirection::).
+As for `print', the entire list of arguments may optionally be enclosed
+in parentheses. Here too, the parentheses are necessary if any of the
+item expressions use the `>' relational operator; otherwise, it can be
+confused with an output redirection (*note Redirection::).
The difference between `printf' and `print' is the FORMAT argument.
This is an expression whose value is taken as a string; it specifies
@@ -6422,7 +6429,7 @@ width. Here is a list of the format-control letters:
of which follow the decimal point. (The `4.3' represents two
modifiers, discussed in the next node.)
- On systems supporting IEEE 754 floating point format, values
+ On systems supporting IEEE 754 floating-point format, values
representing negative infinity are formatted as `-inf' or
`-infinity', and positive infinity as `inf' and `infinity'. The
special "not a number" value formats as `-nan' or `nan' (*note
@@ -6448,7 +6455,7 @@ width. Here is a list of the format-control letters:
`%u'
Print an unsigned decimal integer. (This format is of marginal
- use, because all numbers in `awk' are floating-point; it is
+ use, because all numbers in `awk' are floating point; it is
provided primarily for compatibility with C.)
`%x', `%X'
@@ -6519,7 +6526,7 @@ which they may appear:
space modifier.
`#'
- Use an "alternate form" for certain control letters. For `%o',
+ Use an "alternative form" for certain control letters. For `%o',
supply a leading zero. For `%x' and `%X', supply a leading `0x'
or `0X' for a nonzero result. For `%e', `%E', `%f', and `%F', the
result always contains a decimal point. For `%g' and `%G',
@@ -6533,7 +6540,7 @@ which they may appear:
`''
A single quote or apostrophe character is a POSIX extension to ISO
- C. It indicates that the integer part of a floating point value,
+ C. It indicates that the integer part of a floating-point value,
or the entire part of an integer decimal value, should have a
thousands-separator character in it. This only works in locales
that support such characters. For example:
@@ -6598,10 +6605,10 @@ which they may appear:
prints `foob'.
- The C library `printf''s dynamic WIDTH and PREC capability (for
-example, `"%*.*s"') is supported. Instead of supplying explicit WIDTH
-and/or PREC values in the format string, they are passed in the
-argument list. For example:
+ The C library `printf''s dynamic WIDTH and PREC capability (e.g.,
+`"%*.*s"') is supported. Instead of supplying explicit WIDTH and/or
+PREC values in the format string, they are passed in the argument list.
+For example:
w = 5
p = 3
@@ -6679,8 +6686,9 @@ beginning of the `awk' program:
print "---- ------" }
{ printf "%-10s %s\n", $1, $2 }' mail-list
- The above example mixes `print' and `printf' statements in the same
-program. Using just `printf' statements can produce the same results:
+ The preceding example mixes `print' and `printf' statements in the
+same program. Using just `printf' statements can produce the same
+results:
awk 'BEGIN { printf "%-10s %s\n", "Name", "Number"
printf "%-10s %s\n", "----", "------" }
@@ -6821,7 +6829,7 @@ a file, and then to use `>>' for subsequent output:
This is indeed how redirections must be used from the shell. But in
`awk', it isn't necessary. In this kind of case, a program should use
-`>' for all the `print' statements, since the output file is only
+`>' for all the `print' statements, because the output file is only
opened once. (It happens that if you mix `>' and `>>' that output is
produced in the expected order. However, mixing the operators for the
same file is definitely poor style, and is confusing to readers of your
@@ -6893,7 +6901,7 @@ that happens, writing to the screen is not correct. In fact, if `awk'
is run from a background job, it may not have a terminal at all. Then
opening `/dev/tty' fails.
- `gawk', BWK `awk' and `mawk' provide special file names for
+ `gawk', BWK `awk', and `mawk' provide special file names for
accessing the three standard streams. If the file name matches one of
these special names when `gawk' (or one of the others) redirects input
or output, then it directly uses the descriptor that the file name
@@ -6918,10 +6926,10 @@ becomes:
redirection, the value must be a string. It is a common error to omit
the quotes, which leads to confusing results.
- `gawk' does not treat these file names as special when in POSIX
-compatibility mode. However, since BWK `awk' supports them, `gawk' does
-support them even when invoked with the `--traditional' option (*note
-Options::).
+ `gawk' does not treat these file names as special when in
+POSIX-compatibility mode. However, because BWK `awk' supports them,
+`gawk' does support them even when invoked with the `--traditional'
+option (*note Options::).
---------- Footnotes ----------
@@ -6933,7 +6941,7 @@ File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Spec
5.8 Special File Names in `gawk'
================================
-Besides access to standard input, stanard output, and standard error,
+Besides access to standard input, standard output, and standard error,
`gawk' provides access to any open file descriptor. Additionally,
there are special file names reserved for TCP/IP networking.
@@ -6980,7 +6988,7 @@ form:
`/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'
- The NET-TYPE is one of `inet', `inet4' or `inet6'. The PROTOCOL is
+ The NET-TYPE is one of `inet', `inet4', or `inet6'. The PROTOCOL is
one of `tcp' or `udp', and the other fields represent the other
essential pieces of information for making a networking connection.
These file names are used with the `|&' operator for communicating with
@@ -7122,9 +7130,10 @@ terminated;(1) more importantly, the file descriptor for the pipe is
not closed and released until `close()' is called or `awk' exits.
`close()' silently does nothing if given an argument that does not
-represent a file, pipe or coprocess that was opened with a redirection.
-In such a case, it returns a negative value, indicating an error. In
-addition, `gawk' sets `ERRNO' to a string indicating the error.
+represent a file, pipe, or coprocess that was opened with a
+redirection. In such a case, it returns a negative value, indicating
+an error. In addition, `gawk' sets `ERRNO' to a string indicating the
+error.
Note also that `close(FILENAME)' has no "magic" effects on the
implicit loop that reads through the files named on the command line.
@@ -7145,8 +7154,8 @@ describes it in more detail and gives an example.
Using `close()''s Return Value
In many older versions of Unix `awk', the `close()' function is
-actually a statement. It is a syntax error to try and use the return
-value from `close()': (d.c.)
+actually a statement. (d.c.) It is a syntax error to try and use the
+return value from `close()':
command = "..."
command | getline info
@@ -7199,9 +7208,9 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi
pipes, and coprocesses.
* `gawk' provides special file names for access to standard input,
- output and error, and for network communications.
+ output, and error, and for network communications.
- * Use `close()' to close open file, pipe and coprocess redirections.
+ * Use `close()' to close open file, pipe, and coprocess redirections.
For coprocesses, it is possible to close only one direction of the
communications.
@@ -7261,8 +7270,8 @@ operators.

File: gawk.info, Node: Values, Next: All Operators, Up: Expressions
-6.1 Constants, Variables and Conversions
-========================================
+6.1 Constants, Variables, and Conversions
+=========================================
Expressions are built up from values and the operations performed upon
them. This minor node describes the elementary objects which provide
@@ -7288,7 +7297,7 @@ regular expression.
Each is used in the appropriate context when you need a data value
that isn't going to change. Numeric constants can have different
-forms, but are stored identically internally.
+forms, but are internally stored in an identical manner.
* Menu:
@@ -7312,7 +7321,7 @@ the same value:
1050e-1
A string constant consists of a sequence of characters enclosed in
-double-quotation marks. For example:
+double quotation marks. For example:
"parrot"
@@ -7325,7 +7334,7 @@ codes.
---------- Footnotes ----------
(1) The internal representation of all numbers, including integers,
-uses double precision floating-point numbers. On most modern systems,
+uses double-precision floating-point numbers. On most modern systems,
these are in IEEE 754 standard format. *Note Arbitrary Precision
Arithmetic::, for much more information.
@@ -7335,17 +7344,17 @@ File: gawk.info, Node: Nondecimal-numbers, Next: Regexp Constants, Prev: Scal
6.1.1.2 Octal and Hexadecimal Numbers
.....................................
-In `awk', all numbers are in decimal; i.e., base 10. Many other
+In `awk', all numbers are in decimal (i.e., base 10). Many other
programming languages allow you to specify numbers in other bases, often
octal (base 8) and hexadecimal (base 16). In octal, the numbers go 0,
-1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. Just as `11', in decimal, is 1
-times 10 plus 1, so `11', in octal, is 1 times 8, plus 1. This equals 9
-in decimal. In hexadecimal, there are 16 digits. Since the everyday
-decimal number system only has ten digits (`0'-`9'), the letters `a'
-through `f' are used to represent the rest. (Case in the letters is
-usually irrelevant; hexadecimal `a' and `A' have the same value.)
-Thus, `11', in hexadecimal, is 1 times 16 plus 1, which equals 17 in
-decimal.
+1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on. Just as `11', in decimal,
+is 1 times 10 plus 1, so `11', in octal, is 1 times 8, plus 1. This
+equals 9 in decimal. In hexadecimal, there are 16 digits. Because the
+everyday decimal number system only has ten digits (`0'-`9'), the
+letters `a' through `f' are used to represent the rest. (Case in the
+letters is usually irrelevant; hexadecimal `a' and `A' have the same
+value.) Thus, `11', in hexadecimal, is 1 times 16 plus 1, which equals
+17 in decimal.
Just by looking at plain `11', you can't tell what base it's in.
So, in C, C++, and other languages derived from C, there is a special
@@ -7383,7 +7392,7 @@ manipulation functions; see *note Bitwise Functions::, for more
information.
Unlike some early C implementations, `8' and `9' are not valid in
-octal constants; e.g., `gawk' treats `018' as decimal 18:
+octal constants. For example, `gawk' treats `018' as decimal 18:
$ gawk 'BEGIN { print "021 is", 021 ; print 018 }'
-| 021 is 17
@@ -7426,8 +7435,8 @@ When used on the righthand side of the `~' or `!~' operators, a regexp
constant merely stands for the regexp that is to be matched. However,
regexp constants (such as `/foo/') may be used like simple expressions.
When a regexp constant appears by itself, it has the same meaning as if
-it appeared in a pattern, i.e., `($0 ~ /foo/)' (d.c.) *Note Expression
-Patterns::. This means that the following two code segments:
+it appeared in a pattern (i.e., `($0 ~ /foo/)'). (d.c.) *Note
+Expression Patterns::. This means that the following two code segments:
if ($0 ~ /barfly/ || $0 ~ /camelot/)
print "found"
@@ -7491,8 +7500,8 @@ the user-defined function `mysub()', which in turn passes it on to
either `sub()' or `gsub()'. However, what really happens is that the
`pat' parameter is either one or zero, depending upon whether or not
`$0' matches `/hi/'. `gawk' issues a warning when it sees a regexp
-constant used as a parameter to a user-defined function, since passing
-a truth value in this way is probably not what was intended.
+constant used as a parameter to a user-defined function, because
+passing a truth value in this way is probably not what was intended.

File: gawk.info, Node: Variables, Next: Conversion, Prev: Using Constant Regexps, Up: Values
@@ -7532,7 +7541,7 @@ variable's current value. Variables are given new values with
"assignment operators", "increment operators", and "decrement
operators". *Note Assignment Ops::. In addition, the `sub()' and
`gsub()' functions can change a variable's value, and the `match()',
-`split()' and `patsplit()' functions can change the contents of their
+`split()', and `patsplit()' functions can change the contents of their
array parameters. *Note String Functions::.
A few variables have special built-in meanings, such as `FS' (the
@@ -7604,7 +7613,7 @@ File: gawk.info, Node: Conversion, Prev: Variables, Up: Values
6.1.4 Conversion of Strings and Numbers
---------------------------------------
-Number to string and string to number conversion are generally
+Number-to-string and string-to-number conversion are generally
straightforward. There can be subtleties to be aware of; this minor
node discusses this important facet of `awk'.
@@ -7617,7 +7626,7 @@ node discusses this important facet of `awk'.

File: gawk.info, Node: Strings And Numbers, Next: Locale influences conversions, Up: Conversion
-6.1.4.1 How `awk' Converts Between Strings And Numbers
+6.1.4.1 How `awk' Converts Between Strings and Numbers
......................................................
Strings are converted to numbers and numbers are converted to strings,
@@ -7640,7 +7649,7 @@ string, concatenate that number with the empty string, `""'. To force
a string to be converted to a number, add zero to that string. A
string is converted to a number by interpreting any numeric prefix of
the string as numerals: `"2.5"' converts to 2.5, `"1e3"' converts to
-1000, and `"25fix"' has a numeric value of 25. Strings that can't be
+1,000, and `"25fix"' has a numeric value of 25. Strings that can't be
interpreted as valid numbers convert to zero.
The exact manner in which numbers are converted into strings is
@@ -7669,7 +7678,7 @@ value of `CONVFMT' may be. Given the following code fragment:
`b' has the value `"12"', not `"12.00"'. (d.c.)
- Pre-POSIX `awk' Used `OFMT' For String Conversion
+ Pre-POSIX `awk' Used `OFMT' for String Conversion
Prior to the POSIX standard, `awk' used the value of `OFMT' for
converting numbers to strings. `OFMT' specifies the output format to
@@ -7706,7 +7715,7 @@ separator, if they have one.
decimal point when reading the `awk' program source code, and for
command-line variable assignments (*note Other Arguments::). However,
when interpreting input data, for `print' and `printf' output, and for
-number to string conversion, the local decimal point character is used.
+number-to-string conversion, the local decimal point character is used.
(d.c.) In all cases, numbers in source code and in input data cannot
have a thousands separator. Here are some examples indicating the
difference in behavior, on a GNU/Linux system:
@@ -7728,7 +7737,7 @@ full number including the fractional part, 4.321.
Some earlier versions of `gawk' fully complied with this aspect of
the standard. However, many users in non-English locales complained
-about this behavior, since their data used a period as the decimal
+about this behavior, because their data used a period as the decimal
point, so the default behavior was restored to use a period as the
decimal point character. You can use the `--use-lc-numeric' option
(*note Options::) to force `gawk' to use the locale's decimal point
@@ -7747,9 +7756,9 @@ Feature Default `--posix' or `--use-lc-numeric'
Input Use period Use locale
`strtonum()'Use period Use locale
-Table 6.1: Locale Decimal Point versus A Period
+Table 6.1: Locale decimal point versus a period
- Finally, modern day formal standards and IEEE standard floating point
+ Finally, modern day formal standards and IEEE standard floating-point
representation can have an unusual but important effect on the way
`gawk' converts some special string values to numbers. The details are
presented in *note POSIX Floating Point Problems::.
@@ -7757,7 +7766,7 @@ presented in *note POSIX Floating Point Problems::.

File: gawk.info, Node: All Operators, Next: Truth Values and Conditions, Prev: Values, Up: Expressions
-6.2 Operators: Doing Something With Values
+6.2 Operators: Doing Something with Values
==========================================
This minor node introduces the "operators" which make use of the values
@@ -7819,9 +7828,9 @@ order from the highest precedence to the lowest:
Division; because all numbers in `awk' are floating-point
numbers, the result is _not_ rounded to an integer--`3 / 4' has
the value 0.75. (It is a common mistake, especially for C
- programmers, to forget that _all_ numbers in `awk' are
- floating-point, and that division of integer-looking constants
- produces a real number, not an integer.)
+ programmers, to forget that _all_ numbers in `awk' are floating
+ point, and that division of integer-looking constants produces a
+ real number, not an integer.)
`X % Y'
Remainder; further discussion is provided in the text, just after
@@ -7883,7 +7892,7 @@ runs together. For example:
...
Because string concatenation does not have an explicit operator, it
-is often necessary to insure that it happens at the right time by using
+is often necessary to ensure that it happens at the right time by using
parentheses to enclose the items to concatenate. For example, you
might expect that the following code fragment concatenates `file' and
`name':
@@ -8058,7 +8067,7 @@ righthand expression. For example:
The indices of `bar' are practically guaranteed to be different, because
`rand()' returns different values each time it is called. (Arrays and
the `rand()' function haven't been covered yet. *Note Arrays::, and
-see *note Numeric Functions::, for more information). This example
+*note Numeric Functions::, for more information). This example
illustrates an important fact about assignment operators: the lefthand
expression is only evaluated _once_.
@@ -8076,16 +8085,16 @@ converted to a number.
Operator Effect
--------------------------------------------------------------------------
-LVALUE `+=' INCREMENT Add INCREMENT to the value of LVALUE.
-LVALUE `-=' DECREMENT Subtract DECREMENT from the value of LVALUE.
-LVALUE `*=' Multiply the value of LVALUE by COEFFICIENT.
+LVALUE `+=' INCREMENT Add INCREMENT to the value of LVALUE
+LVALUE `-=' DECREMENT Subtract DECREMENT from the value of LVALUE
+LVALUE `*=' Multiply the value of LVALUE by COEFFICIENT
COEFFICIENT
-LVALUE `/=' DIVISOR Divide the value of LVALUE by DIVISOR.
-LVALUE `%=' MODULUS Set LVALUE to its remainder by MODULUS.
+LVALUE `/=' DIVISOR Divide the value of LVALUE by DIVISOR
+LVALUE `%=' MODULUS Set LVALUE to its remainder by MODULUS
LVALUE `^=' POWER
-LVALUE `**=' POWER Raise LVALUE to the power POWER. (c.e.)
+LVALUE `**=' POWER Raise LVALUE to the power POWER (c.e.)
-Table 6.2: Arithmetic Assignment Operators
+Table 6.2: Arithmetic assignment operators
NOTE: Only the `^=' operator is specified by POSIX. For maximum
portability, do not use the `**=' operator.
@@ -8134,7 +8143,7 @@ effect of incrementing it.
The post-increment `foo++' is nearly the same as writing `(foo += 1)
- 1'. It is not perfectly equivalent because all numbers in `awk' are
-floating-point--in floating-point, `foo + 1 - 1' does not necessarily
+floating point--in floating point, `foo + 1 - 1' does not necessarily
equal `foo'. But the difference is minute as long as you stick to
numbers that are fairly small (less than 10e12).
@@ -8198,8 +8207,8 @@ File: gawk.info, Node: Truth Values and Conditions, Next: Function Calls, Pre
6.3 Truth Values and Conditions
===============================
-In certain contexts, expression values also serve as "truth values;"
-i.e., they determine what should happen next as the program runs. This
+In certain contexts, expression values also serve as "truth values";
+(i.e., they determine what should happen next as the program runs). This
minor node describes how `awk' defines "true" and "false" and how
values are compared.
@@ -8250,8 +8259,8 @@ File: gawk.info, Node: Typing and Comparison, Next: Boolean Ops, Prev: Truth
6.3.2 Variable Typing and Comparison Expressions
------------------------------------------------
- The Guide is definitive. Reality is frequently inaccurate. -- The
- Hitchhiker's Guide to the Galaxy
+ The Guide is definitive. Reality is frequently inaccurate. --
+ Douglas Adams, `The Hitchhiker's Guide to the Galaxy'
Unlike other programming languages, `awk' variables do not have a
fixed type. Instead, they can be either a number or a string, depending
@@ -8267,7 +8276,7 @@ are typed, and how `awk' compares variables.

File: gawk.info, Node: Variable Typing, Next: Comparison Operators, Up: Typing and Comparison
-6.3.2.1 String Type Versus Numeric Type
+6.3.2.1 String Type versus Numeric Type
.......................................
The POSIX standard introduced the concept of a "numeric string", which
@@ -8284,7 +8293,7 @@ determine how they are compared. Variable typing follows these rules:
* Fields, `getline' input, `FILENAME', `ARGV' elements, `ENVIRON'
elements, and the elements of an array created by `match()',
- `split()' and `patsplit()' that are numeric strings have the
+ `split()', and `patsplit()' that are numeric strings have the
STRNUM attribute. Otherwise, they have the STRING attribute.
Uninitialized variables also have the STRNUM attribute.
@@ -8365,19 +8374,19 @@ them.
Expression Result
--------------------------------------------------------------------------
-X `<' Y True if X is less than Y.
-X `<=' Y True if X is less than or equal to Y.
-X `>' Y True if X is greater than Y.
-X `>=' Y True if X is greater than or equal to Y.
-X `==' Y True if X is equal to Y.
-X `!=' Y True if X is not equal to Y.
-X `~' Y True if the string X matches the regexp denoted by Y.
+X `<' Y True if X is less than Y
+X `<=' Y True if X is less than or equal to Y
+X `>' Y True if X is greater than Y
+X `>=' Y True if X is greater than or equal to Y
+X `==' Y True if X is equal to Y
+X `!=' Y True if X is not equal to Y
+X `~' Y True if the string X matches the regexp denoted by Y
X `!~' Y True if the string X does not match the regexp
- denoted by Y.
+ denoted by Y
SUBSCRIPT `in' True if the array ARRAY has an element with the
-ARRAY subscript SUBSCRIPT.
+ARRAY subscript SUBSCRIPT
-Table 6.3: Relational Operators
+Table 6.3: Relational operators
Comparison expressions have the value one if true and zero if false.
When comparing operands of mixed types, numeric operands are converted
@@ -8407,24 +8416,24 @@ comparisons `awk' performs, as well as what the result of each
comparison is:
`1.5 <= 2.0'
- numeric comparison (true)
+ Numeric comparison (true)
`"abc" >= "xyz"'
- string comparison (false)
+ String comparison (false)
`1.5 != " +2"'
- string comparison (true)
+ String comparison (true)
`"1e2" < "3"'
- string comparison (true)
+ String comparison (true)
`a = 2; b = "2"'
`a == b'
- string comparison (true)
+ String comparison (true)
`a = 2; b = " +2"'
`a == b'
- string comparison (false)
+ String comparison (false)
In this example:
@@ -8456,8 +8465,8 @@ case, the value of the expression as a string is used as a dynamic
regexp (*note Regexp Usage::; also *note Computed Regexps::).
A constant regular expression in slashes by itself is also an
-expression. The regexp `/REGEXP/' is an abbreviation for the following
-comparison expression:
+expression. `/REGEXP/' is an abbreviation for the following comparison
+expression:
$0 ~ /REGEXP/
@@ -8468,7 +8477,7 @@ Constant Regexps::, where this is discussed in more detail.

File: gawk.info, Node: POSIX String Comparison, Prev: Comparison Operators, Up: Typing and Comparison
-6.3.2.3 String Comparison With POSIX Rules
+6.3.2.3 String Comparison with POSIX Rules
..........................................
The POSIX standard says that string comparison is performed based on
@@ -8655,7 +8664,7 @@ these. *Note Built-in::, for a list of built-in functions and their
descriptions. In addition, you can define functions for use in your
program. *Note User-defined::, for instructions on how to do this.
Finally, `gawk' lets you write functions in C or C++ that may be called
-from your program: see *note Dynamic Extensions::.
+from your program (*note Dynamic Extensions::).
The way to use a function is with a "function call" expression,
which consists of the function name followed immediately by a list of
@@ -8670,7 +8679,7 @@ examples show function calls with and without arguments:
rand() no arguments
CAUTION: Do not put any space between the function name and the
- open-parenthesis! A user-defined function name looks just like
+ opening parenthesis! A user-defined function name looks just like
the name of a variable--a space would make the expression look
like concatenation of a variable with an expression inside
parentheses. With built-in functions, space before the
@@ -8795,7 +8804,7 @@ precedence:
`+ -'
Addition, subtraction.
-String Concatenation
+String concatenation
There is no special symbol for concatenation. The operands are
simply written side by side (*note Concatenation::).
@@ -8810,9 +8819,9 @@ String Concatenation
redirection does not produce an expression that could be the
operand of another operator. As a result, it does not make sense
to use a redirection operator near another operator of lower
- precedence without parentheses. Such combinations (for example,
- `print foo > a ? b : c'), result in syntax errors. The correct
- way to write this statement is `print foo > (a ? b : c)'.
+ precedence without parentheses. Such combinations (e.g., `print
+ foo > a ? b : c'), result in syntax errors. The correct way to
+ write this statement is `print foo > (a ? b : c)'.
`~ !~'
Matching, nonmatching.
@@ -8838,7 +8847,7 @@ String Concatenation

File: gawk.info, Node: Locales, Next: Expressions Summary, Prev: Precedence, Up: Expressions
-6.6 Where You Are Makes A Difference
+6.6 Where You Are Makes a Difference
====================================
Modern systems support the notion of "locales": a way to tell the
@@ -8858,7 +8867,7 @@ terminator.
Locales can affect how dates and times are formatted (*note Time
Functions::). For example, a common way to abbreviate the date
-September 4, 2015 in the United States is "9/4/15." In many countries
+September 4, 2015, in the United States is "9/4/15." In many countries
in Europe, however, it is abbreviated "4.9.15." Thus, the `%x'
specification in a `"US"' locale might produce `9/4/15', while in a
`"EUROPE"' locale, it might produce `4.9.15'.
@@ -8878,12 +8887,12 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions
===========
* Expressions are the basic elements of computation in programs.
- They are built from constants, variables, function calls and
+ They are built from constants, variables, function calls, and
combinations of the various kinds of values with operators.
* `awk' supplies three kinds of constants: numeric, string, and
regexp. `gawk' lets you specify numeric constants in octal and
- hexadecimal (bases 8 and 16) in addition to decimal (base 10). In
+ hexadecimal (bases 8 and 16) as well as decimal (base 10). In
certain contexts, a standalone regexp constant such as `/foo/' has
the same meaning as `$0 ~ /foo/'.
@@ -8918,8 +8927,7 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions
* Function calls return a value which may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. `awk' provides built-in
- and user-defined functions; this is described later on in this
- Info file.
+ and user-defined functions; this is described in *note Functions::.
* Operator precedence specifies the order in which operations are
performed, unless explicitly overridden by parentheses. `awk''s
@@ -9088,7 +9096,7 @@ _not_ contain the string `li':
constant regular expressions, comparisons, or any other `awk'
expressions. Range patterns are not expressions, so they cannot appear
inside Boolean patterns. Likewise, the special patterns `BEGIN', `END',
-`BEGINFILE' and `ENDFILE', which never match any input record, are not
+`BEGINFILE', and `ENDFILE', which never match any input record, are not
expressions and cannot appear inside Boolean patterns.
The precedence of the different operators which can appear in
@@ -9174,8 +9182,7 @@ All the patterns described so far are for matching input records. The
and cleanup actions for `awk' programs. `BEGIN' and `END' rules must
have actions; there is no default action for these rules because there
is no current record when they run. `BEGIN' and `END' rules are often
-referred to as "`BEGIN' and `END' blocks" by long-time `awk'
-programmers.
+referred to as "`BEGIN' and `END' blocks" by longtime `awk' programmers.
* Menu:
@@ -9202,7 +9209,7 @@ input is read. For example:
This program finds the number of records in the input file
`mail-list' that contain the string `li'. The `BEGIN' rule prints a
title for the report. There is no need to use the `BEGIN' rule to
-initialize the counter `n' to zero, since `awk' does this automatically
+initialize the counter `n' to zero, as `awk' does this automatically
(*note Variables::). The second rule increments the variable `n' every
time a record containing the pattern `li' is read. The `END' rule
prints the value of `n' at the end of the run.
@@ -9270,20 +9277,20 @@ many older versions of Unix `awk' do not.
The third point follows from the first two. The meaning of `print'
inside a `BEGIN' or `END' rule is the same as always: `print $0'. If
-`$0' is the null string, then this prints an empty record. Many long
-time `awk' programmers use an unadorned `print' in `BEGIN' and `END'
-rules, to mean `print ""', relying on `$0' being null. Although one
-might generally get away with this in `BEGIN' rules, it is a very bad
-idea in `END' rules, at least in `gawk'. It is also poor style, since
-if an empty line is needed in the output, the program should print one
-explicitly.
+`$0' is the null string, then this prints an empty record. Many
+longtime `awk' programmers use an unadorned `print' in `BEGIN' and
+`END' rules, to mean `print ""', relying on `$0' being null. Although
+one might generally get away with this in `BEGIN' rules, it is a very
+bad idea in `END' rules, at least in `gawk'. It is also poor style,
+because if an empty line is needed in the output, the program should
+print one explicitly.
Finally, the `next' and `nextfile' statements are not allowed in a
`BEGIN' rule, because the implicit
read-a-record-and-match-against-the-rules loop has not started yet.
-Similarly, those statements are not valid in an `END' rule, since all
-the input has been read. (*Note Next Statement::, and see *note
-Nextfile Statement::.)
+Similarly, those statements are not valid in an `END' rule, because all
+the input has been read. (*Note Next Statement::, and *note Nextfile
+Statement::,.)

File: gawk.info, Node: BEGINFILE/ENDFILE, Next: Empty, Prev: BEGIN/END, Up: Pattern Overview
@@ -9382,9 +9389,9 @@ following program:
END { print nmatches, "found" }' /path/to/data
The `awk' program consists of two pieces of quoted text that are
-concatenated together to form the program. The first part is
-double-quoted, which allows substitution of the `pattern' shell
-variable inside the quotes. The second part is single-quoted.
+concatenated together to form the program. The first part is double
+quoted, which allows substitution of the `pattern' shell variable
+inside the quotes. The second part is single quoted.
Variable substitution via quoting works, but can be potentially
messy. It requires a good understanding of the shell's quoting rules
@@ -9406,10 +9413,10 @@ Now, the `awk' program is just one single-quoted string. The
assignment `-v pat="$pattern"' still requires double quotes, in case
there is whitespace in the value of `$pattern'. The `awk' variable
`pat' could be named `pattern' too, but that would be more confusing.
-Using a variable also provides more flexibility, since the variable can
-be used anywhere inside the program--for printing, as an array
-subscript, or for any other use--without requiring the quoting tricks
-at every point in the program.
+Using a variable also provides more flexibility, as the variable can be
+used anywhere inside the program--for printing, as an array subscript,
+or for any other use--without requiring the quoting tricks at every
+point in the program.

File: gawk.info, Node: Action Overview, Next: Statements, Prev: Using Shell Variables, Up: Patterns and Actions
@@ -9461,7 +9468,7 @@ Compound statements
Input statements
Use the `getline' command (*note Getline::). Also supplied in
- `awk' are the `next' statement (*note Next Statement::), and the
+ `awk' are the `next' statement (*note Next Statement::) and the
`nextfile' statement (*note Nextfile Statement::).
Output statements
@@ -9529,7 +9536,7 @@ following:
else
print "x is odd"
- In this example, if the expression `x % 2 == 0' is true (that is, if
+ In this example, if the expression `x % 2 == 0' is true (i.e., if
the value of `x' is evenly divisible by two), then the first `print'
statement is executed; otherwise, the second `print' statement is
executed. If the `else' keyword appears on the same line as THEN-BODY
@@ -9588,7 +9595,7 @@ increments the value of `i' and the loop repeats. The loop terminates
when `i' reaches four.
A newline is not required between the condition and the body;
-however using one makes the program clearer unless the body is a
+however, using one makes the program clearer unless the body is a
compound statement or else is very simple. The newline after the
open-brace that begins the compound statement is not required either,
but the program is harder to read without it.
@@ -9626,8 +9633,8 @@ false to begin with. The following is an example of a `do' statement:
}
This program prints each input record 10 times. However, it isn't a
-very realistic example, since in this case an ordinary `while' would do
-just as well. This situation reflects actual experience; only
+very realistic example, because in this case an ordinary `while' would
+do just as well. This situation reflects actual experience; only
occasionally is there a real use for a `do' statement.

@@ -9706,7 +9713,7 @@ natural to think of. Counting the number of iterations is very common
in loops. It can be easier to think of this counting as part of
looping rather than as something to do inside the loop.
- There is an alternate version of the `for' loop, for iterating over
+ There is an alternative version of the `for' loop, for iterating over
all the indices of an array:
for (i in array)
@@ -9773,12 +9780,12 @@ the end of the `switch' statement itself. For example:
}
}
- Note that if none of the statements specified above halt execution
-of a matched `case' statement, execution falls through to the next
-`case' until execution halts. In the above example, the `case' for
-`"?"' falls through to the `default' case, which is to call a function
-named `usage()'. (The `getopt()' function being called here is
-described in *note Getopt Function::.)
+ Note that if none of the statements specified here halt execution of
+a matched `case' statement, execution falls through to the next `case'
+until execution halts. In this example, the `case' for `"?"' falls
+through to the `default' case, which is to call a function named
+`usage()'. (The `getopt()' function being called here is described in
+*note Getopt Function::.)

File: gawk.info, Node: Break Statement, Next: Continue Statement, Prev: Switch Statement, Up: Statements
@@ -9879,7 +9886,7 @@ the previous example with the following `while' loop:
print ""
}
-This program loops forever once `x' reaches 5, since the increment
+This program loops forever once `x' reaches 5, because the increment
(`x++') is never reached.
The `continue' statement has no special meaning with respect to the
@@ -9925,7 +9932,7 @@ beginning, in the following manner:
Because of the `next' statement, the program's subsequent rules won't
see the bad record. The error message is redirected to the standard
-error output stream, as error messages should be. For more detail see
+error output stream, as error messages should be. For more detail, see
*note Special Files::.
If the `next' statement causes the end of the input to be reached,
@@ -9978,14 +9985,14 @@ over a file that would otherwise cause `gawk' to exit with a fatal
error. In this case, `ENDFILE' rules are not executed. *Note
BEGINFILE/ENDFILE::.
- While one might think that `close(FILENAME)' would accomplish the
+ Although it might seem that `close(FILENAME)' would accomplish the
same as `nextfile', this isn't true. `close()' is reserved for closing
files, pipes, and coprocesses that are opened with redirections. It is
not related to the main processing that `awk' does with the files
listed in `ARGV'.
NOTE: For many years, `nextfile' was a common extension. In
- September, 2012, it was accepted for inclusion into the POSIX
+ September 2012, it was accepted for inclusion into the POSIX
standard. See the Austin Group website
(http://austingroupbugs.net/view.php?id=607).
@@ -10082,7 +10089,7 @@ of activity.

File: gawk.info, Node: User-modified, Next: Auto-set, Up: Built-in Variables
-7.5.1 Built-in Variables That Control `awk'
+7.5.1 Built-In Variables That Control `awk'
-------------------------------------------
The following is an alphabetical list of variables that you can change
@@ -10203,11 +10210,11 @@ description of each variable.)
character. (*Note Output Separators::.)
`PREC #'
- The working precision of arbitrary precision floating-point
+ The working precision of arbitrary-precision floating-point
numbers, 53 bits by default (*note Setting precision::).
`ROUNDMODE #'
- The rounding mode to use for arbitrary precision arithmetic on
+ The rounding mode to use for arbitrary-precision arithmetic on
numbers, by default `"N"' (`roundTiesToEven' in the IEEE 754
standard; *note Setting the rounding mode::).
@@ -10234,7 +10241,7 @@ description of each variable.)
Used for internationalization of programs at the `awk' level. It
sets the default text domain for specially marked string constants
in the source text, as well as for the `dcgettext()',
- `dcngettext()' and `bindtextdomain()' functions (*note
+ `dcngettext()', and `bindtextdomain()' functions (*note
Internationalization::). The default value of `TEXTDOMAIN' is
`"messages"'.
@@ -10245,7 +10252,7 @@ description of each variable.)

File: gawk.info, Node: Auto-set, Next: ARGC and ARGV, Prev: User-modified, Up: Built-in Variables
-7.5.2 Built-in Variables That Convey Information
+7.5.2 Built-In Variables That Convey Information
------------------------------------------------
The following is an alphabetical list of variables that `awk' sets
@@ -10255,7 +10262,7 @@ your program.
The variables that are specific to `gawk' are marked with a pound
sign (`#'). These variables are `gawk' extensions. In other `awk'
implementations or if `gawk' is in compatibility mode (*note
-Options::), they are not special.
+Options::), they are not special:
`ARGC', `ARGV'
The command-line arguments available to `awk' programs are stored
@@ -10337,9 +10344,10 @@ Options::), they are not special.
on the command line, `awk' reads from the standard input and
`FILENAME' is set to `"-"'. `FILENAME' changes each time a new
file is read (*note Reading Files::). Inside a `BEGIN' rule, the
- value of `FILENAME' is `""', since there are no input files being
- processed yet.(1) (d.c.) Note, though, that using `getline' (*note
- Getline::) inside a `BEGIN' rule can give `FILENAME' a value.
+ value of `FILENAME' is `""', because there are no input files
+ being processed yet.(1) (d.c.) Note, though, that using `getline'
+ (*note Getline::) inside a `BEGIN' rule can give `FILENAME' a
+ value.
`FNR'
The current record number in the current file. `awk' increments
@@ -10359,7 +10367,7 @@ Options::), they are not special.
`FUNCTAB #'
An array whose indices and corresponding values are the names of
- all the built-in, user-defined and extension functions in the
+ all the built-in, user-defined, and extension functions in the
program.
NOTE: Attempting to use the `delete' statement with the
@@ -10435,8 +10443,8 @@ Options::), they are not special.
`PROCINFO["sorted_in"]'
If this element exists in `PROCINFO', its value controls the
order in which array indices will be processed by `for (INDX
- in ARRAY)' loops. Since this is an advanced feature, we
- defer the full description until later; see *note Scanning an
+ in ARRAY)' loops. This is an advanced feature, so we defer
+ the full description until later; see *note Scanning an
Array::.
`PROCINFO["strftime"]'
@@ -10452,7 +10460,7 @@ Options::), they are not special.
The following additional elements in the array are available to
provide information about the MPFR and GMP libraries if your
- version of `gawk' supports arbitrary precision arithmetic (*note
+ version of `gawk' supports arbitrary-precision arithmetic (*note
Arbitrary Precision Arithmetic::):
`PROCINFO["mpfr_version"]'
@@ -10644,7 +10652,7 @@ string. Another option is to use the `delete' statement to remove
elements from `ARGV' (*note Delete::).
All of these actions are typically done in the `BEGIN' rule, before
-actual processing of the input begins. *Note Split Program::, and see
+actual processing of the input begins. *Note Split Program::, and
*note Tee Program::, for examples of each way of removing elements from
`ARGV'.
@@ -10655,7 +10663,7 @@ manner:
awk -f myprog.awk -- -v -q file1 file2 ...
The following fragment processes `ARGV' in order to examine, and
-then remove, the above command-line options:
+then remove, the previously mentioned command-line options:
BEGIN {
for (i = 1; i < ARGC; i++) {
@@ -10687,10 +10695,10 @@ are passed on to the `awk' program. (*Note Getopt Function::, for an
`awk' library function that parses command-line options.)
When designing your program, you should choose options that don't
-conflict with `gawk''s, since it will process any options that it
+conflict with `gawk''s, because it will process any options that it
accepts before passing the rest of the command line on to your program.
-Using `#!' with the `-E' option may help (*note Executable Scripts::,
-and *note Options::).
+Using `#!' with the `-E' option may help (*Note Executable Scripts::,
+and *note Options::,).

File: gawk.info, Node: Pattern Action Summary, Prev: Built-in Variables, Up: Patterns and Actions
@@ -10842,14 +10850,14 @@ example, conceptually, if the element values are 8, `"foo"', `""', and
| 8 | "foo" | "" | 30 | @r{Value}
+---------+---------+--------+---------+
0 1 2 3 @r{Index}
-Figure 8.1: A Contiguous Array
+Figure 8.1: A contiguous array
Only the values are stored; the indices are implicit from the order of
the values. Here, 8 is the value at index zero, because 8 appears in the
position with zero elements before it.
Arrays in `awk' are different--they are "associative". This means
-that each array is a collection of pairs: an index and its corresponding
+that each array is a collection of pairs--an index and its corresponding
array element value:
Index 3 Value 30
@@ -10889,7 +10897,7 @@ numeric form--thus illustrating that a single array can have both
numbers and strings as indices. (In fact, array subscripts are always
strings. There are some subtleties to how numbers work when used as
array subscripts; this is discussed in more detail in *note Numeric
-Array Subscripts::.) Here, the number `1' isn't double-quoted, since
+Array Subscripts::.) Here, the number `1' isn't double quoted, because
`awk' automatically converts it to a string.
The value of `IGNORECASE' has no effect upon array subscripting.
@@ -10952,8 +10960,8 @@ index, use the following expression:
This expression tests whether the particular index INDX exists, without
the side effect of creating that element if it is not present. The
expression has the value one (true) if `ARRAY[INDX]' exists and zero
-(false) if it does not exist. (We use INDX here, since `index' is the
-name of a built-in function.) For example, this statement tests
+(false) if it does not exist. (We use INDX here, because `index' is
+the name of a built-in function.) For example, this statement tests
whether the array `frequencies' contains the index `2':
if (2 in frequencies)
@@ -11129,7 +11137,7 @@ all `awk' versions do so. Consider this program, named `loopcheck.awk':

File: gawk.info, Node: Controlling Scanning, Prev: Scanning an Array, Up: Array Basics
-8.1.6 Using Predefined Array Scanning Orders With `gawk'
+8.1.6 Using Predefined Array Scanning Orders with `gawk'
--------------------------------------------------------
This node describes a feature that is specific to `gawk'.
@@ -11150,7 +11158,7 @@ internal implementation of arrays and will vary from one version of
* Set `PROCINFO["sorted_in"]' to the name of a user-defined function
to use for comparison of array elements. This advanced feature is
- described later, in *note Array Sorting::.
+ described later in *note Array Sorting::.
The following special values for `PROCINFO["sorted_in"]' are
available:
@@ -11239,7 +11247,7 @@ subarrays are treated as being equal to each other. Their order
relative to each other is determined by their index strings.
Here are some additional things to bear in mind about sorted array
-traversal.
+traversal:
* The value of `PROCINFO["sorted_in"]' is global. That is, it affects
all array traversal `for' loops. If you need to change it within
@@ -11255,12 +11263,12 @@ traversal.
if (save_sorted)
PROCINFO["sorted_in"] = save_sorted
- * As mentioned, the default array traversal order is represented by
- `"@unsorted"'. You can also get the default behavior by assigning
- the null string to `PROCINFO["sorted_in"]' or by just deleting the
- `"sorted_in"' element from the `PROCINFO' array with the `delete'
- statement. (The `delete' statement hasn't been described yet;
- *note Delete::.)
+ * As already mentioned, the default array traversal order is
+ represented by `"@unsorted"'. You can also get the default
+ behavior by assigning the null string to `PROCINFO["sorted_in"]'
+ or by just deleting the `"sorted_in"' element from the `PROCINFO'
+ array with the `delete' statement. (The `delete' statement hasn't
+ been described yet; *note Delete::.)
In addition, `gawk' provides built-in functions for sorting arrays;
see *note Array Sorting Functions::.
@@ -11301,8 +11309,8 @@ string value `"12.153"' (using the default conversion value of
assigned the value one. The program then changes the value of
`CONVFMT'. The test `(xyz in data)' generates a new string value from
`xyz'--this time `"12.15"'--because the value of `CONVFMT' only allows
-two significant digits. This test fails, since `"12.15"' is different
-from `"12.153"'.
+two significant digits. This test fails, because `"12.15"' is
+different from `"12.153"'.
According to the rules for conversions (*note Conversion::), integer
values always convert to strings as integers, no matter what the value
@@ -11321,7 +11329,7 @@ the same element!
As with many things in `awk', the majority of the time things work
as you would expect them to. But it is useful to have a precise
-knowledge of the actual rules since they can sometimes have a subtle
+knowledge of the actual rules, as they can sometimes have a subtle
effect on your programs.

@@ -11424,7 +11432,7 @@ at a time.
and `mawk', as well as by a number of other implementations.
NOTE: For many years, using `delete' without a subscript was a
- common extension. In September, 2012, it was accepted for
+ common extension. In September 2012, it was accepted for
inclusion into the POSIX standard. See the Austin Group website
(http://austingroupbugs.net/view.php?id=544).
@@ -11461,7 +11469,7 @@ File: gawk.info, Node: Multidimensional, Next: Arrays of Arrays, Prev: Delete
* Multiscanning:: Scanning multidimensional arrays.
- A multidimensional array is an array in which an element is
+ A "multidimensional array" is an array in which an element is
identified by a sequence of indices instead of a single index. For
example, a two-dimensional array requires two indices. The usual way
(in many languages, including `awk') to refer to an element of a
@@ -11496,7 +11504,7 @@ stored as `foo["a@b@c"]'.
To test whether a particular index sequence exists in a
multidimensional array, use the same operator (`in') that is used for
-single dimensional arrays. Write the whole sequence of indices in
+single-dimensional arrays. Write the whole sequence of indices in
parentheses, separated by commas, as the left operand:
if ((SUBSCRIPT1, SUBSCRIPT2, ...) in ARRAY)
@@ -11597,8 +11605,8 @@ two-element subarray at index `1' of the main array `a':
can contain another subarray as a value, which in turn can hold other
arrays as well. In this way, you can create arrays of three or more
dimensions. The indices can be any `awk' expression, including scalars
-separated by commas (that is, a regular `awk' simulated
-multidimensional subscript). So the following is valid in `gawk':
+separated by commas (i.e., a regular `awk' simulated multidimensional
+subscript). So the following is valid in `gawk':
a[1][3][1, "name"] = "barney"
@@ -11611,7 +11619,7 @@ itself an array and not a scalar:
a[4] = "An element in a jagged array"
- The terms "dimension", "row" and "column" are meaningless when
+ The terms "dimension", "row", and "column" are meaningless when
applied to such an array, but we will use "dimension" henceforth to
imply the maximum number of indices needed to refer to an existing
element. The type of any element that has already been assigned cannot
@@ -11687,7 +11695,7 @@ the following code prints the elements of our main array `a':
}
*Note Walking Arrays::, for a user-defined function that "walks" an
-arbitrarily-dimensioned array of arrays.
+arbitrarily dimensioned array of arrays.
Recall that a reference to an uninitialized array element yields a
value of `""', the null string. This has one important implication when
@@ -11728,11 +11736,11 @@ File: gawk.info, Node: Arrays Summary, Prev: Arrays of Arrays, Up: Arrays
`gawk' lets you control the order by assigning special predefined
values to `PROCINFO["sorted_in"]'.
- * Use `delete ARRAY[INDX]' to delete an individual element. You may
- also use `delete ARRAY' to delete all of the elements in the
- array. This latter feature has been a common extension for many
- years and is now standard, but may not be supported by all
- commercial versions of `awk'.
+ * Use `delete ARRAY[INDX]' to delete an individual element. To
+ delete all of the elements in an array, use `delete ARRAY'. This
+ latter feature has been a common extension for many years and is
+ now standard, but may not be supported by all commercial versions
+ of `awk'.
* Standard `awk' simulates multidimensional arrays by separating
subscript values with a comma. The values are concatenated into a
@@ -11776,7 +11784,7 @@ major node describes these "user-defined" functions.

File: gawk.info, Node: Built-in, Next: User-defined, Up: Functions
-9.1 Built-in Functions
+9.1 Built-In Functions
======================
"Built-in" functions are always available for your `awk' program to
@@ -11801,7 +11809,7 @@ for your convenience.

File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up: Built-in
-9.1.1 Calling Built-in Functions
+9.1.1 Calling Built-In Functions
--------------------------------
To call one of `awk''s built-in functions, write the name of the
@@ -11809,7 +11817,7 @@ function followed by arguments in parentheses. For example, `atan2(y +
z, 1)' is a call to the function `atan2()' and has two arguments.
Whitespace is ignored between the built-in function name and the
-open parenthesis, but nonetheless it is good practice to avoid using
+opening parenthesis, but nonetheless it is good practice to avoid using
whitespace there. User-defined functions do not permit whitespace in
this way, and it is easier to avoid mistakes by following a simple
convention that always works--no whitespace after a function name.
@@ -11866,10 +11874,8 @@ brackets ([ ]):
`int(X)'
Return the nearest integer to X, located between X and zero and
- truncated toward zero.
-
- For example, `int(3)' is 3, `int(3.9)' is 3, `int(-3.9)' is -3,
- and `int(-3)' is -3 as well.
+ truncated toward zero. For example, `int(3)' is 3, `int(3.9)' is
+ 3, `int(-3.9)' is -3, and `int(-3)' is -3 as well.
`log(X)'
Return the natural logarithm of X, if X is positive; otherwise,
@@ -11960,7 +11966,7 @@ numbers.
(2) `mawk' uses a different seed each time.
(3) Computer-generated random numbers really are not truly random.
-They are technically known as "pseudorandom." This means that while
+They are technically known as "pseudorandom." This means that although
the numbers in a sequence appear to be random, you can in fact generate
the same sequence of random numbers over and over again.
@@ -11991,7 +11997,8 @@ with character indices, and not byte indices.
In the following list, optional parameters are enclosed in square
brackets ([ ]). Several functions perform string substitution; the
full discussion is provided in the description of the `sub()' function,
-which comes towards the end since the list is presented alphabetically.
+which comes toward the end, because the list is presented
+alphabetically.
Those functions that are specific to `gawk' are marked with a pound
sign (`#'). They are not available in compatibility mode (*note
@@ -12009,10 +12016,10 @@ Options::):
together.
NOTE: The following description ignores the third argument,
- HOW, since it requires understanding features that we have
- not discussed yet. Thus, the discussion here is a deliberate
- simplification. (We do provide all the details later on:
- *Note Array Sorting Functions::, for the full story.)
+ HOW, as it requires understanding features that we have not
+ discussed yet. Thus, the discussion here is a deliberate
+ simplification. (We do provide all the details later on; see
+ *note Array Sorting Functions::, for the full story.)
Both functions return the number of elements in the array SOURCE.
For `asort()', `gawk' sorts the values of SOURCE and replaces the
@@ -12251,7 +12258,7 @@ Options::):
-| 9 7
There may not be subscripts for the start and index for every
- parenthesized subexpression, since they may not all have matched
+ parenthesized subexpression, because they may not all have matched
text; thus they should be tested for with the `in' operator (*note
Reference to Elements::).
@@ -12290,8 +12297,8 @@ Options::):
`SEPS[I]' being the separator string between `ARRAY[I]' and
`ARRAY[I+1]'. If FIELDSEP is a single space then any leading
whitespace goes into `SEPS[0]' and any trailing whitespace goes
- into `SEPS[N]' where N is the return value of `split()' (that is,
- the number of elements in ARRAY).
+ into `SEPS[N]' where N is the return value of `split()' (i.e., the
+ number of elements in ARRAY).
The `split()' function splits strings into pieces in a manner
similar to the way input lines are split into fields. For example:
@@ -12315,7 +12322,7 @@ Options::):
As with input field-splitting, when the value of FIELDSEP is
`" "', leading and trailing whitespace is ignored in values
assigned to the elements of ARRAY but not in SEPS, and the elements
- are separated by runs of whitespace. Also as with input
+ are separated by runs of whitespace. Also, as with input
field-splitting, if FIELDSEP is the null string, each individual
character in the string is split into its own array element.
(c.e.)
@@ -12524,7 +12531,7 @@ is number zero.

File: gawk.info, Node: Gory Details, Up: String Functions
-9.1.3.1 More About `\' and `&' with `sub()', `gsub()', and `gensub()'
+9.1.3.1 More about `\' and `&' with `sub()', `gsub()', and `gensub()'
.....................................................................
CAUTION: This subsubsection has been reported to cause headaches.
@@ -12567,7 +12574,7 @@ is illustrated in *note table-sub-escapes::.
`\\\\\\&' `\\\&' A literal `\\&'
`\\q' `\q' A literal `\q'
-Table 9.1: Historical Escape Sequence Processing for `sub()' and
+Table 9.1: Historical escape sequence processing for `sub()' and
`gsub()'
This table shows both the lexical-level processing, where an odd number
@@ -12597,7 +12604,7 @@ This is shown in *note table-sub-proposed::.
`\\q' `\q' A literal `\q'
`\\\\' `\\' `\\'
-Table 9.2: GNU `awk' Rules For `sub()' And Backslash
+Table 9.2: GNU `awk' rules for `sub()' and backslash
In a nutshell, at the runtime level, there are now three special
sequences of characters (`\\\&', `\\&' and `\&') whereas historically
@@ -12624,20 +12631,19 @@ rules are presented in *note table-posix-sub::.
`\\q' `\q' A literal `\q'
`\\\\' `\\' `\'
-Table 9.3: POSIX Rules For `sub()' And `gsub()'
+Table 9.3: POSIX rules for `sub()' and `gsub()'
The only case where the difference is noticeable is the last one:
`\\\\' is seen as `\\' and produces `\' instead of `\\'.
Starting with version 3.1.4, `gawk' followed the POSIX rules when
`--posix' is specified (*note Options::). Otherwise, it continued to
-follow the proposed rules, since that had been its behavior for many
-years.
+follow the proposed rules, as that had been its behavior for many years.
When version 4.0.0 was released, the `gawk' maintainer made the
POSIX rules the default, breaking well over a decade's worth of
-backwards compatibility.(1) Needless to say, this was a bad idea, and
-as of version 4.0.1, `gawk' resumed its historical behavior, and only
+backward compatibility.(1) Needless to say, this was a bad idea, and as
+of version 4.0.1, `gawk' resumed its historical behavior, and only
follows the POSIX rules when `--posix' is given.
The rules for `gensub()' are considerably simpler. At the runtime
@@ -12656,7 +12662,7 @@ the `\' does not, as shown in *note table-gensub-escapes::.
`\\\\\\&' `\\\&' A literal `\&'
`\\q' `\q' A literal `q'
-Table 9.4: Escape Sequence Processing For `gensub()'
+Table 9.4: Escape sequence processing for `gensub()'
Because of the complexity of the lexical and runtime level processing
and the special cases for `sub()' and `gsub()', we recommend the use of
@@ -12700,23 +12706,23 @@ parameters are enclosed in square brackets ([ ]):
either a file opened for writing or a shell command for
redirecting output to a pipe or coprocess.
- Many utility programs "buffer" their output; i.e., they save
+ Many utility programs "buffer" their output (i.e., they save
information to write to a disk file or the screen in memory until
there is enough for it to be worthwhile to send the data to the
- output device. This is often more efficient than writing every
+ output device). This is often more efficient than writing every
little bit of information as soon as it is ready. However,
sometimes it is necessary to force a program to "flush" its
- buffers; that is, write the information to its destination, even
- if a buffer is not full. This is the purpose of the `fflush()'
+ buffers (i.e., write the information to its destination, even if a
+ buffer is not full). This is the purpose of the `fflush()'
function--`gawk' also buffers its output and the `fflush()'
function forces `gawk' to flush its buffers.
- Brian Kernighan added `fflush()' to his `awk' in April of 1992.
- For two decades, it was a common extension. In December, 2012, it
- was accepted for inclusion into the POSIX standard. See the
- Austin Group website (http://austingroupbugs.net/view.php?id=634).
+ Brian Kernighan added `fflush()' to his `awk' in April 1992. For
+ two decades, it was a common extension. In December 2012, it was
+ accepted for inclusion into the POSIX standard. See the Austin
+ Group website (http://austingroupbugs.net/view.php?id=634).
- POSIX standardizes `fflush()' as follows: If there is no argument,
+ POSIX standardizes `fflush()' as follows: if there is no argument,
or if the argument is the null string (`""'), then `awk' flushes
the buffers for _all_ open output files and pipes.
@@ -12741,6 +12747,38 @@ parameters are enclosed in square brackets ([ ]):
or if FILENAME is not an open file, pipe, or coprocess. In such a
case, `fflush()' returns -1, as well.
+ Interactive Versus Noninteractive Buffering
+
+ As a side point, buffering issues can be even more confusing,
+ depending upon whether your program is "interactive" (i.e.,
+ communicating with a user sitting at a keyboard).(1)
+
+ Interactive programs generally "line buffer" their output (i.e.,
+ they write out every line). Noninteractive programs wait until
+ they have a full buffer, which may be many lines of output. Here
+ is an example of the difference:
+
+ $ awk '{ print $1 + $2 }'
+ 1 1
+ -| 2
+ 2 3
+ -| 5
+ Ctrl-d
+
+ Each line of output is printed immediately. Compare that behavior
+ with this example:
+
+ $ awk '{ print $1 + $2 }' | cat
+ 1 1
+ 2 3
+ Ctrl-d
+ -| 2
+ -| 5
+
+ Here, no output is printed until after the `Ctrl-d' is typed,
+ because it is all buffered and sent down the pipe to `cat' in one
+ shot.
+
`system(COMMAND)'
Execute the operating-system command COMMAND and then return to
the `awk' program. Return COMMAND's exit status.
@@ -12774,37 +12812,6 @@ parameters are enclosed in square brackets ([ ]):
is disabled (*note Options::).
- Interactive Versus Noninteractive Buffering
-
- As a side point, buffering issues can be even more confusing,
-depending upon whether your program is "interactive", i.e.,
-communicating with a user sitting at a keyboard.(1)
-
- Interactive programs generally "line buffer" their output; i.e., they
-write out every line. Noninteractive programs wait until they have a
-full buffer, which may be many lines of output. Here is an example of
-the difference:
-
- $ awk '{ print $1 + $2 }'
- 1 1
- -| 2
- 2 3
- -| 5
- Ctrl-d
-
-Each line of output is printed immediately. Compare that behavior with
-this example:
-
- $ awk '{ print $1 + $2 }' | cat
- 1 1
- 2 3
- Ctrl-d
- -| 2
- -| 5
-
-Here, no output is printed until after the `Ctrl-d' is typed, because
-it is all buffered and sent down the pipe to `cat' in one shot.
-
Controlling Output Buffering with `system()'
The `fflush()' function provides explicit control over output
@@ -12818,8 +12825,8 @@ argument:
`gawk' treats this use of the `system()' function as a special case and
is smart enough not to run a shell (or other command interpreter) with
the empty command. Therefore, with `gawk', this idiom is not only
-useful, it is also efficient. While this method should work with other
-`awk' implementations, it does not necessarily avoid starting an
+useful, it is also efficient. Although this method should work with
+other `awk' implementations, it does not necessarily avoid starting an
unnecessary shell. (Other implementations may only flush the buffer
associated with the standard output and not necessarily all buffered
output.)
@@ -12910,14 +12917,14 @@ enclosed in square brackets ([ ]):
Otherwise, the value is formatted for the local time zone. The
TIMESTAMP is in the same format as the value returned by the
`systime()' function. If no TIMESTAMP argument is supplied,
- `gawk' uses the current time of day as the timestamp. If no
- FORMAT argument is supplied, `strftime()' uses the value of
+ `gawk' uses the current time of day as the timestamp. Without a
+ FORMAT argument, `strftime()' uses the value of
`PROCINFO["strftime"]' as the format string (*note Built-in
Variables::). The default string value is
`"%a %b %e %H:%M:%S %Z %Y"'. This format string produces output
that is equivalent to that of the `date' utility. You can assign
a new value to `PROCINFO["strftime"]' to change the default
- format; see below for the various format directives.
+ format; see the following list for the various format directives.
`systime()'
Return the current time as the number of seconds since the system
@@ -12981,9 +12988,9 @@ the following date format specifications:
`%g'
The year modulo 100 of the ISO 8601 week number, as a decimal
- number (00-99). For example, January 1, 2012 is in week 53 of
+ number (00-99). For example, January 1, 2012, is in week 53 of
2011. Thus, the year of its ISO 8601 week number is 2011, even
- though its year is 2012. Similarly, December 31, 2012 is in week
+ though its year is 2012. Similarly, December 31, 2012, is in week
1 of 2013. Thus, the year of its ISO week number is 2013, even
though its year is 2012.
@@ -13077,15 +13084,15 @@ the following date format specifications:
`%Ec %EC %Ex %EX %Ey %EY %Od %Oe %OH'
`%OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy'
- "Alternate representations" for the specifications that use only
+ "Alternative representations" for the specifications that use only
the second letter (`%c', `%C', and so on).(5) (These facilitate
compliance with the POSIX `date' utility.)
`%%'
A literal `%'.
- If a conversion specifier is not one of the above, the behavior is
-undefined.(6)
+ If a conversion specifier is not one of those just listed, the
+behavior is undefined.(6)
For systems that are not yet fully standards-compliant, `gawk'
supplies a copy of `strftime()' from the GNU C Library. It supports
@@ -13105,8 +13112,8 @@ format specifications are available:
The time as a decimal timestamp in seconds since the epoch.
- Additionally, the alternate representations are recognized but their
-normal representations are used.
+ Additionally, the alternative representations are recognized but
+their normal representations are used.
The following example is an `awk' implementation of the POSIX `date'
utility. Normally, the `date' utility prints the current date and time
@@ -13194,7 +13201,7 @@ table-bitwise-ops::.
0 | 0 0 | 0 1 | 0 1
1 | 0 1 | 1 1 | 1 0
-Table 9.5: Bitwise Operations
+Table 9.5: Bitwise operations
As you can see, the result of an AND operation is 1 only when _both_
bits are 1. The result of an OR operation is 1 if _either_ bit is 1.
@@ -13231,7 +13238,7 @@ are enclosed in square brackets ([ ]):
Return the bitwise XOR of the arguments. There must be at least
two.
- For all of these functions, first the double precision
+ For all of these functions, first the double-precision
floating-point value is converted to the widest C unsigned integer
type, then the bitwise operation is performed. If the result cannot be
represented exactly as a C `double', leading nonzero bits are removed
@@ -13289,7 +13296,7 @@ or not. If so, a `"1"' is concatenated onto the front of the string.
Otherwise, a `"0"' is added. The value is then shifted right by one
bit and the loop continues until there are no more 1 bits.
- If the initial value is zero it returns a simple `"0"'. Otherwise,
+ If the initial value is zero, it returns a simple `"0"'. Otherwise,
at the end, it pads the value with zeros to represent multiples of
8-bit quantities. This is typical in modern computers.
@@ -13325,11 +13332,11 @@ user-defined function (not discussed yet; *note User-defined::), to
test if a parameter is an array or not.
NOTE: Using `isarray()' at the global level to test variables
- makes no sense. Since you are the one writing the program, you are
- supposed to know if your variables are arrays or not. And in fact,
- due to the way `gawk' works, if you pass the name of a variable
- that has not been previously used to `isarray()', `gawk' ends up
- turning it into a scalar.
+ makes no sense. Because you are the one writing the program, you
+ are supposed to know if your variables are arrays or not. And in
+ fact, due to the way `gawk' works, if you pass the name of a
+ variable that has not been previously used to `isarray()', `gawk'
+ ends up turning it into a scalar.

File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in
@@ -13375,8 +13382,8 @@ File: gawk.info, Node: User-defined, Next: Indirect Calls, Prev: Built-in, U
Complicated `awk' programs can often be simplified by defining your own
functions. User-defined functions can be called just like built-in
-ones (*note Function Calls::), but it is up to you to define them,
-i.e., to tell `awk' what they should do.
+ones (*note Function Calls::), but it is up to you to define them
+(i.e., to tell `awk' what they should do).
* Menu:
@@ -13489,7 +13496,7 @@ function:
func foo() { a = sqrt($1) ; print a }
-Instead it defines a rule that, for each record, concatenates the value
+Instead, it defines a rule that, for each record, concatenates the value
of the variable `func' with the return value of the function `foo'. If
the resulting string is non-null, the action is executed. This is
probably not what is desired. (`awk' accepts this input as
@@ -13501,7 +13508,7 @@ keyword `function' when defining a function.
---------- Footnotes ----------
- (1) This program won't actually run, since `foo()' is undefined.
+ (1) This program won't actually run, because `foo()' is undefined.

File: gawk.info, Node: Function Example, Next: Function Caveats, Prev: Definition Syntax, Up: User-defined
@@ -13555,7 +13562,7 @@ POSIX standard.)
string as an input parameter and returns the string in backwards order.
Recursive functions must always have a test that stops the recursion.
In this case, the recursion terminates when the input string is already
-empty.
+empty:
function rev(str)
{
@@ -13591,9 +13598,9 @@ an `awk' version of `ctime()':
}
You might think that `ctime()' could use `PROCINFO["strftime"]' for
-its format string. That would be a mistake, since `ctime()' is supposed
-to return the time formatted in a standard fashion, and user-level code
-could have changed `PROCINFO["strftime"]'.
+its format string. That would be a mistake, because `ctime()' is
+supposed to return the time formatted in a standard fashion, and
+user-level code could have changed `PROCINFO["strftime"]'.
---------- Footnotes ----------
@@ -13618,7 +13625,7 @@ the function.

File: gawk.info, Node: Calling A Function, Next: Variable Scope, Up: Function Caveats
-9.2.3.1 Writing A Function Call
+9.2.3.1 Writing a Function Call
...............................
A function call consists of the function name followed by the arguments
@@ -13631,10 +13638,10 @@ string concatenation):
foo(x y, "lose", 4 * z)
CAUTION: Whitespace characters (spaces and TABs) are not allowed
- between the function name and the open-parenthesis of the argument
- list. If you write whitespace by mistake, `awk' might think that
- you mean to concatenate a variable with an expression in
- parentheses. However, it notices that you used a function name
+ between the function name and the opening parenthesis of the
+ argument list. If you write whitespace by mistake, `awk' might
+ think that you mean to concatenate a variable with an expression
+ in parentheses. However, it notices that you used a function name
and not a variable name, and reports an error.

@@ -13687,7 +13694,7 @@ variable instance:
top's i=3
If you want `i' to be local to both `foo()' and `bar()' do as
-follows (the extra-space before `i' is a coding convention to indicate
+follows (the extra space before `i' is a coding convention to indicate
that `i' is a local variable, not an argument):
function bar( i)
@@ -13760,20 +13767,17 @@ create new arrays. Consider this example:

File: gawk.info, Node: Pass By Value/Reference, Prev: Variable Scope, Up: Function Caveats
-9.2.3.3 Passing Function Arguments By Value Or By Reference
+9.2.3.3 Passing Function Arguments by Value Or by Reference
...........................................................
In `awk', when you declare a function, there is no way to declare
explicitly whether the arguments are passed "by value" or "by
reference".
- Instead the passing convention is determined at runtime when the
-function is called according to the following rule:
-
- * If the argument is an array variable, then it is passed by
- reference,
-
- * Otherwise the argument is passed by value.
+ Instead, the passing convention is determined at runtime when the
+function is called according to the following rule: if the argument is
+an array variable, then it is passed by reference. Otherwise, the
+argument is passed by value.
Passing an argument by value means that when a function is called, it
is given a _copy_ of the value of this argument. The caller may use a
@@ -13850,7 +13854,7 @@ undefined functions.
Some `awk' implementations generate a runtime error if you use
either the `next' statement or the `nextfile' statement (*note Next
-Statement::, also *note Nextfile Statement::) inside a user-defined
+Statement::, and *note Nextfile Statement::) inside a user-defined
function. `gawk' does not have this limitation.

@@ -13899,11 +13903,12 @@ a value for the largest number among the elements of an array:
}
You call `maxelt()' with one argument, which is an array name. The
-local variables `i' and `ret' are not intended to be arguments; while
-there is nothing to stop you from passing more than one argument to
-`maxelt()', the results would be strange. The extra space before `i'
-in the function parameter list indicates that `i' and `ret' are local
-variables. You should follow this convention when defining functions.
+local variables `i' and `ret' are not intended to be arguments; there
+is nothing to stop you from passing more than one argument to
+`maxelt()' but the results would be strange. The extra space before
+`i' in the function parameter list indicates that `i' and `ret' are
+local variables. You should follow this convention when defining
+functions.
The following program uses the `maxelt()' function. It loads an
array, calls `maxelt()', and then reports the maximum number in that
@@ -14017,15 +14022,15 @@ function calls, you tell `gawk' to use the _value_ of a variable as the
_name_ of the function to call.
The syntax is similar to that of a regular function call: an
-identifier immediately followed by a left parenthesis, any arguments,
-and then a closing right parenthesis, with the addition of a leading `@'
-character:
+identifier immediately followed by an opening parenthesis, any
+arguments, and then a closing parenthesis, with the addition of a
+leading `@' character:
the_func = "sum"
result = @the_func() # calls the sum() function
Here is a full program that processes the previously shown data,
-using indirect function calls.
+using indirect function calls:
# indirectcall.awk --- Demonstrate indirect function calls
@@ -14053,7 +14058,7 @@ using indirect function calls.
These two functions expect to work on fields; thus the parameters
`first' and `last' indicate where in the fields to start and end.
-Otherwise they perform the expected computations and are not unusual.
+Otherwise they perform the expected computations and are not unusual:
# For each record, print the class name and the requested statistics
{
@@ -14330,7 +14335,7 @@ File: gawk.info, Node: Functions Summary, Prev: Indirect Calls, Up: Functions
* POSIX `awk' provides three kinds of built-in functions: numeric,
string, and I/O. `gawk' provides functions that sort arrays, work
with values representing time, do bit manipulation, determine
- variable type (array vs. scalar), and internationalize and
+ variable type (array versus scalar), and internationalize and
localize programs. `gawk' also provides several extensions to
some of standard functions, typically in the form of additional
arguments.
@@ -14420,8 +14425,8 @@ functions and would like to contribute them to the `awk' user
community, see *note How To Contribute::, for more information.
The programs in this major node and in *note Sample Programs::,
-freely use features that are `gawk'-specific. Rewriting these programs
-for different implementations of `awk' is pretty straightforward.
+freely use `gawk'-specific features. Rewriting these programs for
+different implementations of `awk' is pretty straightforward:
* Diagnostic error messages are sent to `/dev/stderr'. Use `| "cat
1>&2"' instead of `> "/dev/stderr"' if your system does not have a
@@ -14479,8 +14484,8 @@ specific function). There is no intermediate state analogous to
Library functions often need to have global variables that they can
use to preserve state information between calls to the function--for
example, `getopt()''s variable `_opti' (*note Getopt Function::). Such
-variables are called "private", since the only functions that need to
-use them are the ones in the library.
+variables are called "private", as the only functions that need to use
+them are the ones in the library.
When writing a library function, you should try to choose names for
your private variables that will not conflict with any variables used by
@@ -14497,7 +14502,7 @@ will be accidentally shared with the user's program.
In addition, several of the library functions use a prefix that helps
indicate what function or set of functions use the variables--for
example, `_pw_byname()' in the user database routines (*note Passwd
-Functions::). This convention is recommended, since it even further
+Functions::). This convention is recommended, as it even further
decreases the chance of inadvertent conflict among variable names.
Note that this convention is used equally well for variable names and
for private function names.(1)
@@ -14538,9 +14543,9 @@ merely recommend that you do so.
---------- Footnotes ----------
- (1) While all the library routines could have been rewritten to use
-this convention, this was not done, in order to show how our own `awk'
-programming style has evolved and to provide some basis for this
+ (1) Although all the library routines could have been rewritten to
+use this convention, this was not done, in order to show how our own
+`awk' programming style has evolved and to provide some basis for this
discussion.
(2) `gawk''s `--dump-variables' command-line option is useful for
@@ -14574,7 +14579,7 @@ programming use.

File: gawk.info, Node: Strtonum Function, Next: Assert Function, Up: General Functions
-10.2.1 Converting Strings To Numbers
+10.2.1 Converting Strings to Numbers
------------------------------------
The `strtonum()' function (*note String Functions::) is a `gawk'
@@ -14641,8 +14646,8 @@ then `mystrtonum()' loops through each character in the string. It
sets `k' to the index in `"1234567"' of the current octal digit. The
return value will either be the same number as the digit, or zero if
the character is not there, which will be true for a `0'. This is
-safe, since the regexp test in the `if' ensures that only octal values
-are converted.
+safe, because the regexp test in the `if' ensures that only octal
+values are converted.
Similar logic applies to the code that checks for and converts a
hexadecimal value, which starts with `0x' or `0X'. The use of
@@ -14871,8 +14876,8 @@ distant past, at least one minicomputer manufacturer used ASCII, but
with mark parity, meaning that the leftmost bit in the byte is always
1. This means that on those systems, characters have numeric values
from 128 to 255. Finally, large mainframe systems use the EBCDIC
-character set, which uses all 256 values. While there are other
-character sets in use on some older systems, they are not really worth
+character set, which uses all 256 values. There are other character
+sets in use on some older systems, but they are not really worth
worrying about:
function ord(str, c)
@@ -14930,7 +14935,7 @@ application programs (*note Sample Programs::).
but it should also have a reasonable default behavior. It is called
with an array as well as the beginning and ending indices of the
elements in the array to be merged. This assumes that the array
-indices are numeric--a reasonable assumption since the array was likely
+indices are numeric--a reasonable assumption, as the array was likely
created with `split()' (*note String Functions::):
# join.awk --- join an array into a string
@@ -14970,7 +14975,7 @@ File: gawk.info, Node: Getlocaltime Function, Next: Readfile Function, Prev:
The `systime()' and `strftime()' functions described in *note Time
Functions::, provide the minimum functionality necessary for dealing
-with the time of day in human readable form. While `strftime()' is
+with the time of day in human-readable form. Although `strftime()' is
extensive, the control formats are not necessarily easy to remember or
intuitively obvious when reading a program.
@@ -15047,7 +15052,7 @@ optional timestamp value to use instead of the current time.

File: gawk.info, Node: Readfile Function, Next: Shell Quoting, Prev: Getlocaltime Function, Up: General Functions
-10.2.8 Reading A Whole File At Once
+10.2.8 Reading a Whole File At Once
-----------------------------------
Often, it is convenient to have the entire contents of a file available
@@ -15110,7 +15115,7 @@ also reads an entire file into memory.

File: gawk.info, Node: Shell Quoting, Prev: Readfile Function, Up: General Functions
-10.2.9 Quoting Strings to Pass to The Shell
+10.2.9 Quoting Strings to Pass to the Shell
-------------------------------------------
Michael Brennan offers the following programming pattern, which he uses
@@ -15138,7 +15143,7 @@ frequently:
Note the need for shell quoting. The function `shell_quote()' does
it. `SINGLE' is the one-character string `"'"' and `QSINGLE' is the
-three-character string `"\"'\""'.
+three-character string `"\"'\""':
# shell_quote --- quote an argument for passing to the shell
@@ -15182,7 +15187,7 @@ File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data Fi
10.3.1 Noting Data File Boundaries
----------------------------------
-The `BEGIN' and `END' rules are each executed exactly once at the
+The `BEGIN' and `END' rules are each executed exactly once, at the
beginning and end of your `awk' program, respectively (*note
BEGIN/END::). We (the `gawk' authors) once had a user who mistakenly
thought that the `BEGIN' rule is executed at the beginning of each data
@@ -15242,7 +15247,7 @@ again the value of multiple `BEGIN' and `END' rules should be clear.
pass and at the beginning of the second pass. The following version
solves the problem:
- # ftrans.awk --- handle data file transitions
+ # ftrans.awk --- handle datafile transitions
#
# user supplies beginfile() and endfile() functions
@@ -15258,7 +15263,7 @@ solves the problem:
*note Wc Program::, shows how this library function can be used and
how it simplifies writing the main program.
- So Why Does `gawk' have `BEGINFILE' and `ENDFILE'?
+ So Why Does `gawk' Have `BEGINFILE' and `ENDFILE'?
You are probably wondering, if `beginfile()' and `endfile()'
functions can do the job, why does `gawk' have `BEGINFILE' and
@@ -15266,7 +15271,7 @@ functions can do the job, why does `gawk' have `BEGINFILE' and
Good question. Normally, if `awk' cannot open a file, this causes
an immediate fatal error. In this case, there is no way for a
-user-defined function to deal with the problem, since the mechanism for
+user-defined function to deal with the problem, as the mechanism for
calling it relies on the file being open and at the first record. Thus,
the main reason for `BEGINFILE' is to give you a "hook" to catch files
that cannot be processed. `ENDFILE' exists for symmetry, and because
@@ -15310,8 +15315,8 @@ over with it from the top. For lack of a better name, we'll call it
Auto-set::), which is specific to `gawk'. It also relies on the
`nextfile' keyword (*note Nextfile Statement::). Because of this, you
should not call it from an `ENDFILE' rule. (This isn't necessary
-anyway, since as soon as an `ENDFILE' rule finishes `gawk' goes to the
-next file!)
+anyway, because `gawk' goes to the next file as soon as an `ENDFILE'
+rule finishes!)

File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management
@@ -15339,12 +15344,12 @@ following program to your `awk' program:
}
This works, because the `getline' won't be fatal. Removing the
-element from `ARGV' with `delete' skips the file (since it's no longer
-in the list). See also *note ARGC and ARGV::.
+element from `ARGV' with `delete' skips the file (because it's no
+longer in the list). See also *note ARGC and ARGV::.
- The regular expression check purposely does not use character classes
-such as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::) since
-`awk' variable names only allow the English letters.
+ Because `awk' variable names only allow the English letters, the
+regular expression check purposely does not use character classes such
+as `[:alpha:]' and `[:alnum:]' (*note Bracket Expressions::)
---------- Footnotes ----------
@@ -15452,11 +15457,11 @@ File: gawk.info, Node: Getopt Function, Next: Passwd Functions, Prev: Data Fi
10.4 Processing Command-Line Options
====================================
-Most utilities on POSIX compatible systems take options on the command
+Most utilities on POSIX-compatible systems take options on the command
line that can be used to change the way a program behaves. `awk' is an
example of such a program (*note Options::). Often, options take
-"arguments"; i.e., data that the program needs to correctly obey the
-command-line option. For example, `awk''s `-F' option requires a
+"arguments" (i.e., data that the program needs to correctly obey the
+command-line option). For example, `awk''s `-F' option requires a
string to use as the field separator. The first occurrence on the
command line of either `--' or a string that does not begin with `-'
ends the options.
@@ -15681,10 +15686,10 @@ next element in `argv'. If neither condition is true, then only
on the next call to `getopt()'.
The `BEGIN' rule initializes both `Opterr' and `Optind' to one.
-`Opterr' is set to one, since the default behavior is for `getopt()' to
-print a diagnostic message upon seeing an invalid option. `Optind' is
-set to one, since there's no reason to look at the program name, which
-is in `ARGV[0]':
+`Opterr' is set to one, because the default behavior is for `getopt()'
+to print a diagnostic message upon seeing an invalid option. `Optind'
+is set to one, because there's no reason to look at the program name,
+which is in `ARGV[0]':
BEGIN {
Opterr = 1 # default is to diagnose
@@ -15724,14 +15729,14 @@ result of two sample runs of the test program:
In both runs, the first `--' terminates the arguments to `awk', so
that it does not try to interpret the `-a', etc., as its own options.
- NOTE: After `getopt()' is through, user level code must clear out
+ NOTE: After `getopt()' is through, user-level code must clear out
all the elements of `ARGV' from 1 to `Optind', so that `awk' does
not try to process the command-line options as file names.
Using `#!' with the `-E' option may help avoid conflicts between
-your program's options and `gawk''s options, since `-E' causes `gawk'
-to abandon processing of further options (*note Executable Scripts::,
-and *note Options::).
+your program's options and `gawk''s options, as `-E' causes `gawk' to
+abandon processing of further options (*note Executable Scripts::, and
+*note Options::).
Several of the sample programs presented in *note Sample Programs::,
use `getopt()' to process their arguments.
@@ -15740,7 +15745,7 @@ use `getopt()' to process their arguments.
(1) This function was written before `gawk' acquired the ability to
split strings into single characters using `""' as the separator. We
-have left it alone, since using `substr()' is more portable.
+have left it alone, as using `substr()' is more portable.

File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt Function, Up: Library Functions
@@ -15765,7 +15770,7 @@ function is `getpwent()', for "get password entry." The "password"
comes from the original user database file, `/etc/passwd', which stores
user information, along with the encrypted passwords (hence the name).
- While an `awk' program could simply read `/etc/passwd' directly,
+ Although an `awk' program could simply read `/etc/passwd' directly,
this file may not contain complete information about the system's set
of users.(1) To be sure you are able to produce a readable and complete
version of the user database, it is necessary to write a small C
@@ -15810,13 +15815,13 @@ Encrypted password
systems.
User-ID
- The user's numeric user ID number. (On some systems it's a C
+ The user's numeric user ID number. (On some systems, it's a C
`long', and not an `int'. Thus we cast it to `long' for all
cases.)
Group-ID
The user's numeric group ID number. (Similar comments about
- `long' vs. `int' apply here.)
+ `long' versus `int' apply here.)
Full name
The user's full name, and perhaps other information associated
@@ -15894,14 +15899,14 @@ you might want it to be in a different directory on your system.
into three associative arrays. The arrays are indexed by username
(`_pw_byname'), by user ID number (`_pw_byuid'), and by order of
occurrence (`_pw_bycount'). The variable `_pw_inited' is used for
-efficiency, since `_pw_init()' needs to be called only once.
+efficiency, as `_pw_init()' needs to be called only once.
Because this function uses `getline' to read information from
`pwcat', it first saves the values of `FS', `RS', and `$0'. It notes
in the variable `using_fw' whether field splitting with `FIELDWIDTHS'
-is in effect or not. Doing so is necessary, since these functions
-could be called from anywhere within a user's program, and the user may
-have his or her own way of splitting records and fields. This makes it
+is in effect or not. Doing so is necessary, as these functions could
+be called from anywhere within a user's program, and the user may have
+his or her own way of splitting records and fields. This makes it
possible to restore the correct field-splitting mechanism later. The
test can only be true for `gawk'. It is false if using `FS' or `FPAT',
or on some other `awk' implementation.
@@ -15972,8 +15977,8 @@ simplifies the code but runs an extra process that may never be needed.)
once. If you are worried about squeezing every last cycle out of your
`awk' program, the check of `_pw_inited' could be moved out of
`_pw_init()' and duplicated in all the other functions. In practice,
-this is not necessary, since most `awk' programs are I/O-bound, and
-such a change would clutter up the code.
+this is not necessary, as most `awk' programs are I/O-bound, and such a
+change would clutter up the code.
The `id' program in *note Id Program::, uses these functions.
@@ -16043,7 +16048,7 @@ Group ID Number
cases.)
Group Member List
- A comma-separated list of user names. These users are members of
+ A comma-separated list of usernames. These users are members of
the group. Modern Unix systems allow users to be members of
several groups simultaneously. If your system does, then there
are elements `"group1"' through `"groupN"' in `PROCINFO' for those
@@ -16134,7 +16139,7 @@ used, and to restore the appropriate field splitting mechanism.
The group information is stored is several associative arrays. The
arrays are indexed by group name (`_gr_byname'), by group ID number
(`_gr_bygid'), and by position in the database (`_gr_bycount'). There
-is an additional array indexed by user name (`_gr_groupsbyuser'), which
+is an additional array indexed by username (`_gr_groupsbyuser'), which
is a space-separated list of groups to which each user belongs.
Unlike the user database, it is possible to have multiple records in
@@ -16146,7 +16151,7 @@ following:
tvpeople:*:101:david,conan,tom,joan
For this reason, `_gr_init()' looks to see if a group name or group
-ID number is already seen. If it is, then the user names are simply
+ID number is already seen. If it is, the usernames are simply
concatenated onto the previous list of users.(1)
Finally, `_gr_init()' closes the pipeline to `grcat', restores `FS'
@@ -16174,7 +16179,7 @@ looks up the information associated with that group ID:
}
The `getgruser()' function does not have a C counterpart. It takes a
-user name and returns the list of groups that have the user as a member:
+username and returns the list of groups that have the user as a member:
function getgruser(user)
{
@@ -16286,7 +16291,7 @@ File: gawk.info, Node: Library Functions Summary, Next: Library Exercises, Pr
* The functions presented here fit into the following categories:
General problems
- Number to string conversion, assertions, rounding, random
+ Number-to-string conversion, assertions, rounding, random
number generation, converting characters to numbers, joining
strings, getting easily usable time-of-day information, and
reading a whole file in one shot.
@@ -16415,7 +16420,7 @@ programming for "real world" tasks.

File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones
-11.2.1 Cutting out Fields and Columns
+11.2.1 Cutting Out Fields and Columns
-------------------------------------
The `cut' utility selects, or "cuts," characters or fields from its
@@ -16632,10 +16637,10 @@ filler fields:
nfields = j - 1
}
- Next is the rule that actually processes the data. If the `-s'
-option is given, then `suppress' is true. The first `if' statement
-makes sure that the input record does have the field separator. If
-`cut' is processing fields, `suppress' is true, and the field separator
+ Next is the rule that processes the data. If the `-s' option is
+given, then `suppress' is true. The first `if' statement makes sure
+that the input record does have the field separator. If `cut' is
+processing fields, `suppress' is true, and the field separator
character is not in the record, then the record is skipped.
If the record is valid, then `gawk' has split the data into fields,
@@ -16660,8 +16665,8 @@ out between the fields:
}
This version of `cut' relies on `gawk''s `FIELDWIDTHS' variable to
-do the character-based cutting. While it is possible in other `awk'
-implementations to use `substr()' (*note String Functions::), it is
+do the character-based cutting. It is possible in other `awk'
+implementations to use `substr()' (*note String Functions::), but it is
also extremely painful. The `FIELDWIDTHS' variable supplies an elegant
solution to the problem of picking the input line apart by characters.
@@ -16772,14 +16777,14 @@ the matched lines in the output:
# pattern = tolower(pattern)
}
- The last two lines are commented out, since they are not needed in
+ The last two lines are commented out, as they are not needed in
`gawk'. They should be uncommented if you have to use another version
of `awk'.
The next set of lines should be uncommented if you are not using
`gawk'. This rule translates all the characters in the input line into
lowercase if the `-i' option is specified.(1) The rule is commented out
-since it is not necessary with `gawk':
+as it is not necessary with `gawk':
#{
# if (IGNORECASE)
@@ -16891,7 +16896,7 @@ the translated line, not the original.

File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program, Up: Clones
-11.2.3 Printing out User Information
+11.2.3 Printing Out User Information
------------------------------------
The `id' utility lists a user's real and effective user ID numbers,
@@ -16975,7 +16980,7 @@ and the group numbers:
The test in the `for' loop is worth noting. Any supplementary
groups in the `PROCINFO' array have the indices `"group1"' through
-`"groupN"' for some N, i.e., the total number of supplementary groups.
+`"groupN"' for some N (i.e., the total number of supplementary groups).
However, we don't know in advance how many of these groups there are.
This loop works by starting at one, concatenating the value with
@@ -17004,11 +17009,11 @@ is as follows:(1)
`split' [`-COUNT'] [FILE] [PREFIX]
By default, the output files are named `xaa', `xab', and so on. Each
-file has 1000 lines in it, with the likely exception of the last file.
+file has 1,000 lines in it, with the likely exception of the last file.
To change the number of lines in each file, supply a number on the
-command line preceded with a minus; e.g., `-500' for files with 500
-lines in them instead of 1000. To change the name of the output files
-to something like `myfileaa', `myfileab', and so on, supply an
+command line preceded with a minus (e.g., `-500' for files with 500
+lines in them instead of 1,000). To change the name of the output
+files to something like `myfileaa', `myfileab', and so on, supply an
additional argument that specifies the file name prefix.
Here is a version of `split' in `awk'. It uses the `ord()' and
@@ -17041,7 +17046,7 @@ output file names:
}
# test argv in case reading from stdin instead of file
if (i in ARGV)
- i++ # skip data file name
+ i++ # skip datafile name
if (i in ARGV) {
outfile = ARGV[i]
ARGV[i] = ""
@@ -17113,8 +17118,8 @@ files named on the command line. Its usage is as follows:
truncating them and starting over.
The `BEGIN' rule first makes a copy of all the command-line arguments
-into an array named `copy'. `ARGV[0]' is not copied, since it is not
-needed. `tee' cannot use `ARGV' directly, since `awk' attempts to
+into an array named `copy'. `ARGV[0]' is not needed, so it is not
+copied. `tee' cannot use `ARGV' directly, because `awk' attempts to
process each file name in `ARGV' as input data.
If the first argument is `-a', then the flag variable `append' is
@@ -17146,7 +17151,7 @@ input by setting `ARGV[1]' to `"-"' and `ARGC' to two:
ARGC = 2
}
- The following single rule does all the work. Since there is no
+ The following single rule does all the work. Because there is no
pattern, it is executed for each line of input. The body of the rule
simply prints the line into each file on the command line, and then to
the standard output:
@@ -17170,11 +17175,12 @@ It is also possible to write the loop this way:
else
print > copy[i]
-This is more concise but it is also less efficient. The `if' is tested
-for each record and for each output file. By duplicating the loop
-body, the `if' is only tested once for each input record. If there are
-N input records and M output files, the first method only executes N
-`if' statements, while the second executes N`*'M `if' statements.
+This is more concise, but it is also less efficient. The `if' is
+tested for each record and for each output file. By duplicating the
+loop body, the `if' is only tested once for each input record. If
+there are N input records and M output files, the first method only
+executes N `if' statements, while the second executes N`*'M `if'
+statements.
Finally, the `END' rule cleans up by closing all the output files:
@@ -17352,13 +17358,13 @@ to.
depending upon the results of `are_equal()''s comparison. If `uniq' is
counting repeated lines, and the lines are equal, then it increments
the `count' variable. Otherwise, it prints the line and resets `count',
-since the two lines are not equal.
+because the two lines are not equal.
If `uniq' is not counting, and if the lines are equal, `count' is
-incremented. Nothing is printed, since the point is to remove
-duplicates. Otherwise, if `uniq' is counting repeated lines and more
-than one line is seen, or if `uniq' is counting nonrepeated lines and
-only one line is seen, then the line is printed, and `count' is reset.
+incremented. Nothing is printed, as the point is to remove duplicates.
+Otherwise, if `uniq' is counting repeated lines and more than one line
+is seen, or if `uniq' is counting nonrepeated lines and only one line
+is seen, then the line is printed, and `count' is reset.
Finally, similar logic is used in the `END' rule to print the final
line of input data:
@@ -17430,10 +17436,10 @@ follows:
`-c'
Count only characters.
- Implementing `wc' in `awk' is particularly elegant, since `awk' does
-a lot of the work for us; it splits lines into words (i.e., fields) and
-counts them, it counts lines (i.e., records), and it can easily tell us
-how long a line is.
+ Implementing `wc' in `awk' is particularly elegant, because `awk'
+does a lot of the work for us; it splits lines into words (i.e.,
+fields) and counts them, it counts lines (i.e., records), and it can
+easily tell us how long a line is.
This program uses the `getopt()' library function (*note Getopt
Function::) and the file-transition functions (*note Filetrans
@@ -17540,7 +17546,7 @@ in its length. Next, `lines' is incremented for each line read, and
---------- Footnotes ----------
- (1) Since `gawk' understands multibyte locales, this code counts
+ (1) Because `gawk' understands multibyte locales, this code counts
characters, not bytes.

@@ -17854,14 +17860,15 @@ record:
print
}
- While it is possible to do character transliteration in a user-level
-function, it is not necessarily efficient, and we (the `gawk' authors)
-started to consider adding a built-in function. However, shortly after
-writing this program, we learned that Brian Kernighan had added the
-`toupper()' and `tolower()' functions to his `awk' (*note String
-Functions::). These functions handle the vast majority of the cases
-where character transliteration is necessary, and so we chose to simply
-add those functions to `gawk' as well and then leave well enough alone.
+ It is possible to do character transliteration in a user-level
+function, but it is not necessarily efficient, and we (the `gawk'
+developers) started to consider adding a built-in function. However,
+shortly after writing this program, we learned that Brian Kernighan had
+added the `toupper()' and `tolower()' functions to his `awk' (*note
+String Functions::). These functions handle the vast majority of the
+cases where character transliteration is necessary, and so we chose to
+simply add those functions to `gawk' as well and then leave well enough
+alone.
An obvious improvement to this program would be to set up the `t_ar'
array only once, in a `BEGIN' rule. However, this assumes that the
@@ -17898,7 +17905,7 @@ been read.
The `BEGIN' rule simply sets `RS' to the empty string, so that `awk'
splits records at blank lines (*note Records::). It sets `MAXLINES' to
-100, since 100 is the maximum number of lines on the page (20 * 5 =
+100, because 100 is the maximum number of lines on the page (20 * 5 =
100).
Most of the work is done in the `printpage()' function. The label
@@ -18022,9 +18029,9 @@ on real text files:
* The `awk' language considers upper- and lowercase characters to be
distinct. Therefore, "bartender" and "Bartender" are not treated
- as the same word. This is undesirable, since in normal text, words
- are capitalized if they begin sentences, and a frequency analyzer
- should not be sensitive to capitalization.
+ as the same word. This is undesirable, because words are
+ capitalized if they begin sentences in normal text, and a
+ frequency analyzer should not be sensitive to capitalization.
* Words are detected using the `awk' convention that fields are
separated just by whitespace. Other characters in the input
@@ -18147,9 +18154,9 @@ File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorti
The nodes *note Library Functions::, and *note Sample Programs::, are
the top level nodes for a large number of `awk' programs. If you want
-to experiment with these programs, it is tedious to have to type them
-in by hand. Here we present a program that can extract parts of a
-Texinfo input file into separate files.
+to experiment with these programs, it is tedious to type them in by
+hand. Here we present a program that can extract parts of a Texinfo
+input file into separate files.
This Info file is written in Texinfo
(http://www.gnu.org/software/texinfo/), the GNU project's document
@@ -18206,7 +18213,7 @@ file looks something like this:
@example
@c file examples/messages.awk
- END @{ print "Always avoid bored archeologists!" @}
+ END @{ print "Always avoid bored archaeologists!" @}
@c end file
@end example
...
@@ -18342,15 +18349,15 @@ File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program
The `sed' utility is a stream editor, a program that reads a stream of
data, makes changes to it, and passes it on. It is often used to make
global changes to a large file or to a stream of data generated by a
-pipeline of commands. While `sed' is a complicated program in its own
-right, its most common use is to perform global substitutions in the
-middle of a pipeline:
+pipeline of commands. Although `sed' is a complicated program in its
+own right, its most common use is to perform global substitutions in
+the middle of a pipeline:
COMMAND1 < orig.data | sed 's/old/new/g' | COMMAND2 > result
Here, `s/old/new/g' tells `sed' to look for the regexp `old' on each
-input line and globally replace it with the text `new', i.e., all the
-occurrences on a line. This is similar to `awk''s `gsub()' function
+input line and globally replace it with the text `new' (i.e., all the
+occurrences on a line). This is similar to `awk''s `gsub()' function
(*note String Functions::).
The following program, `awksed.awk', accepts at least two
@@ -18411,7 +18418,7 @@ arguments and calling `usage()' if there is a problem. Then it sets
(*note ARGC and ARGV::).
The `usage()' function prints an error message and exits. Finally,
-the single rule handles the printing scheme outlined above, using
+the single rule handles the printing scheme outlined earlier, using
`print' or `printf' as appropriate, depending upon the value of `RT'.

@@ -18449,10 +18456,10 @@ to be able to write programs in the following manner:
The following program, `igawk.sh', provides this service. It
simulates `gawk''s searching of the `AWKPATH' variable and also allows
-"nested" includes; i.e., a file that is included with `@include' can
-contain further `@include' statements. `igawk' makes an effort to only
-include files once, so that nested includes don't accidentally include
-a library function twice.
+"nested" includes (i.e., a file that is included with `@include' can
+contain further `@include' statements). `igawk' makes an effort to
+only include files once, so that nested includes don't accidentally
+include a library function twice.
`igawk' should behave just like `gawk' externally. This means it
should accept all of `gawk''s command-line arguments, including the
@@ -18473,8 +18480,8 @@ language.(1) It works as follows:
b. Source file names, provided with `-f'. We use a neat trick
and append `@include FILENAME' to the shell variable's
- contents. Since the file-inclusion program works the way
- `gawk' does, this gets the text of the file included into the
+ contents. Because the file-inclusion program works the way
+ `gawk' does, this gets the text of the file included in the
program at the correct point.
3. Run an `awk' program (naturally) over the shell variable's
@@ -18734,13 +18741,13 @@ is saved as a single string, even if the results contain whitespace.
It's done in these steps:
1. Run `gawk' with the `@include'-processing program (the value of
- the `expand_prog' shell variable) on standard input.
+ the `expand_prog' shell variable) reading standard input.
2. Standard input is the contents of the user's program, from the
- shell variable `program'. Its contents are fed to `gawk' via a
- here document.
+ shell variable `program'. Feed its contents to `gawk' via a here
+ document.
- 3. The results of this processing are saved in the shell variable
+ 3. Save the results of this processing in the shell variable
`processed_program' by using command substitution.
The last step is to call `gawk' with the expanded program, along
@@ -18797,23 +18804,23 @@ use of `awk' programs as Web CGI scripts.

File: gawk.info, Node: Anagram Program, Next: Signature Program, Prev: Igawk Program, Up: Miscellaneous Programs
-11.3.10 Finding Anagrams From A Dictionary
+11.3.10 Finding Anagrams from a Dictionary
------------------------------------------
An interesting programming challenge is to search for "anagrams" in a
word list (such as `/usr/share/dict/words' on many GNU/Linux systems).
One word is an anagram of another if both words contain the same letters
-(for example, "babbling" and "blabbing").
+(e.g., "babbling" and "blabbing").
- Column 2, Problem C of Jon Bentley's `Programming Pearls', second
-edition, presents an elegant algorithm. The idea is to give words that
+ Column 2, Problem C, of Jon Bentley's `Programming Pearls', Second
+Edition, presents an elegant algorithm. The idea is to give words that
are anagrams a common signature, sort all the words together by their
signature, and then print them. Dr. Bentley observes that taking the
letters in each word and sorting them produces that common signature.
The following program uses arrays of arrays to bring together words
with the same signature and array sorting to print the words in sorted
-order.
+order:
# anagram.awk --- An implementation of the anagram finding algorithm
# from Jon Bentley's "Programming Pearls", 2nd edition.
@@ -18850,8 +18857,8 @@ back together:
}
Finally, the `END' rule traverses the array and prints out the
-anagram lists. It sends the output to the system `sort' command, since
-otherwise the anagrams would appear in arbitrary order:
+anagram lists. It sends the output to the system `sort' command
+because otherwise the anagrams would appear in arbitrary order:
END {
sort = "sort"
@@ -18886,7 +18893,7 @@ otherwise the anagrams would appear in arbitrary order:

File: gawk.info, Node: Signature Program, Prev: Anagram Program, Up: Miscellaneous Programs
-11.3.11 And Now For Something Completely Different
+11.3.11 And Now for Something Completely Different
--------------------------------------------------
The following program was written by Davide Brini and is published on
@@ -19167,7 +19174,7 @@ in a particular order that you, the programmer, choose. `gawk' lets
you do this.
*note Controlling Scanning::, describes how you can assign special,
-pre-defined values to `PROCINFO["sorted_in"]' in order to control the
+predefined values to `PROCINFO["sorted_in"]' in order to control the
order in which `gawk' traverses an array during a `for' loop.
In addition, the value of `PROCINFO["sorted_in"]' can be a function
@@ -19324,7 +19331,7 @@ Running the program produces the following output:
The comparison should normally always return the same value when
given a specific pair of array elements as its arguments. If
-inconsistent results are returned then the order is undefined. This
+inconsistent results are returned, then the order is undefined. This
behavior can be exploited to introduce random order into otherwise
seemingly ordered data:
@@ -19334,7 +19341,7 @@ seemingly ordered data:
return (2 - 4 * rand())
}
- As mentioned above, the order of the indices is arbitrary if two
+ As already mentioned, the order of the indices is arbitrary if two
elements compare equal. This is usually not a problem, but letting the
tied elements come out in arbitrary order can be an issue, especially
when comparing item values. The partial ordering of the equal elements
@@ -19368,16 +19375,16 @@ such a function.
When string comparisons are made during a sort, either for element
values where one or both aren't numbers, or for element indices handled
as strings, the value of `IGNORECASE' (*note Built-in Variables::)
-controls whether the comparisons treat corresponding uppercase and
+controls whether the comparisons treat corresponding upper- and
lowercase letters as equivalent or distinct.
- Another point to keep in mind is that in the case of subarrays the
+ Another point to keep in mind is that in the case of subarrays, the
element values can themselves be arrays; a production comparison
function should use the `isarray()' function (*note Type Functions::),
to check for this, and choose a defined sorting order for subarrays.
All sorting based on `PROCINFO["sorted_in"]' is disabled in POSIX
-mode, since the `PROCINFO' array is not special in that case.
+mode, because the `PROCINFO' array is not special in that case.
As a side note, sorting the array indices before traversing the
array has been reported to add 15% to 20% overhead to the execution
@@ -19396,10 +19403,10 @@ File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traver
---------------------------------------------------
In most `awk' implementations, sorting an array requires writing a
-`sort()' function. While this can be educational for exploring
-different sorting algorithms, usually that's not the point of the
-program. `gawk' provides the built-in `asort()' and `asorti()'
-functions (*note String Functions::) for sorting arrays. For example:
+`sort()' function. This can be educational for exploring different
+sorting algorithms, but usually that's not the point of the program.
+`gawk' provides the built-in `asort()' and `asorti()' functions (*note
+String Functions::) for sorting arrays. For example:
POPULATE THE ARRAY data
n = asort(data)
@@ -19480,8 +19487,8 @@ comparisons are based on character values only.(1)
---------- Footnotes ----------
(1) This is true because locale-based comparison occurs only when in
-POSIX compatibility mode, and since `asort()' and `asorti()' are `gawk'
-extensions, they are not available in that case.
+POSIX-compatibility mode, and because `asort()' and `asorti()' are
+`gawk' extensions, they are not available in that case.

File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features
@@ -19510,7 +19517,7 @@ the program be run in a directory that cannot be shared among users;
for example, `/tmp' will not do, as another user might happen to be
using a temporary file with the same name.(1) However, with `gawk', it
is possible to open a _two-way_ pipe to another process. The second
-process is termed a "coprocess", since it runs in parallel with `gawk'.
+process is termed a "coprocess", as it runs in parallel with `gawk'.
The two-way connection is created using the `|&' operator (borrowed
from the Korn shell, `ksh'):(2)
@@ -19626,7 +19633,7 @@ connection.
You can think of this as just a _very long_ two-way pipeline to a
coprocess. The way `gawk' decides that you want to use TCP/IP
networking is by recognizing special file names that begin with one of
-`/inet/', `/inet4/' or `/inet6/'.
+`/inet/', `/inet4/', or `/inet6/'.
The full syntax of the special file name is
`/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT'. The
@@ -19652,7 +19659,7 @@ LOCAL-PORT
`getaddrinfo()' function.
REMOTE-HOST
- The IP address or fully-qualified domain name of the Internet host
+ The IP address or fully qualified domain name of the Internet host
to which you want to connect.
REMOTE-PORT
@@ -19700,7 +19707,7 @@ used to change the name of the file where `gawk' will write the profile:
gawk --profile=myprog.prof -f myprog.awk data1 data2
-In the above example, `gawk' places the profile in `myprog.prof'
+In the preceding example, `gawk' places the profile in `myprog.prof'
instead of in `awkprof.out'.
Here is a sample session showing a simple `awk' program, its input
@@ -19831,9 +19838,9 @@ output. They are as follows:
* Parentheses are used only where needed, as indicated by the
structure of the program and the precedence rules. For example,
- `(3 + 5) * 4' means add three plus five, then multiply the total
- by four. However, `3 + 5 * 4' has no parentheses, and means `3 +
- (5 * 4)'.
+ `(3 + 5) * 4' means add three and five, then multiply the total by
+ four. However, `3 + 5 * 4' has no parentheses, and means `3 + (5
+ * 4)'.
* Parentheses are used around the arguments to `print' and `printf'
only when the `print' or `printf' statement is followed by a
@@ -20023,12 +20030,12 @@ components--programs written in C or C++, as well as scripts written in
named `guide'. Internationalization consists of the following steps,
in this order:
- 1. The programmer goes through the source for all of `guide''s
- components and marks each string that is a candidate for
- translation. For example, `"`-F': option required"' is a good
- candidate for translation. A table with strings of option names
- is not (e.g., `gawk''s `--profile' option should remain the same,
- no matter what the local language).
+ 1. The programmer reviews the source for all of `guide''s components
+ and marks each string that is a candidate for translation. For
+ example, `"`-F': option required"' is a good candidate for
+ translation. A table with strings of option names is not (e.g.,
+ `gawk''s `--profile' option should remain the same, no matter what
+ the local language).
2. The programmer indicates the application's text domain (`"guide"')
to the `gettext' library, by calling the `textdomain()' function.
@@ -20097,8 +20104,8 @@ are:
a different category.)
`LC_COLLATE'
- Text-collation information; i.e., how different characters and/or
- groups of characters sort in a given language.
+ Text-collation information (i.e., how different characters and/or
+ groups of characters sort in a given language).
`LC_CTYPE'
Character-type information (alphabetic, digit, upper- or
@@ -20403,7 +20410,7 @@ them to other versions of `awk'. Consider this program:
As written, it won't work on other versions of `awk'. However, it is
actually almost portable, requiring very little change:
- * Assignments to `TEXTDOMAIN' won't have any effect, since
+ * Assignments to `TEXTDOMAIN' won't have any effect, because
`TEXTDOMAIN' is not special in other `awk' implementations.
* Non-GNU versions of `awk' treat marked strings as the
@@ -20439,10 +20446,10 @@ actually almost portable, requiring very little change:
and arguments unchanged to the underlying C library version of
`sprintf()', but only one format and argument at a time. What
happens if a positional specification is used is anybody's guess.
- However, since the positional specifications are primarily for use
- in _translated_ format strings, and since non-GNU `awk's never
- retrieve the translated string, this should not be a problem in
- practice.
+ However, because the positional specifications are primarily for
+ use in _translated_ format strings, and because non-GNU `awk's
+ never retrieve the translated string, this should not be a problem
+ in practice.
---------- Footnotes ----------
@@ -20505,7 +20512,7 @@ Following are the translations:
The next step is to make the directory to hold the binary message
object file and then to create the `guide.mo' file. We pretend that
-our file is to be used in the `en_US.UTF-8' locale, since we have to
+our file is to be used in the `en_US.UTF-8' locale, because we have to
use a locale name known to the C `gettext' routines. The directory
layout shown here is standard for GNU `gettext' on GNU/Linux systems.
Other versions of `gettext' may use a different layout:
@@ -20526,7 +20533,7 @@ proper directory (using the `-o' option) so that `gawk' can find it:
-| Like, the scoop is 42
-| Pardon me, Zaphod who?
- If the three replacement functions for `dcgettext()', `dcngettext()'
+ If the three replacement functions for `dcgettext()', `dcngettext()',
and `bindtextdomain()' (*note I18N Portability::) are in a file named
`libintl.awk', then we can run `guide.awk' unchanged as follows:
@@ -20615,7 +20622,7 @@ program is easy.

File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger
-14.1 Introduction to The `gawk' Debugger
+14.1 Introduction to the `gawk' Debugger
========================================
This minor node introduces debugging in general and begins the
@@ -20637,9 +20644,9 @@ File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debuggi
ahead to the next section on the specific features of the `gawk'
debugger.)
- Of course, a debugging program cannot remove bugs for you, since it
-has no way of knowing what you or your users consider a "bug" and what
-is a "feature." (Sometimes, we humans have a hard time with this
+ Of course, a debugging program cannot remove bugs for you, because
+it has no way of knowing what you or your users consider a "bug" versus
+a "feature." (Sometimes, we humans have a hard time with this
ourselves.) In that case, what can you expect from such a tool? The
answer to that depends on the language being debugged, but in general,
you can expect at least the following:
@@ -20655,7 +20662,7 @@ you can expect at least the following:
* The chance to see the values of data in the program at any point in
execution, and also to change that data on the fly, to see how that
- affects what happens afterwards. (This often includes the ability
+ affects what happens afterward. (This often includes the ability
to look at internal data structures besides the variables you
actually defined in your code.)
@@ -20675,9 +20682,9 @@ File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging
Before diving in to the details, we need to introduce several important
concepts that apply to just about all debuggers. The following list
-defines terms used throughout the rest of this major node.
+defines terms used throughout the rest of this major node:
-"Stack Frame"
+"Stack frame"
Programs generally call functions during the course of their
execution. One function can call another, or a function can call
itself (recursion). You can view the chain of called functions
@@ -20713,11 +20720,11 @@ defines terms used throughout the rest of this major node.
breakpoints are oriented around the code: stop when a certain
point in the code is reached. A watchpoint, however, specifies
that program execution should stop when a _data value_ is changed.
- This is useful, since sometimes it happens that a variable
- receives an erroneous value, and it's hard to track down where
- this happens just by looking at the code. By using a watchpoint,
- you can stop whenever a variable is assigned to, and usually find
- the errant code quite quickly.
+ This is useful, as sometimes it happens that a variable receives
+ an erroneous value, and it's hard to track down where this happens
+ just by looking at the code. By using a watchpoint, you can stop
+ whenever a variable is assigned to, and usually find the errant
+ code quite quickly.

File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging
@@ -20728,16 +20735,16 @@ File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging
Debugging an `awk' program has some specific aspects that are not
shared with other programming languages.
- First of all, the fact that `awk' programs usually take input
-line-by-line from a file or files and operate on those lines using
-specific rules makes it especially useful to organize viewing the
-execution of the program in terms of these rules. As we will see, each
-`awk' rule is treated almost like a function call, with its own
-specific block of instructions.
+ First of all, the fact that `awk' programs usually take input line
+by line from a file or files and operate on those lines using specific
+rules makes it especially useful to organize viewing the execution of
+the program in terms of these rules. As we will see, each `awk' rule
+is treated almost like a function call, with its own specific block of
+instructions.
- In addition, since `awk' is by design a very concise language, it is
-easy to lose sight of everything that is going on "inside" each line of
-`awk' code. The debugger provides the opportunity to look at the
+ In addition, because `awk' is by design a very concise language, it
+is easy to lose sight of everything that is going on "inside" each line
+of `awk' code. The debugger provides the opportunity to look at the
individual primitive instructions carried out by the higher-level `awk'
commands.
@@ -20848,8 +20855,8 @@ the current stack frames:
-| #1 in main() at `awklib/eg/prog/uniq.awk':88
This tells us that `are_equal()' was called by the main program at
-line 88 of `uniq.awk'. (This is not a big surprise, since this is the
-only call to `are_equal()' in the program, but in more complex
+line 88 of `uniq.awk'. (This is not a big surprise, because this is
+the only call to `are_equal()' in the program, but in more complex
programs, knowing who called a function and with what parameters can be
the key to finding the source of the problem.)
@@ -20861,7 +20868,7 @@ Actually, the debugger gives us:
gawk> p n
-| n = untyped variable
-In this case, `n' is an uninitialized local variable, since the
+In this case, `n' is an uninitialized local variable, because the
function was called without arguments (*note Function Calls::).
A more useful variable to display might be the current record:
@@ -20869,8 +20876,8 @@ function was called without arguments (*note Function Calls::).
gawk> p $0
-| $0 = "gawk is a wonderful program!"
-This might be a bit puzzling at first since this is the second line of
-our test input above. Let's look at `NR':
+This might be a bit puzzling at first, as this is the second line of
+our test input. Let's look at `NR':
gawk> p NR
-| NR = 2
@@ -20901,7 +20908,7 @@ typing `n' (for "next"):
This tells us that `gawk' is now ready to execute line 66, which
decides whether to give the lines the special "field skipping" treatment
indicated by the `-1' command-line option. (Notice that we skipped
-from where we were before at line 63 to here, since the condition in
+from where we were before at line 63 to here, because the condition in
line 63 `if (fcount == 0 && charcount == 0)' was false.)
Continuing to step, we now get to the splitting of the current and
@@ -20926,9 +20933,9 @@ split into, so we try to look:
This is kind of disappointing, though. All we found out is that
there are five elements in `alast'; `m' and `aline' don't have values
-since we are at line 68 but haven't executed it yet. This information
-is useful enough (we now know that none of the words were accidentally
-left out), but what if we want to see inside the array?
+because we are at line 68 but haven't executed it yet. This
+information is useful enough (we now know that none of the words were
+accidentally left out), but what if we want to see inside the array?
The first choice would be to use subscripts:
@@ -21010,7 +21017,7 @@ abbreviation on a second description line. A debugger command name may
also be truncated if that partial name is unambiguous. The debugger has
the built-in capability to automatically repeat the previous command
just by hitting <Enter>. This works for the commands `list', `next',
-`nexti', `step', `stepi' and `continue' executed without any argument.
+`nexti', `step', `stepi', and `continue' executed without any argument.
* Menu:
@@ -21028,10 +21035,10 @@ File: gawk.info, Node: Breakpoint Control, Next: Debugger Execution Control,
14.3.1 Control of Breakpoints
-----------------------------
-As we saw above, the first thing you probably want to do in a debugging
-session is to get your breakpoints set up, since otherwise your program
-will just run as if it was not under the debugger. The commands for
-controlling breakpoints are:
+As we saw earlier, the first thing you probably want to do in a
+debugging session is to get your breakpoints set up, because your
+program will otherwise just run as if it was not under the debugger.
+The commands for controlling breakpoints are:
`break' [[FILENAME`:']N | FUNCTION] [`"EXPRESSION"']
`b' [[FILENAME`:']N | FUNCTION] [`"EXPRESSION"']
@@ -21083,8 +21090,8 @@ controlling breakpoints are:
reached. If the condition is true, then the debugger stops
execution and prompts for a command. Otherwise, the debugger
continues executing the program. If the condition expression is
- not specified, any existing condition is removed; i.e., the
- breakpoint or watchpoint is made unconditional.
+ not specified, any existing condition is removed (i.e., the
+ breakpoint or watchpoint is made unconditional).
`delete' [N1 N2 ...] [N-M]
`d' [N1 N2 ...] [N-M]
@@ -21175,7 +21182,7 @@ execution of the program than we saw in our earlier example:
Cancel execution of a function call. If VALUE (either a string or a
number) is specified, it is used as the function's return value.
If used in a frame other than the innermost one (the currently
- executing function, i.e., frame number 0), discard all inner
+ executing function; i.e., frame number 0), discard all inner
frames in addition to the selected one, and the caller of that
frame becomes the innermost frame.
@@ -21223,7 +21230,7 @@ The commands for viewing and changing variables inside of `gawk' are:
gawk> display x
-| 10: x = 1
- displays the assigned item number, the variable name and its
+ This displays the assigned item number, the variable name, and its
current value. If the display variable refers to a function
parameter, it is silently deleted from the list as soon as the
execution reaches a context where no such variable of the given
@@ -21272,7 +21279,7 @@ AWK STATEMENTS
(`"'...`"').
You can also set special `awk' variables, such as `FS', `NF',
- `NR', etc.
+ `NR', and son on.
`watch' VAR | `$'N [`"EXPRESSION"']
`w' VAR | `$'N [`"EXPRESSION"']
@@ -21316,8 +21323,8 @@ are:
innermost COUNT frames if COUNT > 0. Print the outermost COUNT
frames if COUNT < 0. The backtrace displays the name and
arguments to each function, the source file name, and the line
- number. The alias `where' for `backtrace' is provided for
- long-time GDB users who may be used to that command.
+ number. The alias `where' for `backtrace' is provided for longtime
+ GDB users who may be used to that command.
`down' [COUNT]
Move COUNT (default 1) frames down the stack toward the innermost
@@ -21339,7 +21346,7 @@ are:

File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Prev: Execution Stack, Up: List of Debugger Commands
-14.3.5 Obtaining Information about the Program and the Debugger State
+14.3.5 Obtaining Information About the Program and the Debugger State
---------------------------------------------------------------------
Besides looking at the values of variables, there is often a need to get
@@ -21465,39 +21472,39 @@ categories, as follows:
gawk> dump
-| # BEGIN
-|
- -| [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
- -| [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR]
- -| [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR]
- -| [ 1:0xfcc280] Op_match :
- -| [ 1:0xfcc1e0] Op_store_var : O
- -| [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR]
- -| [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR]
- -| [ 1:0xfcc320] Op_equal :
- -| [ 1:0xfcc200] Op_store_var : o
- -| [ 1:0xfcc380] Op_push : o
- -| [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER]
- -| [ 1:0xfcc220] Op_push_lhs : o [do_reference = true]
- -| [ 1:0xfcc300] Op_assign_plus :
- -| [ :0xfcc2c0] Op_pop :
- -| [ 1:0xfcc400] Op_push : O
- -| [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR]
- -| [ :0xfcc4a0] Op_no_op :
- -| [ 1:0xfcc480] Op_push : O
- -| [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0]
- -| [ 1:0xfcc3c0] Op_store_var : x
- -| [ 1:0xfcc440] Op_push_lhs : X [do_reference = true]
- -| [ 1:0xfcc3a0] Op_postincrement :
- -| [ 1:0xfcc4e0] Op_push : x
- -| [ 1:0xfcc540] Op_push : o
- -| [ 1:0xfcc500] Op_plus :
- -| [ 1:0xfcc580] Op_push : o
- -| [ 1:0xfcc560] Op_plus :
- -| [ 1:0xfcc460] Op_leq :
- -| [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0]
- -| [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR]
- -| [ :0xfcc660] Op_no_op :
- -| [ 1:0xfcc520] Op_assign_concat : c
- -| [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440]
+ -| [ 1:0xfcd340] Op_rule : [in_rule = BEGIN] [source_file = brini.awk]
+ -| [ 1:0xfcc240] Op_push_i : "~" [MALLOC|STRING|STRCUR]
+ -| [ 1:0xfcc2a0] Op_push_i : "~" [MALLOC|STRING|STRCUR]
+ -| [ 1:0xfcc280] Op_match :
+ -| [ 1:0xfcc1e0] Op_store_var : O
+ -| [ 1:0xfcc2e0] Op_push_i : "==" [MALLOC|STRING|STRCUR]
+ -| [ 1:0xfcc340] Op_push_i : "==" [MALLOC|STRING|STRCUR]
+ -| [ 1:0xfcc320] Op_equal :
+ -| [ 1:0xfcc200] Op_store_var : o
+ -| [ 1:0xfcc380] Op_push : o
+ -| [ 1:0xfcc360] Op_plus_i : 0 [MALLOC|NUMCUR|NUMBER]
+ -| [ 1:0xfcc220] Op_push_lhs : o [do_reference = true]
+ -| [ 1:0xfcc300] Op_assign_plus :
+ -| [ :0xfcc2c0] Op_pop :
+ -| [ 1:0xfcc400] Op_push : O
+ -| [ 1:0xfcc420] Op_push_i : "" [MALLOC|STRING|STRCUR]
+ -| [ :0xfcc4a0] Op_no_op :
+ -| [ 1:0xfcc480] Op_push : O
+ -| [ :0xfcc4c0] Op_concat : [expr_count = 3] [concat_flag = 0]
+ -| [ 1:0xfcc3c0] Op_store_var : x
+ -| [ 1:0xfcc440] Op_push_lhs : X [do_reference = true]
+ -| [ 1:0xfcc3a0] Op_postincrement :
+ -| [ 1:0xfcc4e0] Op_push : x
+ -| [ 1:0xfcc540] Op_push : o
+ -| [ 1:0xfcc500] Op_plus :
+ -| [ 1:0xfcc580] Op_push : o
+ -| [ 1:0xfcc560] Op_plus :
+ -| [ 1:0xfcc460] Op_leq :
+ -| [ :0xfcc5c0] Op_jmp_false : [target_jmp = 0xfcc5e0]
+ -| [ 1:0xfcc600] Op_push_i : "%c" [MALLOC|STRING|STRCUR]
+ -| [ :0xfcc660] Op_no_op :
+ -| [ 1:0xfcc520] Op_assign_concat : c
+ -| [ :0xfcc620] Op_jmp : [target_jmp = 0xfcc440]
-|
...
-|
@@ -21548,10 +21555,10 @@ categories, as follows:
`q'
Exit the debugger. Debugging is great fun, but sometimes we all
have to tend to other obligations in life, and sometimes we find
- the bug, and are free to go on to the next one! As we saw above,
- if you are running a program, the debugger warns you if you
- accidentally type `q' or `quit', to make sure you really want to
- quit.
+ the bug, and are free to go on to the next one! As we saw
+ earlier, if you are running a program, the debugger warns you if
+ you accidentally type `q' or `quit', to make sure you really want
+ to quit.
`trace' [`on' | `off']
Turn on or off a continuous printing of instructions which are
@@ -21610,7 +21617,8 @@ some limitations. A few which are worth being aware of are:
Commands:: (or if you are already familiar with `gawk' internals),
you will realize that much of the internal manipulation of data in
`gawk', as in many interpreters, is done on a stack. `Op_push',
- `Op_pop', etc., are the "bread and butter" of most `gawk' code.
+ `Op_pop', and the like, are the "bread and butter" of most `gawk'
+ code.
Unfortunately, as of now, the `gawk' debugger does not allow you
to examine the stack's contents. That is, the intermediate
@@ -21622,7 +21630,7 @@ some limitations. A few which are worth being aware of are:
* There is no way to look "inside" the process of compiling regular
expressions to see if you got it right. As an `awk' programmer,
- you are expected to know what `/[^[:alnum:][:blank:]]/' means.
+ you are expected to know the meaning of `/[^[:alnum:][:blank:]]/'.
* The `gawk' debugger is designed to be used by running a program
(with all its parameters) on the command line, as described in
@@ -21666,17 +21674,17 @@ File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger

File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top
-15 Arithmetic and Arbitrary Precision Arithmetic with `gawk'
+15 Arithmetic and Arbitrary-Precision Arithmetic with `gawk'
************************************************************
This major node introduces some basic concepts relating to how
computers do arithmetic and defines some important terms. It then
proceeds to describe floating-point arithmetic, which is what `awk'
-uses for all its computations, including a discussion of arbitrary
-precision floating point arithmetic, which is a feature available only
-in `gawk'. It continues on to present arbitrary precision integers, and
-concludes with a description of some points where `gawk' and the POSIX
-standard are not quite in agreement.
+uses for all its computations, including a discussion of
+arbitrary-precision floating-point arithmetic, which is a feature
+available only in `gawk'. It continues on to present
+arbitrary-precision integers, and concludes with a description of some
+points where `gawk' and the POSIX standard are not quite in agreement.
NOTE: Most users of `gawk' can safely skip this chapter. But if
you want to do scientific calculations with `gawk', this is the
@@ -21736,37 +21744,37 @@ Integer arithmetic
In computers, integer values come in two flavors: "signed" and
"unsigned". Signed values may be negative or positive, whereas
- unsigned values are always positive (that is, greater than or equal
+ unsigned values are always positive (i.e., greater than or equal
to zero).
In computer systems, integer arithmetic is exact, but the possible
range of values is limited. Integer arithmetic is generally
- faster than floating point arithmetic.
+ faster than floating-point arithmetic.
-Floating point arithmetic
+Floating-point arithmetic
Floating-point numbers represent what were called in school "real"
- numbers; i.e., those that have a fractional part, such as
- 3.1415927. The advantage to floating-point numbers is that they
+ numbers (i.e., those that have a fractional part, such as
+ 3.1415927). The advantage to floating-point numbers is that they
can represent a much larger range of values than can integers.
The disadvantage is that there are numbers that they cannot
represent exactly.
- Modern systems support floating point arithmetic in hardware, with
+ Modern systems support floating-point arithmetic in hardware, with
a limited range of values. There are software libraries that allow
- the use of arbitrary precision floating point calculations.
+ the use of arbitrary-precision floating-point calculations.
- POSIX `awk' uses "double precision" floating-point numbers, which
- can hold more digits than "single precision" floating-point
- numbers. `gawk' has facilities for performing arbitrary precision
- floating point arithmetic, which we describe in more detail
+ POSIX `awk' uses "double-precision" floating-point numbers, which
+ can hold more digits than "single-precision" floating-point
+ numbers. `gawk' has facilities for performing arbitrary-precision
+ floating-point arithmetic, which we describe in more detail
shortly.
- Computers work with integer and floating point values of different
-ranges. Integer values are usually either 32 or 64 bits in size. Single
-precision floating point values occupy 32 bits, whereas double precision
-floating point values occupy 64 bits. Floating point values are always
-signed. The possible ranges of values are shown in *note
-table-numeric-ranges::.
+ Computers work with integer and floating-point values of different
+ranges. Integer values are usually either 32 or 64 bits in size.
+Single-precision floating-point values occupy 32 bits, whereas
+double-precision floating-point values occupy 64 bits. Floating-point
+values are always signed. The possible ranges of values are shown in
+*note table-numeric-ranges::.
Numeric representation Minimum value Maximum value
---------------------------------------------------------------------------
@@ -21774,14 +21782,14 @@ Numeric representation Minimum value Maximum value
32-bit unsigned integer 0 4,294,967,295
64-bit signed integer -9,223,372,036,854,775,8089,223,372,036,854,775,807
64-bit unsigned integer 0 18,446,744,073,709,551,615
-Single precision `1.175494e-38' `3.402823e+38'
+Single-precision `1.175494e-38' `3.402823e+38'
floating point
(approximate)
-Double precision `2.225074e-308' `1.797693e+308'
+Double-precision `2.225074e-308' `1.797693e+308'
floating point
(approximate)
-Table 15.1: Value Ranges for Different Numeric Representations
+Table 15.1: Value ranges for different numeric representations
---------- Footnotes ----------
@@ -21790,7 +21798,7 @@ Table 15.1: Value Ranges for Different Numeric Representations

File: gawk.info, Node: Math Definitions, Next: MPFR features, Prev: Computer Arithmetic, Up: Arbitrary Precision Arithmetic
-15.2 Other Stuff To Know
+15.2 Other Stuff to Know
========================
The rest of this major node uses a number of terms. Here are some
@@ -21849,7 +21857,7 @@ material here.
are provided later.
"Significand"
- A floating point value consists the significand multiplied by 10
+ A floating-point value consists the significand multiplied by 10
to the power of the exponent. For example, in `1.2345e67', the
significand is `1.2345'.
@@ -21865,10 +21873,10 @@ information on some of those terms.
On modern systems, floating-point hardware uses the representation
and operations defined by the IEEE 754 standard. Three of the standard
-IEEE 754 types are 32-bit single precision, 64-bit double precision and
-128-bit quadruple precision. The standard also specifies extended
+IEEE 754 types are 32-bit single precision, 64-bit double precision,
+and 128-bit quadruple precision. The standard also specifies extended
precision formats to allow greater precisions and larger exponent
-ranges. (`awk' uses only the 64-bit double precision format.)
+ranges. (`awk' uses only the 64-bit double-precision format.)
*note table-ieee-formats:: lists the precision and exponent field
values for the basic IEEE 754 binary formats:
@@ -21880,7 +21888,7 @@ Single 32 24 -126 +127
Double 64 53 -1022 +1023
Quadruple 128 113 -16382 +16383
-Table 15.2: Basic IEEE Format Values
+Table 15.2: Basic IEEE format values
NOTE: The precision numbers include the implied leading one that
gives them one extra bit of significand.
@@ -21893,13 +21901,13 @@ paraphrased, and for the examples.

File: gawk.info, Node: MPFR features, Next: FP Math Caution, Prev: Math Definitions, Up: Arbitrary Precision Arithmetic
-15.3 Arbitrary Precision Arithmetic Features In `gawk'
+15.3 Arbitrary-Precision Arithmetic Features in `gawk'
======================================================
-By default, `gawk' uses the double precision floating-point values
+By default, `gawk' uses the double-precision floating-point values
supplied by the hardware of the system it runs on. However, if it was
-compiled to do so, `gawk' uses the `http://www.mpfr.org GNU MPFR' and
-GNU MP (http://gmplib.org) (GMP) libraries for arbitrary precision
+compiled to do so, `gawk' uses the GNU MPFR (http://www.mpfr.org) and
+GNU MP (http://gmplib.org) (GMP) libraries for arbitrary-precision
arithmetic on numbers. You can see if MPFR support is available like
so:
@@ -21931,7 +21939,7 @@ more information.

File: gawk.info, Node: FP Math Caution, Next: Arbitrary Precision Integers, Prev: MPFR features, Up: Arbitrary Precision Arithmetic
-15.4 Floating Point Arithmetic: Caveat Emptor!
+15.4 Floating-Point Arithmetic: Caveat Emptor!
==============================================
Math class is tough! -- Teen Talk Barbie, July 1992
@@ -21965,7 +21973,7 @@ in computer science.

File: gawk.info, Node: Inexactness of computations, Next: Getting Accuracy, Up: FP Math Caution
-15.4.1 Floating Point Arithmetic Is Not Exact
+15.4.1 Floating-Point Arithmetic Is Not Exact
---------------------------------------------
Binary floating-point representations and arithmetic are inexact.
@@ -21973,9 +21981,10 @@ Simple values like 0.1 cannot be precisely represented using binary
floating-point numbers, and the limited precision of floating-point
numbers means that slight changes in the order of operations or the
precision of intermediate storage can change the result. To make
-matters worse, with arbitrary precision floating-point, you can set the
-precision before starting a computation, but then you cannot be sure of
-the number of significant decimal places in the final result.
+matters worse, with arbitrary-precision floating-point arithmetic, you
+can set the precision before starting a computation, but then you
+cannot be sure of the number of significant decimal places in the final
+result.
* Menu:
@@ -21997,8 +22006,8 @@ the following example:
y = 0.425
Unlike the number in `y', the number stored in `x' is exactly
-representable in binary since it can be written as a finite sum of one
-or more fractions whose denominators are all powers of two. When
+representable in binary because it can be written as a finite sum of
+one or more fractions whose denominators are all powers of two. When
`gawk' reads a floating-point number from program source, it
automatically rounds that number to whatever precision your machine
supports. If you try to print the numeric content of a variable using
@@ -22031,7 +22040,7 @@ work like you would expect:
The general wisdom when comparing floating-point values is to see if
they are within some small range of each other (called a "delta", or
"tolerance"). You have to decide how small a delta is important to
-you. Code to do this looks something like this:
+you. Code to do this looks something like the following:
delta = 0.00001 # for example
difference = abs(a) - abs(b) # subtract the two values
@@ -22051,7 +22060,7 @@ File: gawk.info, Node: Errors accumulate, Prev: Comparing FP Values, Up: Inex
The loss of accuracy during a single computation with floating-point
numbers usually isn't enough to worry about. However, if you compute a
-value which is the result of a sequence of floating point operations,
+value which is the result of a sequence of floating-point operations,
the error can accumulate and greatly affect the computation itself.
Here is an attempt to compute the value of pi using one of its many
series representations:
@@ -22094,10 +22103,10 @@ representations yield an unexpected result:

File: gawk.info, Node: Getting Accuracy, Next: Try To Round, Prev: Inexactness of computations, Up: FP Math Caution
-15.4.2 Getting The Accuracy You Need
+15.4.2 Getting the Accuracy You Need
------------------------------------
-Can arbitrary precision arithmetic give exact results? There are no
+Can arbitrary-precision arithmetic give exact results? There are no
easy answers. The standard rules of algebra often do not apply when
using floating-point arithmetic. Among other things, the distributive
and associative laws do not hold completely, and order of operation may
@@ -22105,7 +22114,7 @@ be important for your computation. Rounding error, cumulative precision
loss and underflow are often troublesome.
When `gawk' tests the expressions `0.1 + 12.2' and `12.3' for
-equality using the machine double precision arithmetic, it decides that
+equality using the machine double-precision arithmetic, it decides that
they are not equal! (*Note Comparing FP Values::.) You can get the
result you want by increasing the precision; 56 bits in this case does
the job:
@@ -22124,15 +22133,15 @@ value of `PREC':
forget that the finite number of bits used to store the value is often
just an approximation after proper rounding. The test for equality
succeeds if and only if _all_ bits in the two operands are exactly the
-same. Since this is not necessarily true after floating-point
+same. Because this is not necessarily true after floating-point
computations with a particular precision and effective rounding mode, a
straight test for equality may not work. Instead, compare the two
numbers to see if they are within the desirable delta of each other.
In applications where 15 or fewer decimal places suffice, hardware
-double precision arithmetic can be adequate, and is usually much faster.
+double-precision arithmetic can be adequate, and is usually much faster.
But you need to keep in mind that every floating-point operation can
-suffer a new rounding error with catastrophic consequences as
+suffer a new rounding error with catastrophic consequences, as
illustrated by our earlier attempt to compute the value of pi. Extra
precision can greatly enhance the stability and the accuracy of your
computation in such cases.
@@ -22154,10 +22163,10 @@ hand is often the correct approach in such situations.

File: gawk.info, Node: Try To Round, Next: Setting precision, Prev: Getting Accuracy, Up: FP Math Caution
-15.4.3 Try A Few Extra Bits of Precision and Rounding
+15.4.3 Try a Few Extra Bits of Precision and Rounding
-----------------------------------------------------
-Instead of arbitrary precision floating-point arithmetic, often all you
+Instead of arbitrary-precision floating-point arithmetic, often all you
need is an adjustment of your logic or a different order for the
operations in your calculation. The stability and the accuracy of the
computation of pi in the earlier example can be enhanced by using the
@@ -22165,7 +22174,7 @@ following simple algebraic transformation:
(sqrt(x * x + 1) - 1) / x == x / (sqrt(x * x + 1) + 1)
-After making this, change the program converges to pi in under 30
+After making this change, the program converges to pi in under 30
iterations:
$ gawk -f pi2.awk
@@ -22181,7 +22190,7 @@ iterations:

File: gawk.info, Node: Setting precision, Next: Setting the rounding mode, Prev: Try To Round, Up: FP Math Caution
-15.4.4 Setting The Precision
+15.4.4 Setting the Precision
----------------------------
`gawk' uses a global working precision; it does not keep track of the
@@ -22195,13 +22204,13 @@ binary format.
`PREC' IEEE 754 Binary Format
---------------------------------------------------
-`"half"' 16-bit half-precision.
-`"single"' Basic 32-bit single precision.
-`"double"' Basic 64-bit double precision.
-`"quad"' Basic 128-bit quadruple precision.
-`"oct"' 256-bit octuple precision.
+`"half"' 16-bit half-precision
+`"single"' Basic 32-bit single precision
+`"double"' Basic 64-bit double precision
+`"quad"' Basic 128-bit quadruple precision
+`"oct"' 256-bit octuple precision
-Table 15.3: Predefined Precision Strings For `PREC'
+Table 15.3: Predefined precision strings for `PREC'
The following example illustrates the effects of changing precision
on arithmetic operations:
@@ -22238,7 +22247,7 @@ on arithmetic operations:

File: gawk.info, Node: Setting the rounding mode, Prev: Setting precision, Up: FP Math Caution
-15.4.5 Setting The Rounding Mode
+15.4.5 Setting the Rounding Mode
--------------------------------
The `ROUNDMODE' variable provides program level control over the
@@ -22254,13 +22263,13 @@ Round toward zero `roundTowardZero' `"Z"' or `"z"'
Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"'
from zero
-Table 15.4: `gawk' Rounding Modes
+Table 15.4: `gawk' rounding modes
`ROUNDMODE' has the default value `"N"', which selects the IEEE 754
rounding mode `roundTiesToEven'. In *note Table 15.4:
table-gawk-rounding-modes, the value `"A"' selects `roundTiesToAway'.
This is only available if your version of the MPFR library supports it;
-otherwise setting `ROUNDMODE' to `"A"' has no effect.
+otherwise, setting `ROUNDMODE' to `"A"' has no effect.
The default mode `roundTiesToEven' is the most preferred, but the
least intuitive. This method does the obvious thing for most values, by
@@ -22328,16 +22337,16 @@ to round halfway cases for `printf'.

File: gawk.info, Node: Arbitrary Precision Integers, Next: POSIX Floating Point Problems, Prev: FP Math Caution, Up: Arbitrary Precision Arithmetic
-15.5 Arbitrary Precision Integer Arithmetic with `gawk'
+15.5 Arbitrary-Precision Integer Arithmetic with `gawk'
=======================================================
When given the `-M' option, `gawk' performs all integer arithmetic
-using GMP arbitrary precision integers. Any number that looks like an
-integer in a source or data file is stored as an arbitrary precision
+using GMP arbitrary-precision integers. Any number that looks like an
+integer in a source or data file is stored as an arbitrary-precision
integer. The size of the integer is limited only by the available
memory. For example, the following computes 5^4^3^2, the result of
-which is beyond the limits of ordinary hardware double precision
-floating point values:
+which is beyond the limits of ordinary hardware double-precision
+floating-point values:
$ gawk -M 'BEGIN {
> x = 5^4^3^2
@@ -22347,10 +22356,10 @@ floating point values:
-| number of digits = 183231
-| 62060698786608744707 ... 92256259918212890625
- If instead you were to compute the same value using arbitrary
-precision floating-point values, the precision needed for correct
-output (using the formula `prec = 3.322 * dps'), would be 3.322 x
-183231, or 608693.
+ If instead you were to compute the same value using
+arbitrary-precision floating-point values, the precision needed for
+correct output (using the formula `prec = 3.322 * dps'), would be 3.322
+x 183231, or 608693.
The result from an arithmetic operation with an integer and a
floating-point value is a floating-point value with a precision equal
@@ -22373,10 +22382,10 @@ case), or replace the floating-point constant `2.0' with an integer, to
perform all computations using integer arithmetic to get the correct
output.
- Sometimes `gawk' must implicitly convert an arbitrary precision
-integer into an arbitrary precision floating-point value. This is
+ Sometimes `gawk' must implicitly convert an arbitrary-precision
+integer into an arbitrary-precision floating-point value. This is
primarily because the MPFR library does not always provide the relevant
-interface to process arbitrary precision integers or mixed-mode numbers
+interface to process arbitrary-precision integers or mixed-mode numbers
as needed by an operation or function. In such a case, the precision is
set to the minimum value necessary for exact conversion, and the working
precision is not used for this purpose. If this is not what you need or
@@ -22390,8 +22399,8 @@ floating-point value to begin with:
gawk -M 'BEGIN { n = 13.0; print n % 2.0 }'
- Note that for the particular example above, it is likely best to
-just use the following:
+ Note that for this particular example, it is likely best to just use
+the following:
gawk -M 'BEGIN { n = 13; print n % 2 }'
@@ -22417,12 +22426,12 @@ that `awk' only understands decimal numbers (base 10), and not octal
interpreted to imply that `awk' should support additional features.
These features are:
- * Interpretation of floating point data values specified in
+ * Interpretation of floating-point data values specified in
hexadecimal notation (e.g., `0xDEADBEEF'). (Note: data values,
_not_ source code constants.)
- * Support for the special IEEE 754 floating point values "Not A
- Number" (NaN), positive Infinity ("inf") and negative Infinity
+ * Support for the special IEEE 754 floating-point values "Not A
+ Number" (NaN), positive Infinity ("inf"), and negative Infinity
("-inf"). In particular, the format for these values is as
specified by the ISO 1999 C standard, which ignores case and can
allow implementation-dependent additional characters after the
@@ -22431,9 +22440,9 @@ These features are:
The first problem is that both of these are clear changes to
historical practice:
- * The `gawk' maintainer feels that supporting hexadecimal floating
- point values, in particular, is ugly, and was never intended by the
- original designers to be part of the language.
+ * The `gawk' maintainer feels that supporting hexadecimal
+ floating-point values, in particular, is ugly, and was never
+ intended by the original designers to be part of the language.
* Allowing completely alphabetic strings to have valid numeric
values is also a very severe departure from historical practice.
@@ -22444,10 +22453,10 @@ interpretation of the standard, which requires a certain amount of
intended by the standard developers. In other words, "we see how you
got where you are, but we don't think that that's where you want to be."
- Recognizing the above issues, but attempting to provide compatibility
+ Recognizing these issues, but attempting to provide compatibility
with the earlier versions of the standard, the 2008 POSIX standard
added explicit wording to allow, but not require, that `awk' support
-hexadecimal floating point values and special values for "Not A Number"
+hexadecimal floating-point values and special values for "Not A Number"
and infinity.
Although the `gawk' maintainer continues to feel that providing
@@ -22496,11 +22505,11 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob
============
* Most computer arithmetic is done using either integers or
- floating-point values. Standard `awk' uses double precision
+ floating-point values. Standard `awk' uses double-precision
floating-point values.
- * In the early 1990's, Barbie mistakenly said "Math class is tough!"
- While math isn't tough, floating-point arithmetic isn't the same
+ * In the early 1990s, Barbie mistakenly said "Math class is tough!"
+ Although math isn't tough, floating-point arithmetic isn't the same
as pencil and paper math, and care must be taken:
- Not all numbers can be represented exactly.
@@ -22521,7 +22530,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob
set the precision in bits, and `ROUNDMODE' to set the IEEE 754
rounding mode.
- * With `-M', `gawk' performs arbitrary precision integer arithmetic
+ * With `-M', `gawk' performs arbitrary-precision integer arithmetic
using the GMP library. This is faster and more space efficient
than using MPFR for the same calculations.
@@ -22533,7 +22542,7 @@ File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Prob
results from floating-point arithmetic. The lesson to remember is
that floating-point arithmetic is always more complex than
arithmetic using pencil and paper. In order to take advantage of
- the power of computer floating-point, you need to know its
+ the power of computer floating point, you need to know its
limitations and work within them. For most casual use of
floating-point arithmetic, you will often get the expected result
if you simply round the display of your final results to the
@@ -22595,8 +22604,8 @@ routines that could be of use. As with most software, "the sky is the
limit;" if you can imagine something that you might want to do and can
write in C or C++, you can write an extension to do it!
- Extensions are written in C or C++, using the "Application
-Programming Interface" (API) defined for this purpose by the `gawk'
+ Extensions are written in C or C++, using the "application
+programming interface" (API) defined for this purpose by the `gawk'
developers. The rest of this major node explains the facilities that
the API provides and how to use them, and presents a small example
extension. In addition, it documents the sample extensions included in
@@ -22627,7 +22636,7 @@ the symbol exists in the global scope. Something like this is enough:

File: gawk.info, Node: Extension Mechanism Outline, Next: Extension API Description, Prev: Plugin License, Up: Dynamic Extensions
-16.3 At A High Level How It Works
+16.3 How It Works at a High Level
=================================
Communication between `gawk' and an extension is two-way. First, when
@@ -22659,7 +22668,7 @@ figure-load-extension::.
+-------+-+---+-+---+-+------------------+--------------------+
gawk Main Program Address Space Extension
-Figure 16.1: Loading The Extension
+Figure 16.1: Loading the extension
The extension can call functions inside `gawk' through these
function pointers, at runtime, without needing (link-time) access to
@@ -22679,7 +22688,7 @@ figure-register-new-function::.
+-------+-+---+-+---+-+------------------+--------------+-+---+
gawk Main Program Address Space Extension
-Figure 16.2: Registering A New Function
+Figure 16.2: Registering a new function
In the other direction, the extension registers its new functions
with `gawk' by passing function pointers to the functions that provide
@@ -22700,7 +22709,7 @@ calling convention. This is shown in *note figure-call-new-function::.
+-------+-+---+-+---+-+------------------+--------------+-+---+
gawk Main Program Address Space Extension
-Figure 16.3: Calling The New Function
+Figure 16.3: Calling the new function
The `do_XXX()' function, in turn, then uses the function pointers in
the API `struct' to do its work, such as updating variables or arrays,
@@ -22773,17 +22782,19 @@ operations:
* Allocating, reallocating, and releasing memory.
* Registration functions. You may register:
- - extension functions,
- - exit callbacks,
+ - Extension functions
- - a version string,
+ - Exit callbacks
- - input parsers,
+ - A version string
- - output wrappers,
+ - Input parsers
+
+ - Output wrappers
+
+ - Two-way processors
- - and two-way processors.
All of these are discussed in detail, later in this major node.
* Printing fatal, warning, and "lint" warning messages.
@@ -22815,8 +22826,8 @@ operations:
Some points about using the API:
- * The following types and/or macros and/or functions are referenced
- in `gawkapi.h'. For correct use, you must therefore include the
+ * The following types, macros, and/or functions are referenced in
+ `gawkapi.h'. For correct use, you must therefore include the
corresponding standard header file _before_ including `gawkapi.h':
C Entity Header File
@@ -22855,7 +22866,7 @@ operations:
* The API defines several simple `struct's that map values as seen
from `awk'. A value can be a `double', a string, or an array (as
in multidimensional arrays, or when creating a new array). String
- values maintain both pointer and length since embedded NUL
+ values maintain both pointer and length, because embedded NUL
characters are allowed.
NOTE: By intent, strings are maintained using the current
@@ -22876,16 +22887,16 @@ operations:
message (such as "scalar passed where array expected").
- While you may call the API functions by using the function pointers
-directly, the interface is not so pretty. To make extension code look
-more like regular code, the `gawkapi.h' header file defines several
+ You may call the API functions by using the function pointers
+directly, but the interface is not so pretty. To make extension code
+look more like regular code, the `gawkapi.h' header file defines several
macros that you should use in your code. This minor node presents the
macros as if they were functions.

File: gawk.info, Node: General Data Types, Next: Memory Allocation Functions, Prev: Extension API Functions Introduction, Up: Extension API Description
-16.4.2 General Purpose Data Types
+16.4.2 General-Purpose Data Types
---------------------------------
I have a true love/hate relationship with unions. -- Arnold
@@ -22894,10 +22905,10 @@ File: gawk.info, Node: General Data Types, Next: Memory Allocation Functions,
That's the thing about unions: the compiler will arrange things so
they can accommodate both love and hate. -- Chet Ramey
- The extension API defines a number of simple types and structures
-for general purpose use. Additional, more specialized, data structures
-are introduced in subsequent minor nodes, together with the functions
-that use them.
+ The extension API defines a number of simple types and structures for
+general-purpose use. Additional, more specialized, data structures are
+introduced in subsequent minor nodes, together with the functions that
+use them.
`typedef void *awk_ext_id_t;'
A value of this type is received from `gawk' when an extension is
@@ -22922,8 +22933,8 @@ that use them.
`} awk_string_t;'
This represents a mutable string. `gawk' owns the memory pointed
to if it supplied the value. Otherwise, it takes ownership of the
- memory pointed to. *Such memory must come from calling one of the
- `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()' functions!*
+ memory pointed to. _Such memory must come from calling one of the
+ `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()' functions!_
As mentioned earlier, strings are maintained using the current
multibyte encoding.
@@ -22964,13 +22975,13 @@ that use them.
`typedef void *awk_scalar_t;'
Scalars can be represented as an opaque type. These values are
obtained from `gawk' and then passed back into it. This is
- discussed in a general fashion below, and in more detail in *note
- Symbol table by cookie::.
+ discussed in a general fashion in the text following this list,
+ and in more detail in *note Symbol table by cookie::.
`typedef void *awk_value_cookie_t;'
A "value cookie" is an opaque type representing a cached value.
- This is also discussed in a general fashion below, and in more
- detail in *note Cached values::.
+ This is also discussed in a general fashion in the text following
+ this list, and in more detail in *note Cached values::.
Scalar values in `awk' are either numbers or strings. The
@@ -22978,7 +22989,7 @@ that use them.
indicates what is in the `union'.
Representing numbers is easy--the API uses a C `double'. Strings
-require more work. Since `gawk' allows embedded NUL bytes in string
+require more work. Because `gawk' allows embedded NUL bytes in string
values, a string must be represented as a pair containing a
data-pointer and length. This is the `awk_string_t' type.
@@ -22990,15 +23001,14 @@ Manipulation::.
The various macros listed earlier make it easier to use the elements
of the `union' as if they were fields in a `struct'; this is a common
-coding practice in C. Such code is easier to write and to read,
-however it remains _your_ responsibility to make sure that the
-`val_type' member correctly reflects the type of the value in the
-`awk_value_t'.
+coding practice in C. Such code is easier to write and to read, but it
+remains _your_ responsibility to make sure that the `val_type' member
+correctly reflects the type of the value in the `awk_value_t'.
Conceptually, the first three members of the `union' (number, string,
and array) are all that is needed for working with `awk' values.
-However, since the API provides routines for accessing and changing the
-value of global scalar variables only by using the variable's name,
+However, because the API provides routines for accessing and changing
+the value of global scalar variables only by using the variable's name,
there is a performance penalty: `gawk' must find the variable each time
it is accessed and changed. This turns out to be a real issue, not
just a theoretical one.
@@ -23036,7 +23046,7 @@ File: gawk.info, Node: Memory Allocation Functions, Next: Constructor Function
The API provides a number of "memory allocation" functions for
allocating memory that can be passed to `gawk', as well as a number of
convenience macros. This node presents them all as function
-prototypes, in the way that extension code would use them.
+prototypes, in the way that extension code would use them:
`void *gawk_malloc(size_t size);'
Call the correct version of `malloc()' to allocate storage that may
@@ -23073,8 +23083,8 @@ as if they were procedure calls that do not return a value.
The pointer variable to point at the allocated storage.
`type'
- The type of the pointer variable, used to create a cast for
- the call to `gawk_malloc()'.
+ The type of the pointer variable. This is used to create a
+ cast for the call to `gawk_malloc()'.
`size'
The total number of bytes to be allocated.
@@ -23112,7 +23122,7 @@ File: gawk.info, Node: Constructor Functions, Next: Registration Functions, P
The API provides a number of "constructor" functions for creating
string and numeric values, as well as a number of convenience macros.
This node presents them all as function prototypes, in the way that
-extension code would use them.
+extension code would use them:
`static inline awk_value_t *'
`make_const_string(const char *string, size_t length, awk_value_t *result)'
@@ -23189,7 +23199,7 @@ Extension functions are described by the following record:
functionality. The function must fill in `*result' with either a
number or a string. `gawk' takes ownership of any string memory.
As mentioned earlier, string memory *must* come from one of
- `gawk_malloc()', `gawk_calloc()' or `gawk_realloc()'.
+ `gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'.
The `num_actual_args' argument tells the C function how many
actual parameters were passed from the calling `awk' code.
@@ -23222,7 +23232,7 @@ An "exit callback" function is a function that `gawk' calls before it
exits. Such functions are useful if you have general "cleanup" tasks
that should be performed in your extension (such as closing database
connections or other resource deallocations). You can register such a
-function with `gawk' using the following function.
+function with `gawk' using the following function:
`void awk_atexit(void (*funcp)(void *data, int exit_status),'
` void *arg0);'
@@ -23238,7 +23248,7 @@ function with `gawk' using the following function.
A pointer to private data which `gawk' saves in order to pass
to the function pointed to by `funcp'.
- Exit callback functions are called in Last-In-First-Out (LIFO)
+ Exit callback functions are called in last-in-first-out (LIFO)
order--that is, in the reverse order in which they are registered with
`gawk'.
@@ -23252,8 +23262,9 @@ You can register a version string which indicates the name and version
of your extension, with `gawk', as follows:
`void register_ext_version(const char *version);'
- Register the string pointed to by `version' with `gawk'. `gawk'
- does _not_ copy the `version' string, so it should not be changed.
+ Register the string pointed to by `version' with `gawk'. Note
+ that `gawk' does _not_ copy the `version' string, so it should not
+ be changed.
`gawk' prints all registered extension version strings when it is
invoked with the `--version' option.
@@ -23326,7 +23337,7 @@ used for `RT', if any.
2. When your extension is loaded, register your input parser with
`gawk' using the `register_input_parser()' API function (described
- below).
+ next).
An `awk_input_buf_t' looks like this:
@@ -23364,14 +23375,14 @@ decide if the input parser should be used for the file. The decision
can be made based upon `gawk' state (the value of a variable defined
previously by the extension and set by `awk' code), the name of the
file, whether or not the file descriptor is valid, the information in
-the `struct stat', or any combination of the above.
+the `struct stat', or any combination of these factors.
Once `XXX_can_take_file()' has returned true, and `gawk' has decided
to use your input parser, it calls `XXX_take_control_of()'. That
function then fills one of either the `get_record' field or the
`read_func' field in the `awk_input_buf_t'. It must also ensure that
-`fd' is _not_ set to `INVALID_HANDLE'. All of the fields that may be
-filled by `XXX_take_control_of()' are as follows:
+`fd' is _not_ set to `INVALID_HANDLE'. The following list describes
+the fields that may be filled by `XXX_take_control_of()':
`void *opaque;'
This is used to hold any state information needed by the input
@@ -23385,13 +23396,13 @@ filled by `XXX_take_control_of()' are as follows:
` size_t *rt_len);'
This function pointer should point to a function that creates the
input records. Said function is the core of the input parser.
- Its behavior is described below.
+ Its behavior is described in the text following this list.
`ssize_t (*read_func)();'
This function pointer should point to function that has the same
behavior as the standard POSIX `read()' system call. It is an
alternative to the `get_record' pointer. Its behavior is also
- described below.
+ described in the text following this list.
`void (*close_func)(struct awk_input *iobuf);'
This function pointer should point to a function that does the
@@ -23516,8 +23527,8 @@ an extension to take over the output to a file opened with the `>' or
The function pointed to by this field is called when `gawk'
decides to let the output wrapper take control of the file. It
should fill in appropriate members of the `awk_output_buf_t'
- structure, as described below, and return true if successful,
- false otherwise.
+ structure, as described next, and return true if successful, false
+ otherwise.
`awk_const struct output_wrapper *awk_const next;'
This is for use by `gawk'; therefore it is marked `awk_const' so
@@ -23648,8 +23659,8 @@ File: gawk.info, Node: Printing Messages, Next: Updating `ERRNO', Prev: Regis
------------------------
You can print different kinds of warning messages from your extension,
-as described below. Note that for these functions, you must pass in
-the extension id received from `gawk' when the extension was loaded.(1)
+as described here. Note that for these functions, you must pass in the
+extension id received from `gawk' when the extension was loaded:(1)
`void fatal(awk_ext_id_t id, const char *format, ...);'
Print a message and then cause `gawk' to exit immediately.
@@ -23709,7 +23720,7 @@ message, or reissue the request for the actual value type, as
appropriate. This behavior is summarized in *note
table-value-types-returned::.
- Type of Actual Value:
+ Type of Actual Value
--------------------------------------------------------------------------
String Number Array Undefined
@@ -23719,12 +23730,12 @@ table-value-types-returned::.
be converted,
else false
Type Array false false Array false
-Requested: Scalar Scalar Scalar false false
+Requested Scalar Scalar Scalar false false
Undefined String Number Array Undefined
Value false false false false
Cookie
-Table 16.1: API Value Types Returned
+Table 16.1: API value types returned

File: gawk.info, Node: Accessing Parameters, Next: Symbol Table Access, Prev: Requesting Values, Up: Extension API Description
@@ -23805,8 +23816,8 @@ cannot change any of those variables.
CAUTION: It is possible for the lookup of `PROCINFO' to fail. This
happens if the `awk' program being run does not reference
- `PROCINFO'; in this case `gawk' doesn't bother to create the array
- and populate it.
+ `PROCINFO'; in this case, `gawk' doesn't bother to create the
+ array and populate it.

File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Symbol table by name, Up: Symbol Table Access
@@ -23817,9 +23828,9 @@ File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Sym
A "scalar cookie" is an opaque handle that provides access to a global
variable or array. It is an optimization that avoids looking up
variables in `gawk''s symbol table every time access is needed. This
-was discussed earlier, in *note General Data Types::.
+was discussed earlier in *note General Data Types::.
- The following functions let you work with scalar cookies.
+ The following functions let you work with scalar cookies:
`awk_bool_t sym_lookup_scalar(awk_scalar_t cookie,'
` awk_valtype_t wanted,'
@@ -23860,7 +23871,7 @@ variable based on the result of that evaluation, like so:
This code looks (and is) simple and straightforward. So what's the
problem?
- Consider what happens if `awk'-level code associated with your
+ Well, consider what happens if `awk'-level code associated with your
extension calls the `magic()' function (implemented in C by
`do_magic()'), once per record, while processing hundreds of thousands
or millions of records. The `MAGIC_VAR' variable is looked up in the
@@ -23935,7 +23946,7 @@ variables using `sym_update()' or `sym_update_scalar()', as you like.
However, you can understand the point of cached values if you
remember that _every_ string value's storage _must_ come from
-`gawk_malloc()', `gawk_calloc()' or `gawk_realloc()'. If you have 20
+`gawk_malloc()', `gawk_calloc()', or `gawk_realloc()'. If you have 20
variables, all of which have the same string value, you must create 20
identical copies of the string.(1)
@@ -23947,8 +23958,8 @@ follows:
`awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);'
Create a cached string or numeric value from `value' for efficient
later assignment. Only values of type `AWK_NUMBER' and
- `AWK_STRING' are allowed. Any other type is rejected. While
- `AWK_UNDEFINED' could be allowed, doing so would result in
+ `AWK_STRING' are allowed. Any other type is rejected.
+ `AWK_UNDEFINED' could be allowed, but doing so would result in
inferior performance.
`awk_bool_t release_value(awk_value_cookie_t vc);'
@@ -23995,7 +24006,7 @@ of variables:
...
}
-Using value cookies in this way saves considerable storage, since all of
+Using value cookies in this way saves considerable storage, as all of
`VAR1' through `VAR100' share the same value.
You might be wondering, "Is this sharing problematic? What happens
@@ -24043,7 +24054,7 @@ arrays of arrays (*note General Data Types::).
---------- Footnotes ----------
- (1) Okay, the only data structure.
+ (1) OK, the only data structure.

File: gawk.info, Node: Array Data Types, Next: Array Functions, Up: Array Manipulation
@@ -24051,7 +24062,7 @@ File: gawk.info, Node: Array Data Types, Next: Array Functions, Up: Array Man
16.4.11.1 Array Data Types
..........................
-The data types associated with arrays are listed below.
+The data types associated with arrays are as follows:
`typedef void *awk_array_t;'
If you request the value of an array variable, you get back an
@@ -24196,7 +24207,7 @@ File: gawk.info, Node: Flattening Arrays, Next: Creating Arrays, Prev: Array
16.4.11.3 Working With All The Elements of an Array
...................................................
-To "flatten" an array is create a structure that represents the full
+To "flatten" an array is to create a structure that represents the full
array in a fashion that makes it easy for C code to traverse the entire
array. Test code in `extension/testext.c' does this, and also serves
as a nice example showing how to use the APIs.
@@ -24342,7 +24353,7 @@ this code) once you have called `release_flattened_array()':
goto out;
}
- Finally, since everything was successful, the function sets the
+ Finally, because everything was successful, the function sets the
return value to success, and returns:
make_number(1.0, result);
@@ -24377,7 +24388,7 @@ them and manipulate them.
There are two important points about creating arrays from extension
code:
- 1. You must install a new array into `gawk''s symbol table
+ * You must install a new array into `gawk''s symbol table
immediately upon creating it. Once you have done so, you can then
populate the array.
@@ -24391,7 +24402,7 @@ code:
previously existing array using `set_array_element()'. We show
example code shortly.
- 2. Due to gawk internals, after using `sym_update()' to install an
+ * Due to gawk internals, after using `sym_update()' to install an
array into `gawk', you have to retrieve the array cookie from the
value passed in to `sym_update()' before doing anything else with
it, like so:
@@ -24475,7 +24486,7 @@ Note how `a_cookie' is reset from the `array_cookie' field in the
}
}
- Here is sample script that loads the extension and then dumps the
+ Here is a sample script that loads the extension and then dumps the
array:
@load "subarray"
@@ -24614,8 +24625,8 @@ File: gawk.info, Node: Extension API Boilerplate, Prev: Extension API Variable
As mentioned earlier (*note Extension Mechanism Outline::), the function
definitions as presented are really macros. To use these macros, your
extension must provide a small amount of boilerplate code (variables and
-functions) towards the top of your source file, using pre-defined names
-as described below. The boilerplate needed is also provided in comments
+functions) toward the top of your source file, using predefined names
+as described here. The boilerplate needed is also provided in comments
in the `gawkapi.h' header file:
/* Boiler plate code: */
@@ -24689,9 +24700,9 @@ in the `gawkapi.h' header file:
This macro expands to a `dl_load()' function that performs all the
necessary initializations.
- The point of the all the variables and arrays is to let the
-`dl_load()' function (from the `dl_load_func()' macro) do all the
-standard work. It does the following:
+ The point of all the variables and arrays is to let the `dl_load()'
+function (from the `dl_load_func()' macro) do all the standard work. It
+does the following:
1. Check the API versions. If the extension major version does not
match `gawk''s, or if the extension minor version is greater than
@@ -24725,7 +24736,7 @@ File: gawk.info, Node: Extension Example, Next: Extension Samples, Prev: Find
16.6 Example: Some File Functions
=================================
- No matter where you go, there you are. -- Buckaroo Bonzai
+ No matter where you go, there you are. -- Buckaroo Banzai
Two useful functions that are not in `awk' are `chdir()' (so that an
`awk' program can change its directory) and `stat()' (so that an `awk'
@@ -24881,7 +24892,7 @@ Here is the C code for these extensions.(1)
includes the `gawkapi.h' header file which provides the API definitions.
Those are followed by the necessary variable declarations to make use
of the API macros and boilerplate code (*note Extension API
-Boilerplate::).
+Boilerplate::):
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -24918,7 +24929,7 @@ Boilerplate::).
implements it is called `do_foo()'. The function should have two
arguments: the first is an `int' usually called `nargs', that
represents the number of actual arguments for the function. The second
-is a pointer to an `awk_value_t', usually named `result'.
+is a pointer to an `awk_value_t', usually named `result':
/* do_chdir --- provide dynamically loaded chdir() function for gawk */
@@ -24936,11 +24947,11 @@ is a pointer to an `awk_value_t', usually named `result'.
"expecting 1"));
The `newdir' variable represents the new directory to change to,
-retrieved with `get_argument()'. Note that the first argument is
-numbered zero.
+which is retrieved with `get_argument()'. Note that the first argument
+is numbered zero.
If the argument is retrieved successfully, the function calls the
-`chdir()' system call. If the `chdir()' fails, `ERRNO' is updated.
+`chdir()' system call. If the `chdir()' fails, `ERRNO' is updated:
if (get_argument(0, AWK_STRING, & newdir)) {
ret = chdir(newdir.str_value.str);
@@ -25121,7 +25132,7 @@ initialized to point to `lstat()' (instead of `stat()') to get the file
information, in case the file is a symbolic link. However, if there
were three arguments, `statfunc' is set point to `stat()', instead.
- Here is the `do_stat()' function. It starts with variable
+ Here is the `do_stat()' function, which starts with variable
declarations and argument checking:
/* do_stat --- provide a stat() function for gawk */
@@ -25227,7 +25238,7 @@ version.

File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Extension Example
-16.6.3 Integrating The Extensions
+16.6.3 Integrating the Extensions
---------------------------------
Now that the code is written, it must be possible to add it at runtime
@@ -25239,7 +25250,7 @@ create a GNU/Linux shared library:
$ gcc -fPIC -shared -DHAVE_CONFIG_H -c -O -g -IIDIR filefuncs.c
$ gcc -o filefuncs.so -shared filefuncs.o
- Once the library exists, it is loaded by using the `@load' keyword.
+ Once the library exists, it is loaded by using the `@load' keyword:
# file testff.awk
@load "filefuncs"
@@ -25300,21 +25311,21 @@ directory and run the program:
---------- Footnotes ----------
- (1) In practice, you would probably want to use the GNU
-Autotools--Automake, Autoconf, Libtool, and `gettext'--to configure and
-build your libraries. Instructions for doing so are beyond the scope of
-this Info file. *Note gawkextlib::, for Internet links to the tools.
+ (1) In practice, you would probably want to use the GNU Autotools
+(Automake, Autoconf, Libtool, and `gettext') to configure and build
+your libraries. Instructions for doing so are beyond the scope of this
+Info file. *Note gawkextlib::, for Internet links to the tools.

File: gawk.info, Node: Extension Samples, Next: gawkextlib, Prev: Extension Example, Up: Dynamic Extensions
-16.7 The Sample Extensions In The `gawk' Distribution
+16.7 The Sample Extensions in the `gawk' Distribution
=====================================================
This minor node provides brief overviews of the sample extensions that
come in the `gawk' distribution. Some of them are intended for
-production use, such the `filefuncs', `readdir' and `inplace'
-extensions. Others mainly provide example code that shows how to use
+production use (e.g., the `filefuncs', `readdir' and `inplace'
+extensions). Others mainly provide example code that shows how to use
the extension API.
* Menu:
@@ -25338,11 +25349,11 @@ the extension API.

File: gawk.info, Node: Extension Sample File Functions, Next: Extension Sample Fnmatch, Up: Extension Samples
-16.7.1 File Related Functions
+16.7.1 File-Related Functions
-----------------------------
The `filefuncs' extension provides three different functions, as
-follows: The usage is:
+follows. The usage is:
`@load "filefuncs"'
This is how you load the extension.
@@ -25350,13 +25361,13 @@ follows: The usage is:
`result = chdir("/some/directory")'
The `chdir()' function is a direct hook to the `chdir()' system
call to change the current directory. It returns zero upon
- success or less than zero upon error. In the latter case it
+ success or less than zero upon error. In the latter case, it
updates `ERRNO'.
`result = stat("/some/path", statdata' [`, follow']`)'
The `stat()' function provides a hook into the `stat()' system
call. It returns zero upon success or less than zero upon error.
- In the latter case it updates `ERRNO'.
+ In the latter case, it updates `ERRNO'.
By default, it uses the `lstat()' system call. However, if passed
a third argument, it uses `stat()' instead.
@@ -25399,9 +25410,9 @@ follows: The usage is:
`flags = or(FTS_PHYSICAL, ...)'
`result = fts(pathlist, flags, filedata)'
Walk the file trees provided in `pathlist' and fill in the
- `filedata' array as described below. `flags' is the bitwise OR of
- several predefined values, also described below. Return zero if
- there were no errors, otherwise return -1.
+ `filedata' array as described next. `flags' is the bitwise OR of
+ several predefined values, also described in a moment. Return
+ zero if there were no errors, otherwise return -1.
The `fts()' function provides a hook to the C library `fts()'
routines for traversing file hierarchies. Instead of returning data
@@ -25445,7 +25456,7 @@ requested hierarchies.
By default, the C library `fts()' routines do not return
entries for `.' (dot) and `..' (dot-dot). This option causes
entries for dot-dot to also be included. (The extension
- always includes an entry for dot, see below.)
+ always includes an entry for dot; more on this in a moment.)
`FTS_XDEV'
During a traversal, do not cross onto a different mounted
@@ -25455,7 +25466,7 @@ requested hierarchies.
The `filedata' array is first cleared. Then, `fts()' creates an
element in `filedata' for every element in `pathlist'. The index
is the name of the directory or file given in `pathlist'. The
- element for this index is itself an array. There are two cases.
+ element for this index is itself an array. There are two cases:
_The path is a file_
In this case, the array contains two or three elements:
@@ -25478,10 +25489,10 @@ requested hierarchies.
_The path is a directory_
In this case, the array contains one element for each entry
- in the directory. If an entry is a file, that element is as
- for files, just described. If the entry is a directory, that
- element is (recursively), an array describing the
- subdirectory. If `FTS_SEEDOT' was provided in the flags,
+ in the directory. If an entry is a file, that element is the
+ same as for files, just described. If the entry is a
+ directory, that element is (recursively) an array describing
+ the subdirectory. If `FTS_SEEDOT' was provided in the flags,
then there will also be an element named `".."'. This
element will be an array containing the data as provided by
`stat()'.
@@ -25497,8 +25508,8 @@ Otherwise it returns -1.
of the C library `fts()' routines, choosing instead to provide an
interface that is based on associative arrays, which is more
comfortable to use from an `awk' program. This includes the lack
- of a comparison function, since `gawk' already provides powerful
- array sorting facilities. While an `fts_read()'-like interface
+ of a comparison function, because `gawk' already provides powerful
+ array sorting facilities. Although an `fts_read()'-like interface
could have been provided, this felt less natural than simply
creating a multidimensional array to represent the file hierarchy
and its information.
@@ -25509,7 +25520,7 @@ the `fts()' extension function.

File: gawk.info, Node: Extension Sample Fnmatch, Next: Extension Sample Fork, Prev: Extension Sample File Functions, Up: Extension Samples
-16.7.2 Interface To `fnmatch()'
+16.7.2 Interface to `fnmatch()'
-------------------------------
This extension provides an interface to the C library `fnmatch()'
@@ -25520,11 +25531,12 @@ function. The usage is:
`result = fnmatch(pattern, string, flags)'
The return value is zero on success, `FNM_NOMATCH' if the string
- did not match the pattern, or a different non-zero value if an
+ did not match the pattern, or a different nonzero value if an
error occurred.
- Besides the `fnmatch()' function, the `fnmatch' extension adds one
-constant (`FNM_NOMATCH'), and an array of flag values named `FNM'.
+ In addition to the `fnmatch()' function, the `fnmatch' extension
+adds one constant (`FNM_NOMATCH'), and an array of flag values named
+`FNM'.
The arguments to `fnmatch()' are:
@@ -25538,7 +25550,7 @@ constant (`FNM_NOMATCH'), and an array of flag values named `FNM'.
Either zero, or the bitwise OR of one or more of the flags in the
`FNM' array.
- The flags are follows:
+ The flags are as follows:
Array element Corresponding flag defined by `fnmatch()'
--------------------------------------------------------------------------
@@ -25560,10 +25572,10 @@ Array element Corresponding flag defined by `fnmatch()'

File: gawk.info, Node: Extension Sample Fork, Next: Extension Sample Inplace, Prev: Extension Sample Fnmatch, Up: Extension Samples
-16.7.3 Interface To `fork()', `wait()' and `waitpid()'
-------------------------------------------------------
+16.7.3 Interface to `fork()', `wait()', and `waitpid()'
+-------------------------------------------------------
-The `fork' extension adds three functions, as follows.
+The `fork' extension adds three functions, as follows:
`@load "fork"'
This is how you load the extension.
@@ -25646,7 +25658,7 @@ File: gawk.info, Node: Extension Sample Ord, Next: Extension Sample Readdir,
--------------------------------------------------------
The `ordchr' extension adds two functions, named `ord()' and `chr()',
-as follows.
+as follows:
`@load "ordchr"'
This is how you load the extension.
@@ -25699,7 +25711,7 @@ Letter File Type
`s' Socket
`u' Anything else (unknown)
-Table 16.2: File Types Returned By The `readdir' Extension
+Table 16.2: File types returned by the `readdir' extension
On systems without the file type information, the third field is
always `u'.
@@ -25724,7 +25736,7 @@ File: gawk.info, Node: Extension Sample Revout, Next: Extension Sample Rev2way
-----------------------
The `revoutput' extension adds a simple output wrapper that reverses
-the characters in each output line. It's main purpose is to show how to
+the characters in each output line. Its main purpose is to show how to
write an output wrapper, although it may be mildly amusing for the
unwary. Here is an example:
@@ -25745,9 +25757,9 @@ File: gawk.info, Node: Extension Sample Rev2way, Next: Extension Sample Read w
The `revtwoway' extension adds a simple two-way processor that reverses
the characters in each line sent to it for reading back by the `awk'
-program. It's main purpose is to show how to write a two-way
-processor, although it may also be mildly amusing. The following
-example shows how to use it:
+program. Its main purpose is to show how to write a two-way processor,
+although it may also be mildly amusing. The following example shows
+how to use it:
@load "revtwoway"
@@ -25764,7 +25776,7 @@ example shows how to use it:

File: gawk.info, Node: Extension Sample Read write array, Next: Extension Sample Readfile, Prev: Extension Sample Rev2way, Up: Extension Samples
-16.7.9 Dumping and Restoring An Array
+16.7.9 Dumping and Restoring an Array
-------------------------------------
The `rwarray' extension adds two functions, named `writea()' and
@@ -25787,15 +25799,15 @@ The `rwarray' extension adds two functions, named `writea()' and
The array created by `reada()' is identical to that written by
`writea()' in the sense that the contents are the same. However, due to
-implementation issues, the array traversal order of the recreated array
-is likely to be different from that of the original array. As array
-traversal order in `awk' is by default undefined, this is (technically)
-not a problem. If you need to guarantee a particular traversal order,
-use the array sorting features in `gawk' to do so (*note Array
-Sorting::).
+implementation issues, the array traversal order of the re-created
+array is likely to be different from that of the original array. As
+array traversal order in `awk' is by default undefined, this is
+(technically) not a problem. If you need to guarantee a particular
+traversal order, use the array sorting features in `gawk' to do so
+(*note Array Sorting::).
The file contains binary data. All integral values are written in
-network byte order. However, double precision floating-point values
+network byte order. However, double-precision floating-point values
are written as native binary data. Thus, arrays containing only string
data can theoretically be dumped on systems with one byte order and
restored on systems with a different one, but this has not been tried.
@@ -25811,7 +25823,7 @@ restored on systems with a different one, but this has not been tried.

File: gawk.info, Node: Extension Sample Readfile, Next: Extension Sample Time, Prev: Extension Sample Read write array, Up: Extension Samples
-16.7.10 Reading An Entire File
+16.7.10 Reading an Entire File
------------------------------
The `readfile' extension adds a single function named `readfile()', and
@@ -25855,7 +25867,7 @@ The `time' extension adds two functions, named `gettimeofday()' and
`the_time = gettimeofday()'
Return the time in seconds that has elapsed since 1970-01-01 UTC
- as a floating point value. If the time is unavailable on this
+ as a floating-point value. If the time is unavailable on this
platform, return -1 and set `ERRNO'. The returned time should
have sub-second precision, but the actual precision may vary based
on the platform. If the standard C `gettimeofday()' system call
@@ -25897,17 +25909,17 @@ project.
As of this writing, there are five extensions:
- * GD graphics library extension.
+ * GD graphics library extension
- * PDF extension.
+ * PDF extension
- * PostgreSQL extension.
+ * PostgreSQL extension
- * MPFR library extension. This provides access to a number of MPFR
- functions which `gawk''s native MPFR support does not.
+ * MPFR library extension (this provides access to a number of MPFR
+ functions which `gawk''s native MPFR support does not)
* XML parser extension, using the Expat
- (http://expat.sourceforge.net) XML parsing library.
+ (http://expat.sourceforge.net) XML parsing library
You can check out the code for the `gawkextlib' project using the
Git (http://git-scm.com) distributed source code control system. The
@@ -25947,8 +25959,8 @@ You may also need to use the `sudo' utility to install both `gawk' and
`gawkextlib', depending upon how your system works.
If you write an extension that you wish to share with other `gawk'
-users, please consider doing so through the `gawkextlib' project. See
-the project's web site for more information.
+users, consider doing so through the `gawkextlib' project. See the
+project's website for more information.

File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: gawkextlib, Up: Dynamic Extensions
@@ -25957,7 +25969,7 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga
============
* You can write extensions (sometimes called plug-ins) for `gawk' in
- C or C++ using the Application Programming Interface (API) defined
+ C or C++ using the application programming interface (API) defined
by the `gawk' developers.
* Extensions must have a license compatible with the GNU General
@@ -25983,31 +25995,31 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga
* API function pointers are provided for the following kinds of
operations:
- * Allocating, reallocating, and releasing memory.
+ * Allocating, reallocating, and releasing memory
- * Registration functions. You may register extension functions,
+ * Registration functions (you may register extension functions,
exit callbacks, a version string, input parsers, output
- wrappers, and two-way processors.
+ wrappers, and two-way processors)
- * Printing fatal, warning, and "lint" warning messages.
+ * Printing fatal, warning, and "lint" warning messages
- * Updating `ERRNO', or unsetting it.
+ * Updating `ERRNO', or unsetting it
* Accessing parameters, including converting an undefined
- parameter into an array.
+ parameter into an array
- * Symbol table access: retrieving a global variable, creating
- one, or changing one.
+ * Symbol table access (retrieving a global variable, creating
+ one, or changing one)
* Creating and releasing cached values; this provides an
efficient way to use values for multiple variables and can be
- a big performance win.
+ a big performance win
- * Manipulating arrays: retrieving, adding, deleting, and
+ * Manipulating arrays (retrieving, adding, deleting, and
modifying elements; getting the count of elements in an array;
creating a new array; clearing an array; and flattening an
array for easy C style looping over all its indices and
- elements.
+ elements)
* The API defines a number of standard data types for representing
`awk' values, array elements, and arrays.
@@ -26066,7 +26078,7 @@ Appendix A The Evolution of the `awk' Language
**********************************************
This Info file describes the GNU implementation of `awk', which follows
-the POSIX specification. Many long-time `awk' users learned `awk'
+the POSIX specification. Many longtime `awk' users learned `awk'
programming with the original `awk' implementation in Version 7 Unix.
(This implementation was the basis for `awk' in Berkeley Unix, through
4.3-Reno. Subsequent versions of Berkeley Unix, and, for a while, some
@@ -26248,7 +26260,7 @@ Brian Kernighan has made his version available via his home page (*note
Other Versions::).
This minor node describes common extensions that originally appeared
-in his version of `awk'.
+in his version of `awk':
* The `**' and `**=' operators (*note Arithmetic Ops:: and *note
Assignment Ops::).
@@ -26290,7 +26302,7 @@ the current version of `gawk'.
- The `/inet', `/inet4', and `/inet6' special files for TCP/IP
networking using `|&' to specify which version of the IP
- protocol to use. (*note TCP/IP Networking::).
+ protocol to use (*note TCP/IP Networking::).
* Changes and/or additions to the language:
@@ -26316,7 +26328,7 @@ the current version of `gawk'.
* New keywords:
- - The `BEGINFILE' and `ENDFILE' special patterns. (*note
+ - The `BEGINFILE' and `ENDFILE' special patterns (*note
BEGINFILE/ENDFILE::).
- The `switch' statement (*note Switch Statement::).
@@ -26341,7 +26353,7 @@ the current version of `gawk'.
translations easier (*note Printf Ordering::).
- The `split()' function's additional optional fourth argument
- which is an array to hold the text of the field separators.
+ which is an array to hold the text of the field separators
(*note String Functions::).
* Additional functions only in `gawk':
@@ -26812,7 +26824,7 @@ A.7 Common Extensions Summary
=============================
The following table summarizes the common extensions supported by
-`gawk', Brian Kernighan's `awk', and `mawk', the three most widely-used
+`gawk', Brian Kernighan's `awk', and `mawk', the three most widely used
freely available versions of `awk' (*note Other Versions::).
Feature BWK Awk Mawk GNU Awk Now standard
@@ -26830,7 +26842,7 @@ Feature BWK Awk Mawk GNU Awk Now standard
`func' keyword X X
`BINMODE' variable X X
`RS' as regexp X X
-Time related functions X X
+Time-related functions X X

File: gawk.info, Node: Ranges and Locales, Next: Contributors, Prev: Common Extensions, Up: Language History
@@ -26848,7 +26860,7 @@ first character in the range and the last character in the range,
inclusive. Ordering was based on the numeric value of each character
in the machine's native character set. Thus, on ASCII-based systems,
`[a-z]' matched all the lowercase letters, and only the lowercase
-letters, since the numeric values for the letters from `a' through `z'
+letters, as the numeric values for the letters from `a' through `z'
were contiguous. (On an EBCDIC system, the range `[a-z]' includes
additional, non-alphabetic characters as well.)
@@ -26859,9 +26871,9 @@ as working in this fashion, and in particular, would teach that the
this was true.(1)
The 1992 POSIX standard introduced the idea of locales (*note
-Locales::). Since many locales include other letters besides the plain
-twenty-six letters of the American English alphabet, the POSIX standard
-added character classes (*note Bracket Expressions::) as a way to match
+Locales::). Because many locales include other letters besides the
+plain 26 letters of the English alphabet, the POSIX standard added
+character classes (*note Bracket Expressions::) as a way to match
different kinds of characters besides the traditional ones in the ASCII
character set.
@@ -26876,7 +26888,7 @@ than `B'. In other words, these locales sort characters in dictionary
order, and `[a-dx-z]' is typically not equivalent to `[abcdxyz]';
instead it might be equivalent to `[ABCXYabcdxyz]', for example.
- This point needs to be emphasized: Much literature teaches that you
+ This point needs to be emphasized: much literature teaches that you
should use `[a-z]' to match a lowercase character. But on systems with
non-ASCII locales, this also matches all of the uppercase characters
except `A' or `Z'! This was a continuous cause of confusion, even well
@@ -26889,9 +26901,9 @@ the intent is to remove trailing uppercase characters:
$ echo something1234abc | gawk-3.1.8 '{ sub("[A-Z]*$", ""); print }'
-| something1234a
-This output is unexpected, since the `bc' at the end of
-`something1234abc' should not normally match `[A-Z]*'. This result is
-due to the locale setting (and thus you may not see it on your system).
+This output is unexpected, as the `bc' at the end of `something1234abc'
+should not normally match `[A-Z]*'. This result is due to the locale
+setting (and thus you may not see it on your system).
Similar considerations apply to other ranges. For example, `["-/]'
is perfectly valid in ASCII, but is not valid in many Unicode locales,
@@ -26908,7 +26920,7 @@ like "why does `[A-Z]' match lowercase letters?!?"
This situation existed for close to 10 years, if not more, and the
`gawk' maintainer grew weary of trying to explain that `gawk' was being
-nicely standards-compliant, and that the issue was in the user's
+nicely standards compliant, and that the issue was in the user's
locale. During the development of version 4.0, he modified `gawk' to
always treat ranges in the original, pre-POSIX fashion, unless
`--posix' was used (*note Options::).(2)
@@ -27039,7 +27051,7 @@ Info file, in approximate chronological order:
statements.
* Patrick T.J. McPhee contributed the code for dynamic loading in
- Windows32 environments. (This is no longer supported)
+ Windows32 environments. (This is no longer supported.)
* Anders Wallin helped keep the VMS port going for several years.
@@ -27053,8 +27065,8 @@ Info file, in approximate chronological order:
- The addition of true arrays of arrays.
- - The additional modifications for support of arbitrary
- precision arithmetic.
+ - The additional modifications for support of
+ arbitrary-precision arithmetic.
- The initial text of *note Arbitrary Precision Arithmetic::.
@@ -27093,7 +27105,7 @@ A.10 Summary
============
* The `awk' language has evolved over time. The first release was
- with V7 Unix circa 1978. In 1987 for System V Release 3.1, major
+ with V7 Unix circa 1978. In 1987, for System V Release 3.1, major
additions, including user-defined functions, were made to the
language. Additional changes were made for System V Release 4, in
1989. Since then, further minor changes happen under the auspices
@@ -27127,8 +27139,8 @@ Appendix B Installing `gawk'
This appendix provides instructions for installing `gawk' on the
various platforms that are supported by the developers. The primary
developer supports GNU/Linux (and Unix), whereas the other ports are
-contributed. *Note Bugs::, for the electronic mail addresses of the
-people who maintain the respective ports.
+contributed. *Note Bugs::, for the email addresses of the people who
+maintain the respective ports.
* Menu:
@@ -27174,7 +27186,7 @@ There are two ways to get GNU software:
wget http://ftp.gnu.org/gnu/gawk/gawk-4.1.2.tar.gz
The GNU software archive is mirrored around the world. The
-up-to-date list of mirror sites is available from the main FSF web site
+up-to-date list of mirror sites is available from the main FSF website
(http://www.gnu.org/order/ftp.html). Try to use one of the mirrors;
they will be less busy, and you can usually find one closer to your
site.
@@ -27190,9 +27202,9 @@ compression programs: `gzip', `bzip2', and `xz'. For simplicity, the
rest of these instructions assume you are using the one compressed with
the GNU Zip program, `gzip'.
- Once you have the distribution (for example, `gawk-4.1.2.tar.gz'),
-use `gzip' to expand the file and then use `tar' to extract it. You
-can use the following pipeline to produce the `gawk' distribution:
+ Once you have the distribution (e.g., `gawk-4.1.2.tar.gz'), use
+`gzip' to expand the file and then use `tar' to extract it. You can
+use the following pipeline to produce the `gawk' distribution:
gzip -d -c gawk-4.1.2.tar.gz | tar -xvpf -
@@ -27270,7 +27282,7 @@ Various `.c', `.y', and `.h' files
`doc/awkforai.txt'
Pointers to the original draft of a short article describing why
- `gawk' is a good language for Artificial Intelligence (AI)
+ `gawk' is a good language for artificial intelligence (AI)
programming.
`doc/bc_notes'
@@ -27394,7 +27406,7 @@ Various `.c', `.y', and `.h' files

File: gawk.info, Node: Unix Installation, Next: Non-Unix Installation, Prev: Gawk Distribution, Up: Installation
-B.2 Compiling and Installing `gawk' on Unix-like Systems
+B.2 Compiling and Installing `gawk' on Unix-Like Systems
========================================================
Usually, you can compile and install `gawk' by typing only two
@@ -27410,7 +27422,7 @@ configure `gawk' for your system yourself.

File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation
-B.2.1 Compiling `gawk' for Unix-like Systems
+B.2.1 Compiling `gawk' for Unix-Like Systems
--------------------------------------------
The normal installation steps should work on all modern commercial
@@ -27453,8 +27465,7 @@ That's all there is to it! To verify that `gawk' is working properly,
run `make check'. All of the tests should succeed. If these steps do
not work, or if any of the tests fail, check the files in the
`README_d' directory to see if you've found a known problem. If the
-failure is not described there, please send in a bug report (*note
-Bugs::).
+failure is not described there, send in a bug report (*note Bugs::).
Of course, once you've built `gawk', it is likely that you will wish
to install it. To do so, you need to run the command `make install',
@@ -27504,7 +27515,7 @@ command line when compiling `gawk' from scratch, including:
for deficient systems.
Use the command `./configure --help' to see the full list of options
-that `configure' supplies.
+supplied by `configure'.

File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation
@@ -27538,15 +27549,15 @@ element in the `stat' structure. In this case,
It is possible for your C compiler to lie to `configure'. It may do
so by not exiting with an error when a library function is not
-available. To get around this, edit the file `custom.h'. Use an
+available. To get around this, edit the `custom.h' file. Use an
`#ifdef' that is appropriate for your system, and either `#define' any
constants that `configure' should have defined but didn't, or `#undef'
-any constants that `configure' defined and should not have. `custom.h'
-is automatically included by `config.h'.
+any constants that `configure' defined and should not have. The
+`custom.h' file is automatically included by the `config.h' file.
It is also possible that the `configure' program generated by
Autoconf will not work on your system in some other fashion. If you do
-have a problem, the file `configure.ac' is the input for Autoconf. You
+have a problem, the `configure.ac' file is the input for Autoconf. You
may be able to change this file and generate a new version of
`configure' that works on your system (*note Bugs::, for information on
how to report problems in configuring `gawk'). The same mechanism may
@@ -27582,8 +27593,8 @@ Microsoft Windows-95/98/ME/NT/2000/XP/Vista/7/8.
operating systems) has meant that various "DOS extenders" are often
used with programs such as `gawk'. The varying capabilities of
Microsoft Windows 3.1 and Windows32 can add to the confusion. For an
-overview of the considerations, please refer to `README_d/README.pc' in
-the distribution.
+overview of the considerations, refer to `README_d/README.pc' in the
+distribution.
* Menu:
@@ -27712,8 +27723,8 @@ other set of (self-consistent) environment variables and compiler flags.
---------- Footnotes ----------
- (1) As of May, 2014, this site is still there, but the author could
-not find a package for GNU Make.
+ (1) As of November 2014, this site is still there, but the author
+could not find a package for GNU Make.

File: gawk.info, Node: PC Testing, Next: PC Using, Prev: PC Compiling, Up: PC Installation
@@ -27866,7 +27877,7 @@ use the `BINMODE' variable.
This can cause problems with other Unix-like components that have
been ported to MS-Windows that expect `gawk' to do automatic
-translation of `"\r\n"', since it won't.
+translation of `"\r\n"', because it won't.

File: gawk.info, Node: VMS Installation, Prev: PC Installation, Up: Non-Unix Installation
@@ -27934,7 +27945,7 @@ B.3.2.2 Compiling `gawk' Dynamic Extensions on VMS
..................................................
The extensions that have been ported to VMS can be built using one of
-the following commands.
+the following commands:
$ MMS/DESCRIPTION=[.vms]descrip.mms extensions
@@ -27946,7 +27957,7 @@ or:
logical name to find the dynamic extensions.
Dynamic extensions need to be compiled with the same compiler
-options for floating point, pointer size, and symbol name handling as
+options for floating-point, pointer size, and symbol name handling as
were used to compile `gawk' itself. Alpha and Itanium should use IEEE
floating point. The pointer size is 32 bits, and the symbol name
handling should be exact case with CRC shortening for symbols longer
@@ -28062,12 +28073,11 @@ Note that uppercase and mixed-case text must be quoted.
The VMS port of `gawk' includes a `DCL'-style interface in addition
to the original shell-style interface (see the help entry for details).
One side effect of dual command-line parsing is that if there is only a
-single parameter (as in the quoted string program above), the command
-becomes ambiguous. To work around this, the normally optional `--'
-flag is required to force Unix-style parsing rather than `DCL' parsing.
-If any other dash-type options (or multiple parameters such as data
-files to process) are present, there is no ambiguity and `--' can be
-omitted.
+single parameter (as in the quoted string program), the command becomes
+ambiguous. To work around this, the normally optional `--' flag is
+required to force Unix-style parsing rather than `DCL' parsing. If any
+other dash-type options (or multiple parameters such as data files to
+process) are present, there is no ambiguity and `--' can be omitted.
The `exit' value is a Unix-style value and is encoded into a VMS exit
status value when the program exits.
@@ -28143,17 +28153,17 @@ File: gawk.info, Node: Bugs, Next: Other Versions, Prev: Non-Unix Installatio
B.4 Reporting Problems and Bugs
===============================
- There is nothing more dangerous than a bored archeologist. -- The
- Hitchhiker's Guide to the Galaxy
+ There is nothing more dangerous than a bored archaeologist. --
+ Douglas Adams, `The Hitchhiker's Guide to the Galaxy'
If you have problems with `gawk' or think that you have found a bug,
-please report it to the developers; we cannot promise to do anything
-but we might well want to fix it.
+report it to the developers; we cannot promise to do anything but we
+might well want to fix it.
- Before reporting a bug, please make sure you have really found a
-genuine bug. Carefully reread the documentation and see if it says you
-can do what you're trying to do. If it's not clear whether you should
-be able to do something or not, report that too; it's a bug in the
+ Before reporting a bug, make sure you have really found a genuine
+bug. Carefully reread the documentation and see if it says you can do
+what you're trying to do. If it's not clear whether you should be able
+to do something or not, report that too; it's a bug in the
documentation!
Before reporting a bug or trying to fix it yourself, try to isolate
@@ -28164,48 +28174,46 @@ compile `gawk', and the exact results `gawk' gave you. Also say what
you expected to occur; this helps us decide whether the problem is
really in the documentation.
- Please include the version number of `gawk' you are using. You can
-get this information with the command `gawk --version'.
+ Make sure to include the version number of `gawk' you are using.
+You can get this information with the command `gawk --version'.
Once you have a precise problem description, send email to
<bug-gawk@gnu.org>.
The `gawk' maintainers subscribe to this address and thus they will
receive your bug report. Although you can send mail to the maintainers
-directly, the bug reporting address is preferred since the email list
+directly, the bug reporting address is preferred because the email list
is archived at the GNU Project. _All email must be in English. This is
the only language understood in common by all the maintainers._
CAUTION: Do _not_ try to report bugs in `gawk' by posting to the
- Usenet/Internet newsgroup `comp.lang.awk'. While the `gawk'
- developers do occasionally read this newsgroup, there is no
- guarantee that we will see your posting. The steps described
- above are the only official recognized way for reporting bugs.
- Really.
+ Usenet/Internet newsgroup `comp.lang.awk'. The `gawk' developers
+ do occasionally read this newsgroup, but there is no guarantee
+ that we will see your posting. The steps described here are the
+ only officially recognized way for reporting bugs. Really.
NOTE: Many distributions of GNU/Linux and the various BSD-based
operating systems have their own bug reporting systems. If you
- report a bug using your distribution's bug reporting system,
- _please_ also send a copy to <bug-gawk@gnu.org>.
+ report a bug using your distribution's bug reporting system, you
+ should also send a copy to <bug-gawk@gnu.org>.
- This is for two reasons. First, while some distributions forward
- bug reports "upstream" to the GNU mailing list, many don't, so
- there is a good chance that the `gawk' maintainers won't even see
- the bug report! Second, mail to the GNU list is archived, and
- having everything at the GNU project keeps things self-contained
- and not dependant on other organizations.
+ This is for two reasons. First, although some distributions
+ forward bug reports "upstream" to the GNU mailing list, many
+ don't, so there is a good chance that the `gawk' maintainers
+ won't even see the bug report! Second, mail to the GNU list is
+ archived, and having everything at the GNU project keeps things
+ self-contained and not dependant on other organizations.
Non-bug suggestions are always welcome as well. If you have
questions about things that are unclear in the documentation or are
just obscure features, ask on the bug list; we will try to help you out
if we can.
- If you find bugs in one of the non-Unix ports of `gawk', please send
-an electronic mail message to the bug list, with a copy to the person
-who maintains that port. They are named in the following list, as well
-as in the `README' file in the `gawk' distribution. Information in the
-`README' file should be considered authoritative if it conflicts with
-this Info file.
+ If you find bugs in one of the non-Unix ports of `gawk', send an
+email to the bug list, with a copy to the person who maintains that
+port. They are named in the following list, as well as in the `README'
+file in the `gawk' distribution. Information in the `README' file
+should be considered authoritative if it conflicts with this Info file.
The people maintaining the various `gawk' ports are:
@@ -28216,8 +28224,8 @@ OS/2 Andreas Buening, <andreas.buening@nexgo.de>.
VMS John Malmberg, <wb8tyw@qsl.net>.
z/OS (OS/390) Dave Pitts, <dpitts@cozx.com>.
- If your bug is also reproducible under Unix, please send a copy of
-your report to the <bug-gawk@gnu.org> email list as well.
+ If your bug is also reproducible under Unix, send a copy of your
+report to the <bug-gawk@gnu.org> email list as well.

File: gawk.info, Node: Other Versions, Next: Installation summary, Prev: Bugs, Up: Installation
@@ -28235,7 +28243,7 @@ This minor node briefly describes where to get them:
Unix `awk'
Brian Kernighan, one of the original designers of Unix `awk', has
made his implementation of `awk' freely available. You can
- retrieve this version via the World Wide Web from his home page
+ retrieve this version via his home page
(http://www.cs.princeton.edu/~bwk). It is available in several
archive formats:
@@ -28252,10 +28260,10 @@ Unix `awk'
git clone git://github.com/onetrueawk/awk bwkawk
- The above command creates a copy of the Git
- (http://www.git-scm.com) repository in a directory named `bwkawk'.
- If you leave that argument off the `git' command line, the
- repository copy is created in a directory named `awk'.
+ This command creates a copy of the Git (http://www.git-scm.com)
+ repository in a directory named `bwkawk'. If you leave that
+ argument off the `git' command line, the repository copy is
+ created in a directory named `awk'.
This version requires an ISO C (1990 standard) compiler; the C
compiler from GCC (the GNU Compiler Collection) works quite nicely.
@@ -28263,6 +28271,10 @@ Unix `awk'
*Note Common Extensions::, for a list of extensions in this `awk'
that are not in POSIX `awk'.
+ As a side note, Dan Bornstein has created a Git repository tracking
+ all the versions of BWK `awk' that he could find. It's available
+ at `git://github.com/onetrueawk/awk'.
+
`mawk'
Michael Brennan wrote an independent implementation of `awk',
called `mawk'. It is available under the GPL (*note Copying::),
@@ -28324,8 +28336,8 @@ The OpenSolaris POSIX `awk'
Automake) would take more work, and this has not been done, at
least to our knowledge.
- The source code used to be available from the OpenSolaris web site.
- However, that project was ended and the web site shut down.
+ The source code used to be available from the OpenSolaris website.
+ However, that project was ended and the website shut down.
Fortunately, the Illumos project
(http://wiki.illumos.org/display/illumos/illumos+Home) makes this
implementation available. You can view the files one at a time
@@ -28341,7 +28353,7 @@ The OpenSolaris POSIX `awk'
Libmawk
This is an embeddable `awk' interpreter derived from `mawk'. For
- more information see `http://repo.hu/projects/libmawk/'.
+ more information, see `http://repo.hu/projects/libmawk/'.
`pawk'
This is a Python module that claims to bring `awk'-like features
@@ -28350,7 +28362,7 @@ Libmawk
version of BWK `awk', described earlier.)
QSE Awk
- This is an embeddable `awk' interpreter. For more information see
+ This is an embeddable `awk' interpreter. For more information, see
`http://code.google.com/p/qse/' and `http://awk.info/?tools/qse'.
`QTawk'
@@ -28363,9 +28375,10 @@ QSE Awk
The project may also be frozen; no new code changes have been made
since approximately 2008.
-Other Versions
- See also the Wikipedia article
- (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations),
+Other versions
+ See also the "Versions and Implementations" section of the
+ Wikipedia article
+ (http://en.wikipedia.org/wiki/Awk_language#Versions_and_implementations)
for information on additional versions.
@@ -28534,9 +28547,8 @@ possible to include them:
document describes how GNU software should be written. If you
haven't read it, please do so, preferably _before_ starting to
modify `gawk'. (The `GNU Coding Standards' are available from the
- GNU Project's web site
- (http://www.gnu.org/prep/standards_toc.html). Texinfo, Info, and
- DVI versions are also available.)
+ GNU Project's website (http://www.gnu.org/prep/standards_toc.html).
+ Texinfo, Info, and DVI versions are also available.)
5. Use the `gawk' coding style. The C code for `gawk' follows the
instructions in the `GNU Coding Standards', with minor exceptions.
@@ -31269,7 +31281,7 @@ Index
* * (asterisk), * operator, as regexp operator: Regexp Operators.
(line 89)
* * (asterisk), * operator, null strings, matching: String Functions.
- (line 535)
+ (line 536)
* * (asterisk), ** operator <1>: Precedence. (line 49)
* * (asterisk), ** operator: Arithmetic Ops. (line 81)
* * (asterisk), **= operator <1>: Precedence. (line 95)
@@ -31319,23 +31331,23 @@ Index
* --non-decimal-data option: Options. (line 211)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 35)
-* --optimize option: Options. (line 239)
+* --optimize option: Options. (line 238)
* --posix option: Options. (line 256)
* --posix option, --traditional option and: Options. (line 275)
-* --pretty-print option: Options. (line 226)
+* --pretty-print option: Options. (line 225)
* --profile option <1>: Profiling. (line 12)
* --profile option: Options. (line 244)
* --re-interval option: Options. (line 281)
* --sandbox option: Options. (line 288)
* --sandbox option, disabling system() function: I/O Functions.
- (line 96)
+ (line 128)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
* --source option: Options. (line 117)
* --traditional option: Options. (line 81)
* --traditional option, --posix option and: Options. (line 275)
-* --use-lc-numeric option: Options. (line 221)
+* --use-lc-numeric option: Options. (line 220)
* --version option: Options. (line 302)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
(line 35)
@@ -31360,10 +31372,10 @@ Index
* -L option: Options. (line 297)
* -l option: Options. (line 173)
* -M option: Options. (line 205)
-* -N option: Options. (line 221)
+* -N option: Options. (line 220)
* -n option: Options. (line 211)
-* -O option: Options. (line 239)
-* -o option: Options. (line 226)
+* -O option: Options. (line 238)
+* -o option: Options. (line 225)
* -P option: Options. (line 256)
* -p option: Options. (line 244)
* -r option: Options. (line 281)
@@ -31474,7 +31486,7 @@ Index
* \ (backslash), in bracket expressions: Bracket Expressions. (line 17)
* \ (backslash), in escape sequences: Escape Sequences. (line 6)
* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
- (line 118)
+ (line 105)
* \ (backslash), in regexp constants: Computed Regexps. (line 29)
* \ (backslash), in shell commands: Quoting. (line 48)
* \ (backslash), regexp operator: Regexp Operators. (line 18)
@@ -31506,14 +31518,14 @@ Index
* Ada programming language: Glossary. (line 19)
* adding, features to gawk: Adding Code. (line 6)
* adding, fields: Changing Fields. (line 53)
-* advanced features, fixed-width data: Constant Size. (line 10)
+* advanced features, fixed-width data: Constant Size. (line 6)
* advanced features, gawk: Advanced Features. (line 6)
* advanced features, network programming: TCP/IP Networking. (line 6)
* advanced features, nondecimal input data: Nondecimal Data. (line 6)
* advanced features, processes, communicating with: Two-way I/O.
(line 6)
* advanced features, specifying field content: Splitting By Content.
- (line 10)
+ (line 9)
* Aho, Alfred <1>: Contributors. (line 11)
* Aho, Alfred: History. (line 17)
* alarm clock example program: Alarm Program. (line 11)
@@ -31543,7 +31555,7 @@ Index
(line 6)
* arbitrary precision integers: Arbitrary Precision Integers.
(line 6)
-* archeologists: Bugs. (line 6)
+* archaeologists: Bugs. (line 6)
* arctangent: Numeric Functions. (line 11)
* ARGC/ARGV variables: Auto-set. (line 15)
* ARGC/ARGV variables, command-line arguments: Other Arguments.
@@ -31565,13 +31577,13 @@ Index
(line 6)
* array scanning order, controlling: Controlling Scanning.
(line 14)
-* array, number of elements: String Functions. (line 200)
+* array, number of elements: String Functions. (line 201)
* arrays: Arrays. (line 6)
* arrays of arrays: Arrays of Arrays. (line 6)
* arrays, an example of using: Array Example. (line 6)
* arrays, and IGNORECASE variable: Array Intro. (line 94)
* arrays, as parameters to functions: Pass By Value/Reference.
- (line 47)
+ (line 44)
* arrays, associative: Array Intro. (line 50)
* arrays, associative, library functions and: Library Names. (line 58)
* arrays, deleting entire contents: Delete. (line 39)
@@ -31581,7 +31593,7 @@ Index
* arrays, elements, deleting: Delete. (line 6)
* arrays, elements, order of access by in operator: Scanning an Array.
(line 48)
-* arrays, elements, retrieving number of: String Functions. (line 41)
+* arrays, elements, retrieving number of: String Functions. (line 42)
* arrays, for statement and: Scanning an Array. (line 20)
* arrays, indexing: Array Intro. (line 50)
* arrays, merging into strings: Join Function. (line 6)
@@ -31607,12 +31619,12 @@ Index
* ASCII: Ordinal Functions. (line 45)
* asort <1>: Array Sorting Functions.
(line 6)
-* asort: String Functions. (line 41)
+* asort: String Functions. (line 42)
* asort() function (gawk), arrays, sorting: Array Sorting Functions.
(line 6)
* asorti <1>: Array Sorting Functions.
(line 6)
-* asorti: String Functions. (line 41)
+* asorti: String Functions. (line 42)
* asorti() function (gawk), arrays, sorting: Array Sorting Functions.
(line 6)
* assert() function (C library): Assert Function. (line 6)
@@ -31630,7 +31642,7 @@ Index
* asterisk (*), * operator, as regexp operator: Regexp Operators.
(line 89)
* asterisk (*), * operator, null strings, matching: String Functions.
- (line 535)
+ (line 536)
* asterisk (*), ** operator <1>: Precedence. (line 49)
* asterisk (*), ** operator: Arithmetic Ops. (line 81)
* asterisk (*), **= operator <1>: Precedence. (line 95)
@@ -31691,7 +31703,7 @@ Index
* awk, versions of, See Also Brian Kernighan's awk <1>: Other Versions.
(line 13)
* awk, versions of, See Also Brian Kernighan's awk: BTL. (line 6)
-* awka compiler for awk: Other Versions. (line 64)
+* awka compiler for awk: Other Versions. (line 68)
* AWKLIBPATH environment variable: AWKLIBPATH Variable. (line 6)
* AWKPATH environment variable <1>: PC Using. (line 10)
* AWKPATH environment variable: AWKPATH Variable. (line 6)
@@ -31743,12 +31755,12 @@ Index
* backslash (\), in bracket expressions: Bracket Expressions. (line 17)
* backslash (\), in escape sequences: Escape Sequences. (line 6)
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
- (line 118)
+ (line 105)
* backslash (\), in regexp constants: Computed Regexps. (line 29)
* backslash (\), in shell commands: Quoting. (line 48)
* backslash (\), regexp operator: Regexp Operators. (line 18)
* backtrace debugger command: Execution Stack. (line 13)
-* Beebe, Nelson H.F. <1>: Other Versions. (line 78)
+* Beebe, Nelson H.F. <1>: Other Versions. (line 82)
* Beebe, Nelson H.F.: Acknowledgments. (line 60)
* BEGIN pattern <1>: Using BEGIN/END. (line 6)
* BEGIN pattern <2>: BEGIN/END. (line 6)
@@ -31765,7 +31777,7 @@ Index
* BEGIN pattern, next/nextfile statements and: I/O And BEGIN/END.
(line 37)
* BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators.
- (line 20)
+ (line 21)
* BEGIN pattern, operators and: Using BEGIN/END. (line 17)
* BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16)
* BEGIN pattern, pwcat program: Passwd Functions. (line 143)
@@ -31834,10 +31846,10 @@ Index
* Brennan, Michael <3>: Delete. (line 56)
* Brennan, Michael <4>: Acknowledgments. (line 78)
* Brennan, Michael <5>: Foreword4. (line 30)
-* Brennan, Michael: Foreword3. (line 83)
+* Brennan, Michael: Foreword3. (line 84)
* Brian Kernighan's awk <1>: I/O Functions. (line 43)
* Brian Kernighan's awk <2>: Gory Details. (line 19)
-* Brian Kernighan's awk <3>: String Functions. (line 491)
+* Brian Kernighan's awk <3>: String Functions. (line 492)
* Brian Kernighan's awk <4>: Delete. (line 51)
* Brian Kernighan's awk <5>: Nextfile Statement. (line 47)
* Brian Kernighan's awk <6>: Continue Statement. (line 44)
@@ -31848,8 +31860,8 @@ Index
* Brian Kernighan's awk <11>: Regexp Field Splitting.
(line 67)
* Brian Kernighan's awk <12>: GNU Regexp Operators.
- (line 83)
-* Brian Kernighan's awk <13>: Escape Sequences. (line 122)
+ (line 82)
+* Brian Kernighan's awk <13>: Escape Sequences. (line 109)
* Brian Kernighan's awk: When. (line 21)
* Brian Kernighan's awk, extensions: BTL. (line 6)
* Brian Kernighan's awk, source code: Other Versions. (line 13)
@@ -31859,12 +31871,12 @@ Index
* Brown, Martin: Contributors. (line 82)
* BSD-based operating systems: Glossary. (line 611)
* bt debugger command (alias for backtrace): Execution Stack. (line 13)
-* Buening, Andreas <1>: Bugs. (line 72)
+* Buening, Andreas <1>: Bugs. (line 70)
* Buening, Andreas <2>: Contributors. (line 92)
* Buening, Andreas: Acknowledgments. (line 60)
* buffering, input/output <1>: Two-way I/O. (line 52)
-* buffering, input/output: I/O Functions. (line 139)
-* buffering, interactive vs. noninteractive: I/O Functions. (line 108)
+* buffering, input/output: I/O Functions. (line 140)
+* buffering, interactive vs. noninteractive: I/O Functions. (line 75)
* buffers, flushing: I/O Functions. (line 32)
* buffers, operators for: GNU Regexp Operators.
(line 48)
@@ -31872,12 +31884,12 @@ Index
* bug-gawk@gnu.org bug reporting address: Bugs. (line 30)
* built-in functions: Functions. (line 6)
* built-in functions, evaluation order: Calling Built-in. (line 30)
-* Busybox Awk: Other Versions. (line 88)
+* Busybox Awk: Other Versions. (line 92)
* c.e., See common extensions: Conventions. (line 51)
* call by reference: Pass By Value/Reference.
- (line 47)
+ (line 44)
* call by value: Pass By Value/Reference.
- (line 18)
+ (line 15)
* call stack, display in debugger: Execution Stack. (line 13)
* caret (^), ^ operator: Precedence. (line 49)
* caret (^), ^= operator <1>: Precedence. (line 95)
@@ -31890,7 +31902,7 @@ Index
* case sensitivity, and regexps: User-modified. (line 76)
* case sensitivity, and string comparisons: User-modified. (line 76)
* case sensitivity, array indices and: Array Intro. (line 94)
-* case sensitivity, converting case: String Functions. (line 521)
+* case sensitivity, converting case: String Functions. (line 522)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
@@ -31926,7 +31938,7 @@ Index
* close() function, portability: Close Files And Pipes.
(line 81)
* close() function, return value: Close Files And Pipes.
- (line 132)
+ (line 133)
* close() function, two-way pipes and: Two-way I/O. (line 59)
* Close, Diane <1>: Contributors. (line 20)
* Close, Diane: Manual History. (line 34)
@@ -31970,7 +31982,7 @@ Index
* common extensions, delete to delete entire arrays: Delete. (line 39)
* common extensions, func keyword: Definition Syntax. (line 93)
* common extensions, length() applied to an array: String Functions.
- (line 200)
+ (line 201)
* common extensions, RS as a regexp: gawk split records. (line 6)
* common extensions, single character fields: Single Character Fields.
(line 6)
@@ -32019,9 +32031,9 @@ Index
* control statements: Statements. (line 6)
* controlling array scanning order: Controlling Scanning.
(line 14)
-* convert string to lower case: String Functions. (line 522)
-* convert string to number: String Functions. (line 389)
-* convert string to upper case: String Functions. (line 528)
+* convert string to lower case: String Functions. (line 523)
+* convert string to number: String Functions. (line 390)
+* convert string to upper case: String Functions. (line 529)
* converting integer array subscripts: Numeric Array Subscripts.
(line 31)
* converting, dates to timestamps: Time Functions. (line 76)
@@ -32068,7 +32080,7 @@ Index
(line 43)
* dark corner, break statement: Break Statement. (line 51)
* dark corner, close() function: Close Files And Pipes.
- (line 132)
+ (line 133)
* dark corner, command-line arguments: Assignment Options. (line 43)
* dark corner, continue statement: Continue Statement. (line 44)
* dark corner, CONVFMT variable: Strings And Numbers. (line 40)
@@ -32076,34 +32088,33 @@ Index
* dark corner, escape sequences, for metacharacters: Escape Sequences.
(line 140)
* dark corner, exit statement: Exit Statement. (line 30)
-* dark corner, field separators: Field Splitting Summary.
- (line 46)
+* dark corner, field separators: Full Line Fields. (line 22)
* dark corner, FILENAME variable <1>: Auto-set. (line 90)
* dark corner, FILENAME variable: Getline Notes. (line 19)
-* dark corner, FNR/NR variables: Auto-set. (line 313)
+* dark corner, FNR/NR variables: Auto-set. (line 314)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
* dark corner, input files: awk split records. (line 111)
* dark corner, invoking awk: Command Line. (line 16)
-* dark corner, length() function: String Functions. (line 186)
+* dark corner, length() function: String Functions. (line 187)
* dark corner, locale's decimal point character: Locale influences conversions.
(line 17)
* dark corner, multiline records: Multiple Line. (line 35)
* dark corner, NF variable, decrementing: Changing Fields. (line 107)
* dark corner, OFMT variable: OFMT. (line 27)
* dark corner, regexp as second argument to index(): String Functions.
- (line 164)
+ (line 165)
* dark corner, regexp constants: Using Constant Regexps.
(line 6)
* dark corner, regexp constants, /= operator and: Assignment Ops.
(line 148)
* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
(line 43)
-* dark corner, split() function: String Functions. (line 360)
+* dark corner, split() function: String Functions. (line 361)
* dark corner, strings, storing: gawk split records. (line 83)
* dark corner, value of ARGV[0]: Auto-set. (line 39)
-* data, fixed-width: Constant Size. (line 10)
+* data, fixed-width: Constant Size. (line 6)
* data-driven languages: Basic High Level. (line 85)
* database, group, reading: Group Functions. (line 6)
* database, users, reading: Passwd Functions. (line 6)
@@ -32233,7 +32244,7 @@ Index
* decimal point character, locale specific: Options. (line 272)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
-* Deifik, Scott <1>: Bugs. (line 72)
+* Deifik, Scott <1>: Bugs. (line 70)
* Deifik, Scott <2>: Contributors. (line 53)
* Deifik, Scott: Acknowledgments. (line 60)
* delete ARRAY: Delete. (line 39)
@@ -32247,7 +32258,7 @@ Index
* deleting entire arrays: Delete. (line 39)
* Demaille, Akim: Acknowledgments. (line 60)
* describe call stack frame, in debugger: Debugger Info. (line 27)
-* differences between gawk and awk: String Functions. (line 200)
+* differences between gawk and awk: String Functions. (line 201)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 90)
* differences in awk and gawk, ARGIND variable: Auto-set. (line 44)
@@ -32274,7 +32285,7 @@ Index
* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
(line 37)
* differences in awk and gawk, FPAT variable: User-modified. (line 43)
-* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 115)
+* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 116)
* differences in awk and gawk, function arguments (gawk): Calling Built-in.
(line 16)
* differences in awk and gawk, getline command: Getline. (line 19)
@@ -32294,10 +32305,10 @@ Index
(line 34)
* differences in awk and gawk, LINT variable: User-modified. (line 88)
* differences in awk and gawk, match() function: String Functions.
- (line 262)
+ (line 263)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
-* differences in awk and gawk, PROCINFO array: Auto-set. (line 129)
+* differences in awk and gawk, PROCINFO array: Auto-set. (line 130)
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 125)
@@ -32307,15 +32318,15 @@ Index
(line 26)
* differences in awk and gawk, RS/RT variables: gawk split records.
(line 58)
-* differences in awk and gawk, RT variable: Auto-set. (line 264)
+* differences in awk and gawk, RT variable: Auto-set. (line 265)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
- (line 348)
+ (line 349)
* differences in awk and gawk, strings: Scalar Constants. (line 20)
* differences in awk and gawk, strings, storing: gawk split records.
(line 77)
-* differences in awk and gawk, SYMTAB variable: Auto-set. (line 268)
+* differences in awk and gawk, SYMTAB variable: Auto-set. (line 269)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
(line 151)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
@@ -32355,8 +32366,8 @@ Index
* dynamically loaded extensions: Dynamic Extensions. (line 6)
* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
-* effective group ID of gawk user: Auto-set. (line 134)
-* effective user ID of gawk user: Auto-set. (line 138)
+* effective group ID of gawk user: Auto-set. (line 135)
+* effective user ID of gawk user: Auto-set. (line 139)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 26)
* egrep.awk program: Egrep Program. (line 54)
@@ -32414,7 +32425,7 @@ Index
* ERRNO variable: Auto-set. (line 74)
* ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26)
* ERRNO variable, with close() function: Close Files And Pipes.
- (line 140)
+ (line 141)
* ERRNO variable, with getline command: Getline. (line 19)
* error handling: Special FD. (line 19)
* error handling, ERRNO variable and: Auto-set. (line 74)
@@ -32447,7 +32458,7 @@ Index
* exclamation point (!), !~ operator: Regexp Usage. (line 19)
* exit statement: Exit Statement. (line 6)
* exit status, of gawk: Exit Status. (line 6)
-* exit status, of VMS: VMS Running. (line 29)
+* exit status, of VMS: VMS Running. (line 28)
* exit the debugger: Miscellaneous Debugger Commands.
(line 99)
* exp: Numeric Functions. (line 18)
@@ -32471,7 +32482,7 @@ Index
(line 6)
* extension API version: Extension Versioning.
(line 6)
-* extension API, version number: Auto-set. (line 231)
+* extension API, version number: Auto-set. (line 232)
* extension example: Extension Example. (line 6)
* extension registration: Registration Functions.
(line 6)
@@ -32492,7 +32503,7 @@ Index
* extensions, common, fflush() function: I/O Functions. (line 43)
* extensions, common, func keyword: Definition Syntax. (line 93)
* extensions, common, length() applied to an array: String Functions.
- (line 200)
+ (line 201)
* extensions, common, RS as a regexp: gawk split records. (line 6)
* extensions, common, single character fields: Single Character Fields.
(line 6)
@@ -32520,8 +32531,7 @@ Index
* field separator, in multiline records: Multiple Line. (line 41)
* field separator, on command line: Command Line Field Separator.
(line 6)
-* field separator, POSIX and: Field Splitting Summary.
- (line 40)
+* field separator, POSIX and: Full Line Fields. (line 16)
* field separators <1>: User-modified. (line 50)
* field separators: Field Separators. (line 15)
* field separators, choice of: Field Separators. (line 51)
@@ -32547,7 +32557,7 @@ Index
* fields, single-character: Single Character Fields.
(line 6)
* FIELDWIDTHS variable <1>: User-modified. (line 37)
-* FIELDWIDTHS variable: Constant Size. (line 23)
+* FIELDWIDTHS variable: Constant Size. (line 22)
* file descriptors: Special FD. (line 6)
* file inclusion, @include directive: Include Files. (line 8)
* file names, distinguishing: Auto-set. (line 56)
@@ -32607,23 +32617,23 @@ Index
* files, source, search path for: Programs Exercises. (line 70)
* files, splitting: Split Program. (line 6)
* files, Texinfo, extracting programs from: Extract Program. (line 6)
-* find substring in string: String Functions. (line 155)
+* find substring in string: String Functions. (line 156)
* finding extensions: Finding Extensions. (line 6)
* finish debugger command: Debugger Execution Control.
(line 39)
* Fish, Fred: Contributors. (line 50)
-* fixed-width data: Constant Size. (line 10)
+* fixed-width data: Constant Size. (line 6)
* flag variables <1>: Tee Program. (line 20)
* flag variables: Boolean Ops. (line 69)
* floating-point, numbers, arbitrary precision: Arbitrary Precision Arithmetic.
(line 6)
-* floating-point, VAX/VMS: VMS Running. (line 51)
+* floating-point, VAX/VMS: VMS Running. (line 50)
* flush buffered output: I/O Functions. (line 28)
* fnmatch() extension function: Extension Sample Fnmatch.
(line 12)
-* FNR variable <1>: Auto-set. (line 99)
+* FNR variable <1>: Auto-set. (line 100)
* FNR variable: Records. (line 6)
-* FNR variable, changing: Auto-set. (line 313)
+* FNR variable, changing: Auto-set. (line 314)
* for statement: For Statement. (line 6)
* for statement, looping over arrays: Scanning an Array. (line 20)
* fork() extension function: Extension Sample Fork.
@@ -32637,7 +32647,7 @@ Index
* format time string: Time Functions. (line 48)
* formats, numeric output: OFMT. (line 6)
* formatting output: Printf. (line 6)
-* formatting strings: String Functions. (line 382)
+* formatting strings: String Functions. (line 383)
* forward slash (/) to enclose regular expressions: Regexp. (line 10)
* forward slash (/), / operator: Precedence. (line 55)
* forward slash (/), /= operator <1>: Precedence. (line 95)
@@ -32647,7 +32657,7 @@ Index
* forward slash (/), patterns and: Expression Patterns. (line 24)
* FPAT variable <1>: User-modified. (line 43)
* FPAT variable: Splitting By Content.
- (line 27)
+ (line 26)
* frame debugger command: Execution Stack. (line 27)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 7)
@@ -32673,14 +32683,14 @@ Index
* FSF (Free Software Foundation): Manual History. (line 6)
* fts() extension function: Extension Sample File Functions.
(line 61)
-* FUNCTAB array: Auto-set. (line 115)
+* FUNCTAB array: Auto-set. (line 116)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function calls, indirect, @-notation for: Indirect Calls. (line 47)
* function definition example: Function Example. (line 6)
* function pointers: Indirect Calls. (line 6)
* functions, arrays as parameters to: Pass By Value/Reference.
- (line 47)
+ (line 44)
* functions, built-in <1>: Functions. (line 6)
* functions, built-in: Function Calls. (line 10)
* functions, built-in, evaluation order: Calling Built-in. (line 30)
@@ -32711,7 +32721,7 @@ Index
* functions, recursive: Definition Syntax. (line 83)
* functions, string-translation: I18N Functions. (line 6)
* functions, undefined: Pass By Value/Reference.
- (line 71)
+ (line 68)
* functions, user-defined: User-defined. (line 6)
* functions, user-defined, calling: Function Caveats. (line 6)
* functions, user-defined, counts, in a profile: Profiling. (line 137)
@@ -32723,14 +32733,14 @@ Index
* G-d: Acknowledgments. (line 94)
* Garfinkle, Scott: Contributors. (line 34)
* gawk program, dynamic profiling: Profiling. (line 179)
-* gawk version: Auto-set. (line 206)
+* gawk version: Auto-set. (line 207)
* gawk, ARGIND variable in: Other Arguments. (line 15)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 21)
* gawk, bitwise operations in: Bitwise Functions. (line 40)
* gawk, break statement in: Break Statement. (line 51)
* gawk, character classes and: Bracket Expressions. (line 100)
-* gawk, coding style in: Adding Code. (line 39)
+* gawk, coding style in: Adding Code. (line 38)
* gawk, command-line options, and regular expressions: GNU Regexp Operators.
(line 70)
* gawk, configuring: Configuration Philosophy.
@@ -32744,26 +32754,26 @@ Index
* gawk, ERRNO variable in <2>: Auto-set. (line 74)
* gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26)
* gawk, ERRNO variable in <4>: Close Files And Pipes.
- (line 140)
+ (line 141)
* gawk, ERRNO variable in: Getline. (line 19)
-* gawk, escape sequences: Escape Sequences. (line 130)
+* gawk, escape sequences: Escape Sequences. (line 117)
* gawk, extensions, disabling: Options. (line 256)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, field separators and: User-modified. (line 71)
* gawk, FIELDWIDTHS variable in <1>: User-modified. (line 37)
-* gawk, FIELDWIDTHS variable in: Constant Size. (line 23)
+* gawk, FIELDWIDTHS variable in: Constant Size. (line 22)
* gawk, file names in: Special Files. (line 6)
* gawk, format-control characters: Control Letters. (line 18)
* gawk, FPAT variable in <1>: User-modified. (line 43)
* gawk, FPAT variable in: Splitting By Content.
- (line 27)
-* gawk, FUNCTAB array in: Auto-set. (line 115)
+ (line 26)
+* gawk, FUNCTAB array in: Auto-set. (line 116)
* gawk, function arguments and: Calling Built-in. (line 16)
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42)
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
(line 83)
-* gawk, IGNORECASE variable in <2>: String Functions. (line 57)
+* gawk, IGNORECASE variable in <2>: String Functions. (line 58)
* gawk, IGNORECASE variable in <3>: Array Intro. (line 94)
* gawk, IGNORECASE variable in <4>: User-modified. (line 76)
* gawk, IGNORECASE variable in: Case-sensitivity. (line 26)
@@ -32790,7 +32800,7 @@ Index
* gawk, predefined variables and: Built-in Variables. (line 14)
* gawk, PROCINFO array in <1>: Two-way I/O. (line 99)
* gawk, PROCINFO array in <2>: Time Functions. (line 47)
-* gawk, PROCINFO array in: Auto-set. (line 129)
+* gawk, PROCINFO array in: Auto-set. (line 130)
* gawk, regexp constants and: Using Constant Regexps.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
@@ -32798,14 +32808,14 @@ Index
* gawk, regular expressions, operators: GNU Regexp Operators.
(line 6)
* gawk, regular expressions, precedence: Regexp Operators. (line 161)
-* gawk, RT variable in <1>: Auto-set. (line 264)
+* gawk, RT variable in <1>: Auto-set. (line 265)
* gawk, RT variable in <2>: Multiple Line. (line 129)
* gawk, RT variable in: awk split records. (line 125)
* gawk, See Also awk: Preface. (line 34)
* gawk, source code, obtaining: Getting. (line 6)
-* gawk, splitting fields and: Constant Size. (line 88)
+* gawk, splitting fields and: Constant Size. (line 87)
* gawk, string-translation functions: I18N Functions. (line 6)
-* gawk, SYMTAB array in: Auto-set. (line 268)
+* gawk, SYMTAB array in: Auto-set. (line 269)
* gawk, TEXTDOMAIN variable in: User-modified. (line 151)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
@@ -32818,7 +32828,7 @@ Index
* General Public License (GPL): Glossary. (line 305)
* General Public License, See GPL: Manual History. (line 11)
* generate time values: Time Functions. (line 25)
-* gensub <1>: String Functions. (line 89)
+* gensub <1>: String Functions. (line 90)
* gensub: Using Constant Regexps.
(line 43)
* gensub() function (gawk), escape processing: Gory Details. (line 6)
@@ -32863,7 +32873,7 @@ Index
* gettext() function (C library): Explaining gettext. (line 63)
* gettimeofday() extension function: Extension Sample Time.
(line 12)
-* git utility <1>: Adding Code. (line 112)
+* git utility <1>: Adding Code. (line 111)
* git utility <2>: Accessing The Source.
(line 10)
* git utility <3>: Other Versions. (line 29)
@@ -32891,12 +32901,12 @@ Index
* Grigera, Juan: Contributors. (line 57)
* group database, reading: Group Functions. (line 6)
* group file: Group Functions. (line 6)
-* group ID of gawk user: Auto-set. (line 179)
+* group ID of gawk user: Auto-set. (line 180)
* groups, information about: Group Functions. (line 6)
-* gsub <1>: String Functions. (line 139)
+* gsub <1>: String Functions. (line 140)
* gsub: Using Constant Regexps.
(line 43)
-* gsub() function, arguments of: String Functions. (line 461)
+* gsub() function, arguments of: String Functions. (line 462)
* gsub() function, escape processing: Gory Details. (line 6)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 66)
@@ -32938,8 +32948,8 @@ Index
(line 53)
* IGNORECASE variable, with ~ and !~ operators: Case-sensitivity.
(line 26)
-* Illumos: Other Versions. (line 105)
-* Illumos, POSIX-compliant awk: Other Versions. (line 105)
+* Illumos: Other Versions. (line 109)
+* Illumos, POSIX-compliant awk: Other Versions. (line 109)
* implementation issues, gawk: Notes. (line 6)
* implementation issues, gawk, debugging: Compatibility Mode. (line 6)
* implementation issues, gawk, limits <1>: Redirection. (line 129)
@@ -32956,7 +32966,7 @@ Index
* in operator, use in loops: Scanning an Array. (line 17)
* including files, @include directive: Include Files. (line 8)
* increment operators: Increment Ops. (line 6)
-* index: String Functions. (line 155)
+* index: String Functions. (line 156)
* indexing arrays: Array Intro. (line 50)
* indirect function calls: Indirect Calls. (line 6)
* indirect function calls, @-notation: Indirect Calls. (line 47)
@@ -32975,7 +32985,7 @@ Index
* input files, running awk without: Read Terminal. (line 6)
* input files, variable assignments and: Other Arguments. (line 26)
* input pipeline: Getline/Pipe. (line 9)
-* input record, length of: String Functions. (line 177)
+* input record, length of: String Functions. (line 178)
* input redirection: Getline/File. (line 6)
* input, data, nondecimal: Nondecimal Data. (line 6)
* input, explicit: Getline. (line 6)
@@ -32999,7 +33009,7 @@ Index
* integers, arbitrary precision: Arbitrary Precision Integers.
(line 6)
* integers, unsigned: Computer Arithmetic. (line 41)
-* interacting with other programs: I/O Functions. (line 74)
+* interacting with other programs: I/O Functions. (line 106)
* internationalization <1>: I18N and L10N. (line 6)
* internationalization: I18N Functions. (line 6)
* internationalization, localization <1>: Internationalization.
@@ -33020,7 +33030,7 @@ Index
* interpreted programs: Basic High Level. (line 15)
* interval expressions, regexp operator: Regexp Operators. (line 116)
* inventory-shipped file: Sample Data Files. (line 32)
-* invoke shell command: I/O Functions. (line 74)
+* invoke shell command: I/O Functions. (line 106)
* isarray: Type Functions. (line 11)
* ISO: Glossary. (line 367)
* ISO 8859-1: Glossary. (line 133)
@@ -33028,9 +33038,9 @@ Index
* Jacobs, Andrew: Passwd Functions. (line 90)
* Jaegermann, Michal <1>: Contributors. (line 45)
* Jaegermann, Michal: Acknowledgments. (line 60)
-* Java implementation of awk: Other Versions. (line 113)
+* Java implementation of awk: Other Versions. (line 117)
* Java programming language: Glossary. (line 379)
-* jawk: Other Versions. (line 113)
+* jawk: Other Versions. (line 117)
* Jedi knights: Undocumented. (line 6)
* Johansen, Chris: Signature Program. (line 25)
* join() user-defined function: Join Function. (line 18)
@@ -33076,12 +33086,12 @@ Index
* left shift: Bitwise Functions. (line 47)
* left shift, bitwise: Bitwise Functions. (line 32)
* leftmost longest match: Multiple Line. (line 26)
-* length: String Functions. (line 170)
-* length of input record: String Functions. (line 177)
-* length of string: String Functions. (line 170)
+* length: String Functions. (line 171)
+* length of input record: String Functions. (line 178)
+* length of string: String Functions. (line 171)
* Lesser General Public License (LGPL): Glossary. (line 396)
* LGPL (Lesser General Public License): Glossary. (line 396)
-* libmawk: Other Versions. (line 121)
+* libmawk: Other Versions. (line 125)
* libraries of awk functions: Library Functions. (line 6)
* libraries of awk functions, assertions: Assert Function. (line 6)
* libraries of awk functions, associative arrays and: Library Names.
@@ -33123,7 +33133,7 @@ Index
* lint checking, POSIXLY_CORRECT environment variable: Options.
(line 341)
* lint checking, undefined functions: Pass By Value/Reference.
- (line 88)
+ (line 85)
* LINT variable: User-modified. (line 88)
* Linux <1>: Glossary. (line 611)
* Linux <2>: I18N Example. (line 55)
@@ -33142,9 +33152,9 @@ Index
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
(line 6)
-* log: Numeric Functions. (line 30)
+* log: Numeric Functions. (line 28)
* log files, timestamps in: Time Functions. (line 6)
-* logarithm: Numeric Functions. (line 30)
+* logarithm: Numeric Functions. (line 28)
* logical false/true: Truth Values. (line 6)
* logical operators, See Boolean expressions: Boolean Ops. (line 6)
* login information: Passwd Functions. (line 16)
@@ -33165,7 +33175,7 @@ Index
* mail-list file: Sample Data Files. (line 6)
* mailing labels, printing: Labels Program. (line 6)
* mailing list, GNITS: Acknowledgments. (line 52)
-* Malmberg, John <1>: Bugs. (line 72)
+* Malmberg, John <1>: Bugs. (line 70)
* Malmberg, John: Acknowledgments. (line 60)
* Malmberg, John E.: Contributors. (line 137)
* mark parity: Ordinal Functions. (line 45)
@@ -33173,20 +33183,20 @@ Index
(line 6)
* marked strings, extracting: String Extraction. (line 6)
* Marx, Groucho: Increment Ops. (line 60)
-* match: String Functions. (line 210)
-* match regexp in string: String Functions. (line 210)
+* match: String Functions. (line 211)
+* match regexp in string: String Functions. (line 211)
* match() function, RSTART/RLENGTH variables: String Functions.
- (line 227)
+ (line 228)
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
-* matching, null strings: String Functions. (line 535)
-* mawk utility <1>: Other Versions. (line 44)
+* matching, null strings: String Functions. (line 536)
+* mawk utility <1>: Other Versions. (line 48)
* mawk utility <2>: Nextfile Statement. (line 47)
* mawk utility <3>: Concatenation. (line 36)
* mawk utility <4>: Getline/Pipe. (line 62)
-* mawk utility: Escape Sequences. (line 130)
-* maximum precision supported by MPFR library: Auto-set. (line 220)
+* mawk utility: Escape Sequences. (line 117)
+* maximum precision supported by MPFR library: Auto-set. (line 221)
* McIlroy, Doug: Glossary. (line 149)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
@@ -33199,7 +33209,7 @@ Index
* messages from extensions: Printing Messages. (line 6)
* metacharacters in regular expressions: Regexp Operators. (line 6)
* metacharacters, escape sequences for: Escape Sequences. (line 136)
-* minimum precision supported by MPFR library: Auto-set. (line 223)
+* minimum precision supported by MPFR library: Auto-set. (line 224)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
@@ -33248,7 +33258,7 @@ Index
(line 47)
* nexti debugger command: Debugger Execution Control.
(line 49)
-* NF variable <1>: Auto-set. (line 104)
+* NF variable <1>: Auto-set. (line 105)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
* ni debugger command (alias for nexti): Debugger Execution Control.
@@ -33257,9 +33267,9 @@ Index
* non-existent array elements: Reference to Elements.
(line 23)
* not Boolean-logic operator: Boolean Ops. (line 6)
-* NR variable <1>: Auto-set. (line 124)
+* NR variable <1>: Auto-set. (line 125)
* NR variable: Records. (line 6)
-* NR variable, changing: Auto-set. (line 313)
+* NR variable, changing: Auto-set. (line 314)
* null strings <1>: Basic Data Typing. (line 26)
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
@@ -33271,9 +33281,9 @@ Index
(line 43)
* null strings, converting numbers to strings: Strings And Numbers.
(line 21)
-* null strings, matching: String Functions. (line 535)
+* null strings, matching: String Functions. (line 536)
* number as string of bits: Bitwise Functions. (line 110)
-* number of array elements: String Functions. (line 200)
+* number of array elements: String Functions. (line 201)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
* number sign (#), commenting: Comments. (line 6)
@@ -33304,7 +33314,7 @@ Index
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
* OpenBSD: Glossary. (line 611)
-* OpenSolaris: Other Versions. (line 96)
+* OpenSolaris: Other Versions. (line 100)
* operating systems, BSD-based: Manual History. (line 28)
* operating systems, PC, gawk on: PC Using. (line 6)
* operating systems, PC, gawk on, installing: PC Installation.
@@ -33354,10 +33364,10 @@ Index
* ord() user-defined function: Ordinal Functions. (line 16)
* order of evaluation, concatenation: Concatenation. (line 41)
* ORS variable <1>: User-modified. (line 118)
-* ORS variable: Output Separators. (line 20)
+* ORS variable: Output Separators. (line 21)
* output field separator, See OFS variable: Changing Fields. (line 64)
* output record separator, See ORS variable: Output Separators.
- (line 20)
+ (line 21)
* output redirection: Redirection. (line 6)
* output wrapper: Output Wrappers. (line 6)
* output, buffering: I/O Functions. (line 32)
@@ -33368,16 +33378,16 @@ Index
* output, formatted: Printf. (line 6)
* output, pipes: Redirection. (line 57)
* output, printing, See printing: Printing. (line 6)
-* output, records: Output Separators. (line 20)
+* output, records: Output Separators. (line 21)
* output, standard: Special FD. (line 6)
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
* Papadopoulos, Panos: Contributors. (line 128)
-* parent process ID of gawk process: Auto-set. (line 188)
+* parent process ID of gawk process: Auto-set. (line 189)
* parentheses (), in a profile: Profiling. (line 146)
* parentheses (), regexp operator: Regexp Operators. (line 81)
* password file: Passwd Functions. (line 16)
-* patsplit: String Functions. (line 296)
+* patsplit: String Functions. (line 297)
* patterns: Patterns and Actions.
(line 6)
* patterns, comparison expressions as: Expression Patterns. (line 14)
@@ -33389,8 +33399,8 @@ Index
* patterns, regexp constants as: Expression Patterns. (line 34)
* patterns, types of: Pattern Overview. (line 15)
* pawk (profiling version of Brian Kernighan's awk): Other Versions.
- (line 78)
-* pawk, awk-like facilities for Python: Other Versions. (line 125)
+ (line 82)
+* pawk, awk-like facilities for Python: Other Versions. (line 129)
* PC operating systems, gawk on: PC Using. (line 6)
* PC operating systems, gawk on, installing: PC Installation. (line 6)
* percent sign (%), % operator: Precedence. (line 55)
@@ -33404,7 +33414,7 @@ Index
(line 6)
* pipe, input: Getline/Pipe. (line 9)
* pipe, output: Redirection. (line 57)
-* Pitts, Dave <1>: Bugs. (line 72)
+* Pitts, Dave <1>: Bugs. (line 70)
* Pitts, Dave: Acknowledgments. (line 60)
* Plauger, P.J.: Library Functions. (line 12)
* plug-in: Extension Intro. (line 6)
@@ -33422,7 +33432,7 @@ Index
* portability, ARGV variable: Executable Scripts. (line 59)
* portability, backslash continuation and: Statements/Lines. (line 30)
* portability, backslash in escape sequences: Escape Sequences.
- (line 118)
+ (line 105)
* portability, close() function and: Close Files And Pipes.
(line 81)
* portability, data files as single record: gawk split records.
@@ -33433,15 +33443,15 @@ Index
* portability, gawk: New Ports. (line 6)
* portability, gettext library and: Explaining gettext. (line 11)
* portability, internationalization and: I18N Portability. (line 6)
-* portability, length() function: String Functions. (line 179)
+* portability, length() function: String Functions. (line 180)
* portability, new awk vs. old awk: Strings And Numbers. (line 57)
* portability, next statement in user-defined functions: Pass By Value/Reference.
- (line 91)
+ (line 88)
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
* portability, POSIXLY_CORRECT environment variable: Options. (line 361)
-* portability, substr() function: String Functions. (line 511)
+* portability, substr() function: String Functions. (line 512)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 37)
* portable object files, converting to message object files: I18N Example.
@@ -33461,7 +33471,7 @@ Index
* POSIX awk, < operator and: Getline/File. (line 26)
* POSIX awk, arithmetic operators and: Arithmetic Ops. (line 30)
* POSIX awk, backslashes in string constants: Escape Sequences.
- (line 118)
+ (line 105)
* POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 16)
* POSIX awk, bracket expressions and: Bracket Expressions. (line 26)
* POSIX awk, bracket expressions and, character classes: Bracket Expressions.
@@ -33471,13 +33481,12 @@ Index
* POSIX awk, continue statement and: Continue Statement. (line 44)
* POSIX awk, CONVFMT variable and: User-modified. (line 30)
* POSIX awk, date utility and: Time Functions. (line 254)
-* POSIX awk, field separators and <1>: Field Splitting Summary.
- (line 40)
+* POSIX awk, field separators and <1>: Full Line Fields. (line 16)
* POSIX awk, field separators and: Fields. (line 6)
* POSIX awk, FS variable and: User-modified. (line 60)
* POSIX awk, function keyword in: Definition Syntax. (line 93)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 90)
-* POSIX awk, functions and, length(): String Functions. (line 179)
+* POSIX awk, functions and, length(): String Functions. (line 180)
* POSIX awk, GNU long options and: Options. (line 15)
* POSIX awk, interval expressions in: Regexp Operators. (line 135)
* POSIX awk, next/nextfile statements and: Next Statement. (line 44)
@@ -33540,24 +33549,24 @@ Index
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
* private variables: Library Names. (line 11)
-* process group idIDof gawk process: Auto-set. (line 182)
-* process ID of gawk process: Auto-set. (line 185)
+* process group idIDof gawk process: Auto-set. (line 183)
+* process ID of gawk process: Auto-set. (line 186)
* processes, two-way communications with: Two-way I/O. (line 6)
* processing data: Basic High Level. (line 6)
* PROCINFO array <1>: Passwd Functions. (line 6)
* PROCINFO array <2>: Time Functions. (line 47)
-* PROCINFO array: Auto-set. (line 129)
+* PROCINFO array: Auto-set. (line 130)
* PROCINFO array, and communications via ptys: Two-way I/O. (line 99)
* PROCINFO array, and group membership: Group Functions. (line 6)
* PROCINFO array, and user and group ID numbers: Id Program. (line 15)
* PROCINFO array, testing the field splitting: Passwd Functions.
(line 154)
-* PROCINFO array, uses: Auto-set. (line 241)
+* PROCINFO array, uses: Auto-set. (line 242)
* PROCINFO, values of sorted_in: Controlling Scanning.
(line 26)
* profiling awk programs: Profiling. (line 6)
* profiling awk programs, dynamically: Profiling. (line 179)
-* program identifiers: Auto-set. (line 147)
+* program identifiers: Auto-set. (line 148)
* program, definition of: Getting Started. (line 21)
* programming conventions, --non-decimal-data option: Nondecimal Data.
(line 35)
@@ -33583,13 +33592,13 @@ Index
* pwcat program: Passwd Functions. (line 23)
* q debugger command (alias for quit): Miscellaneous Debugger Commands.
(line 99)
-* QSE Awk: Other Versions. (line 131)
+* QSE Awk: Other Versions. (line 135)
* Quanstrom, Erik: Alarm Program. (line 8)
* question mark (?), ?: operator: Precedence. (line 92)
* question mark (?), regexp operator <1>: GNU Regexp Operators.
(line 59)
* question mark (?), regexp operator: Regexp Operators. (line 111)
-* QuikTrim Awk: Other Versions. (line 135)
+* QuikTrim Awk: Other Versions. (line 139)
* quit debugger command: Miscellaneous Debugger Commands.
(line 99)
* QUIT signal (MS-Windows): Profiling. (line 214)
@@ -33601,12 +33610,12 @@ Index
* Rakitzis, Byron: History Sorting. (line 25)
* Ramey, Chet <1>: General Data Types. (line 6)
* Ramey, Chet: Acknowledgments. (line 60)
-* rand: Numeric Functions. (line 35)
+* rand: Numeric Functions. (line 33)
* random numbers, Cliff: Cliff Random Function.
(line 6)
* random numbers, rand()/srand() functions: Numeric Functions.
- (line 35)
-* random numbers, seed of: Numeric Functions. (line 65)
+ (line 33)
+* random numbers, seed of: Numeric Functions. (line 63)
* range expressions (regexps): Bracket Expressions. (line 6)
* range patterns: Ranges. (line 6)
* range patterns, line continuation and: Ranges. (line 65)
@@ -33691,12 +33700,12 @@ Index
* regular expressions, searching for: Egrep Program. (line 6)
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
-* replace in string: String Functions. (line 407)
+* replace in string: String Functions. (line 408)
* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
* return value, close() function: Close Files And Pipes.
- (line 132)
+ (line 133)
* rev() user-defined function: Function Example. (line 54)
* revoutput extension: Extension Sample Revout.
(line 11)
@@ -33715,10 +33724,10 @@ Index
* right shift: Bitwise Functions. (line 53)
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 54)
-* RLENGTH variable: Auto-set. (line 251)
-* RLENGTH variable, match() function and: String Functions. (line 227)
+* RLENGTH variable: Auto-set. (line 252)
+* RLENGTH variable, match() function and: String Functions. (line 228)
* Robbins, Arnold <1>: Future Extensions. (line 6)
-* Robbins, Arnold <2>: Bugs. (line 72)
+* Robbins, Arnold <2>: Bugs. (line 70)
* Robbins, Arnold <3>: Contributors. (line 144)
* Robbins, Arnold <4>: General Data Types. (line 6)
* Robbins, Arnold <5>: Alarm Program. (line 6)
@@ -33741,9 +33750,9 @@ Index
* RS variable: awk split records. (line 12)
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift: Bitwise Functions. (line 53)
-* RSTART variable: Auto-set. (line 257)
-* RSTART variable, match() function and: String Functions. (line 227)
-* RT variable <1>: Auto-set. (line 264)
+* RSTART variable: Auto-set. (line 258)
+* RSTART variable, match() function and: String Functions. (line 228)
+* RT variable <1>: Auto-set. (line 265)
* RT variable <2>: Multiple Line. (line 129)
* RT variable: awk split records. (line 125)
* Rubin, Paul <1>: Contributors. (line 15)
@@ -33763,17 +33772,17 @@ Index
* scanning arrays: Scanning an Array. (line 6)
* scanning multidimensional arrays: Multiscanning. (line 11)
* Schorr, Andrew <1>: Contributors. (line 133)
-* Schorr, Andrew <2>: Auto-set. (line 296)
+* Schorr, Andrew <2>: Auto-set. (line 297)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
-* search and replace in strings: String Functions. (line 89)
-* search in string: String Functions. (line 155)
-* search paths <1>: VMS Running. (line 58)
+* search and replace in strings: String Functions. (line 90)
+* search in string: String Functions. (line 156)
+* search paths <1>: VMS Running. (line 57)
* search paths <2>: PC Using. (line 10)
* search paths: Programs Exercises. (line 70)
* search paths, for loadable extensions: AWKLIBPATH Variable. (line 6)
-* search paths, for source files <1>: VMS Running. (line 58)
+* search paths, for source files <1>: VMS Running. (line 57)
* search paths, for source files <2>: PC Using. (line 10)
* search paths, for source files <3>: Programs Exercises. (line 70)
* search paths, for source files: AWKPATH Variable. (line 6)
@@ -33781,9 +33790,8 @@ Index
* searching, for words: Dupword Program. (line 6)
* sed utility <1>: Glossary. (line 11)
* sed utility <2>: Simple Sed. (line 6)
-* sed utility: Field Splitting Summary.
- (line 46)
-* seeding random number generator: Numeric Functions. (line 65)
+* sed utility: Full Line Fields. (line 22)
+* seeding random number generator: Numeric Functions. (line 63)
* semicolon (;), AWKPATH variable and: PC Using. (line 10)
* semicolon (;), separating statements in actions <1>: Statements.
(line 10)
@@ -33844,26 +33852,26 @@ Index
* sidebar, A Constant's Base Does Not Affect Its Value: Nondecimal-numbers.
(line 64)
* sidebar, Backslash Before Regular Characters: Escape Sequences.
- (line 116)
-* sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary.
- (line 38)
-* sidebar, Changing NR and FNR: Auto-set. (line 311)
+ (line 103)
+* sidebar, Changing FS Does Not Affect the Fields: Full Line Fields.
+ (line 14)
+* sidebar, Changing NR and FNR: Auto-set. (line 312)
* sidebar, Controlling Output Buffering with system(): I/O Functions.
- (line 137)
+ (line 138)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
(line 134)
* sidebar, FS and IGNORECASE: Field Splitting Summary.
- (line 64)
+ (line 38)
* sidebar, Interactive Versus Noninteractive Buffering: I/O Functions.
- (line 106)
-* sidebar, Matching the Null String: String Functions. (line 533)
+ (line 73)
+* sidebar, Matching the Null String: String Functions. (line 534)
* sidebar, Operator Evaluation Order: Increment Ops. (line 58)
* sidebar, Piping into sh: Redirection. (line 134)
-* sidebar, Pre-POSIX awk Used OFMT For String Conversion: Strings And Numbers.
+* sidebar, Pre-POSIX awk Used OFMT for String Conversion: Strings And Numbers.
(line 55)
-* sidebar, Recipe For A Programming Language: History. (line 6)
+* sidebar, Recipe for a Programming Language: History. (line 6)
* sidebar, RS = "\0" Is Not Portable: gawk split records. (line 63)
-* sidebar, So Why Does gawk have BEGINFILE and ENDFILE?: Filetrans Function.
+* sidebar, So Why Does gawk Have BEGINFILE and ENDFILE?: Filetrans Function.
(line 82)
* sidebar, Syntactic Ambiguities Between /= and Regular Expressions: Assignment Ops.
(line 146)
@@ -33872,7 +33880,7 @@ Index
* sidebar, Using \n in Bracket Expressions of Dynamic Regexps: Computed Regexps.
(line 57)
* sidebar, Using close()'s Return Value: Close Files And Pipes.
- (line 130)
+ (line 131)
* SIGHUP signal, for dynamic profiling: Profiling. (line 211)
* SIGINT signal (MS-Windows): Profiling. (line 214)
* signals, HUP/SIGHUP, for profiling: Profiling. (line 211)
@@ -33884,8 +33892,8 @@ Index
* SIGUSR1 signal, for dynamic profiling: Profiling. (line 188)
* silent debugger command: Debugger Execution Control.
(line 10)
-* sin: Numeric Functions. (line 76)
-* sine: Numeric Functions. (line 76)
+* sin: Numeric Functions. (line 74)
+* sine: Numeric Functions. (line 74)
* single quote ('): One-shot. (line 15)
* single quote (') in gawk command lines: Long. (line 35)
* single quote ('), in shell commands: Quoting. (line 48)
@@ -33899,46 +33907,46 @@ Index
* sleep utility: Alarm Program. (line 110)
* sleep() extension function: Extension Sample Time.
(line 22)
-* Solaris, POSIX-compliant awk: Other Versions. (line 96)
-* sort array: String Functions. (line 41)
-* sort array indices: String Functions. (line 41)
+* Solaris, POSIX-compliant awk: Other Versions. (line 100)
+* sort array: String Functions. (line 42)
+* sort array indices: String Functions. (line 42)
* sort function, arrays, sorting: Array Sorting Functions.
(line 6)
* sort utility: Word Sorting. (line 50)
* sort utility, coprocesses and: Two-way I/O. (line 65)
* sorting characters in different languages: Explaining gettext.
(line 94)
-* source code, awka: Other Versions. (line 64)
+* source code, awka: Other Versions. (line 68)
* source code, Brian Kernighan's awk: Other Versions. (line 13)
-* source code, Busybox Awk: Other Versions. (line 88)
+* source code, Busybox Awk: Other Versions. (line 92)
* source code, gawk: Gawk Distribution. (line 6)
-* source code, Illumos awk: Other Versions. (line 105)
-* source code, jawk: Other Versions. (line 113)
-* source code, libmawk: Other Versions. (line 121)
-* source code, mawk: Other Versions. (line 44)
+* source code, Illumos awk: Other Versions. (line 109)
+* source code, jawk: Other Versions. (line 117)
+* source code, libmawk: Other Versions. (line 125)
+* source code, mawk: Other Versions. (line 48)
* source code, mixing: Options. (line 117)
-* source code, pawk: Other Versions. (line 78)
-* source code, pawk (Python version): Other Versions. (line 125)
-* source code, QSE Awk: Other Versions. (line 131)
-* source code, QuikTrim Awk: Other Versions. (line 135)
-* source code, Solaris awk: Other Versions. (line 96)
+* source code, pawk: Other Versions. (line 82)
+* source code, pawk (Python version): Other Versions. (line 129)
+* source code, QSE Awk: Other Versions. (line 135)
+* source code, QuikTrim Awk: Other Versions. (line 139)
+* source code, Solaris awk: Other Versions. (line 100)
* source files, search path for: Programs Exercises. (line 70)
* sparse arrays: Array Intro. (line 72)
* Spencer, Henry: Glossary. (line 11)
-* split: String Functions. (line 315)
-* split string into array: String Functions. (line 296)
+* split: String Functions. (line 316)
+* split string into array: String Functions. (line 297)
* split utility: Split Program. (line 6)
* split() function, array elements, deleting: Delete. (line 61)
* split.awk program: Split Program. (line 30)
-* sprintf <1>: String Functions. (line 382)
+* sprintf <1>: String Functions. (line 383)
* sprintf: OFMT. (line 15)
* sprintf() function, OFMT variable and: User-modified. (line 113)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
-* sqrt: Numeric Functions. (line 79)
+* sqrt: Numeric Functions. (line 77)
* square brackets ([]), regexp operator: Regexp Operators. (line 56)
-* square root: Numeric Functions. (line 79)
-* srand: Numeric Functions. (line 83)
+* square root: Numeric Functions. (line 77)
+* srand: Numeric Functions. (line 81)
* stack frame: Debugging Terms. (line 10)
* Stallman, Richard <1>: Glossary. (line 296)
* Stallman, Richard <2>: Contributors. (line 23)
@@ -33961,23 +33969,22 @@ Index
* stop automatic display, in debugger: Viewing And Changing Data.
(line 80)
* stream editors <1>: Simple Sed. (line 6)
-* stream editors: Field Splitting Summary.
- (line 46)
+* stream editors: Full Line Fields. (line 22)
* strftime: Time Functions. (line 48)
* string constants: Scalar Constants. (line 15)
* string constants, vs. regexp constants: Computed Regexps. (line 39)
* string extraction (internationalization): String Extraction.
(line 6)
-* string length: String Functions. (line 170)
+* string length: String Functions. (line 171)
* string operators: Concatenation. (line 8)
-* string, regular expression match: String Functions. (line 210)
+* string, regular expression match: String Functions. (line 211)
* string-manipulation functions: String Functions. (line 6)
* string-matching operators: Regexp Usage. (line 19)
* string-translation functions: I18N Functions. (line 6)
-* strings splitting, example: String Functions. (line 334)
+* strings splitting, example: String Functions. (line 335)
* strings, converting <1>: Bitwise Functions. (line 110)
* strings, converting: Strings And Numbers. (line 6)
-* strings, converting letter case: String Functions. (line 521)
+* strings, converting letter case: String Functions. (line 522)
* strings, converting, numbers to: User-modified. (line 30)
* strings, empty, See null strings: awk split records. (line 115)
* strings, extracting: String Extraction. (line 6)
@@ -33987,13 +33994,13 @@ Index
* strings, null: Regexp Field Splitting.
(line 43)
* strings, numeric: Variable Typing. (line 6)
-* strtonum: String Functions. (line 389)
+* strtonum: String Functions. (line 390)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 35)
-* sub <1>: String Functions. (line 407)
+* sub <1>: String Functions. (line 408)
* sub: Using Constant Regexps.
(line 43)
-* sub() function, arguments of: String Functions. (line 461)
+* sub() function, arguments of: String Functions. (line 462)
* sub() function, escape processing: Gory Details. (line 6)
* subscript separators: User-modified. (line 145)
* subscripts in arrays, multidimensional: Multidimensional. (line 10)
@@ -34006,16 +34013,16 @@ Index
* SUBSEP variable: User-modified. (line 145)
* SUBSEP variable, and multidimensional arrays: Multidimensional.
(line 16)
-* substitute in string: String Functions. (line 89)
-* substr: String Functions. (line 480)
-* substring: String Functions. (line 480)
-* Sumner, Andrew: Other Versions. (line 64)
-* supplementary groups of gawk process: Auto-set. (line 236)
+* substitute in string: String Functions. (line 90)
+* substr: String Functions. (line 481)
+* substring: String Functions. (line 481)
+* Sumner, Andrew: Other Versions. (line 68)
+* supplementary groups of gawk process: Auto-set. (line 237)
* switch statement: Switch Statement. (line 6)
-* SYMTAB array: Auto-set. (line 268)
+* SYMTAB array: Auto-set. (line 269)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
-* system: I/O Functions. (line 74)
+* system: I/O Functions. (line 106)
* systime: Time Functions. (line 66)
* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
* tbreak debugger command: Breakpoint Control. (line 90)
@@ -34029,7 +34036,7 @@ Index
* testbits.awk program: Bitwise Functions. (line 71)
* testext extension: Extension Sample API Tests.
(line 6)
-* Texinfo <1>: Adding Code. (line 100)
+* Texinfo <1>: Adding Code. (line 99)
* Texinfo <2>: Distribution contents.
(line 77)
* Texinfo <3>: Extract Program. (line 12)
@@ -34065,8 +34072,8 @@ Index
* timestamps, converting dates to: Time Functions. (line 76)
* timestamps, formatted: Getlocaltime Function.
(line 6)
-* tolower: String Functions. (line 522)
-* toupper: String Functions. (line 528)
+* tolower: String Functions. (line 523)
+* toupper: String Functions. (line 529)
* tr utility: Translate Program. (line 6)
* trace debugger command: Miscellaneous Debugger Commands.
(line 108)
@@ -34079,10 +34086,10 @@ Index
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 30)
* troubleshooting, backslash before nonspecial character: Escape Sequences.
- (line 118)
+ (line 105)
* troubleshooting, division: Arithmetic Ops. (line 44)
* troubleshooting, fatal errors, field widths, specifying: Constant Size.
- (line 23)
+ (line 22)
* troubleshooting, fatal errors, printf format strings: Format Modifiers.
(line 158)
* troubleshooting, fflush() function: I/O Functions. (line 62)
@@ -34092,8 +34099,8 @@ Index
* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in.
(line 16)
* troubleshooting, getline function: File Checking. (line 25)
-* troubleshooting, gsub()/sub() functions: String Functions. (line 471)
-* troubleshooting, match() function: String Functions. (line 291)
+* troubleshooting, gsub()/sub() functions: String Functions. (line 472)
+* troubleshooting, match() function: String Functions. (line 292)
* troubleshooting, print statement, omitting commas: Print Examples.
(line 31)
* troubleshooting, printing: Redirection. (line 112)
@@ -34102,8 +34109,8 @@ Index
* troubleshooting, regexp constants vs. string constants: Computed Regexps.
(line 39)
* troubleshooting, string concatenation: Concatenation. (line 26)
-* troubleshooting, substr() function: String Functions. (line 498)
-* troubleshooting, system() function: I/O Functions. (line 96)
+* troubleshooting, substr() function: String Functions. (line 499)
+* troubleshooting, system() function: I/O Functions. (line 128)
* troubleshooting, typographical errors, global variables: Options.
(line 98)
* true, logical: Truth Values. (line 6)
@@ -34118,7 +34125,7 @@ Index
* unassigned array elements: Reference to Elements.
(line 18)
* undefined functions: Pass By Value/Reference.
- (line 71)
+ (line 68)
* underscore (_), C macro: Explaining gettext. (line 71)
* underscore (_), in names of private variables: Library Names.
(line 29)
@@ -34135,9 +34142,9 @@ Index
* uniq.awk program: Uniq Program. (line 65)
* Unix: Glossary. (line 611)
* Unix awk, backslashes in escape sequences: Escape Sequences.
- (line 130)
+ (line 117)
* Unix awk, close() function and: Close Files And Pipes.
- (line 132)
+ (line 133)
* Unix awk, password files, field separators and: Command Line Field Separator.
(line 62)
* Unix, awk scripts and: Executable Scripts. (line 6)
@@ -34189,10 +34196,10 @@ Index
* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
(line 6)
* variables, user-defined: Variables. (line 6)
-* version of gawk: Auto-set. (line 206)
-* version of gawk extension API: Auto-set. (line 231)
-* version of GNU MP library: Auto-set. (line 217)
-* version of GNU MPFR library: Auto-set. (line 213)
+* version of gawk: Auto-set. (line 207)
+* version of gawk extension API: Auto-set. (line 232)
+* version of GNU MP library: Auto-set. (line 218)
+* version of GNU MPFR library: Auto-set. (line 214)
* vertical bar (|): Regexp Operators. (line 70)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 9)
@@ -34204,7 +34211,7 @@ Index
* Vinschen, Corinna: Acknowledgments. (line 60)
* w debugger command (alias for watch): Viewing And Changing Data.
(line 67)
-* w utility: Constant Size. (line 23)
+* w utility: Constant Size. (line 22)
* wait() extension function: Extension Sample Fork.
(line 22)
* waitpid() extension function: Extension Sample Fork.
@@ -34249,7 +34256,7 @@ Index
* xor: Bitwise Functions. (line 56)
* XOR bitwise operation: Bitwise Functions. (line 6)
* Yawitz, Efraim: Contributors. (line 131)
-* Zaretskii, Eli <1>: Bugs. (line 72)
+* Zaretskii, Eli <1>: Bugs. (line 70)
* Zaretskii, Eli <2>: Contributors. (line 55)
* Zaretskii, Eli: Acknowledgments. (line 60)
* zerofile.awk program: Empty Files. (line 21)
@@ -34266,7 +34273,7 @@ Index
* | (vertical bar), |& operator (I/O) <3>: Redirection. (line 96)
* | (vertical bar), |& operator (I/O): Getline/Coprocess. (line 6)
* | (vertical bar), |& operator (I/O), pipes, closing: Close Files And Pipes.
- (line 120)
+ (line 121)
* | (vertical bar), || operator <1>: Precedence. (line 89)
* | (vertical bar), || operator: Boolean Ops. (line 59)
* ~ (tilde), ~ operator <1>: Expression Patterns. (line 24)
@@ -34283,557 +34290,557 @@ Index
Tag Table:
Node: Top1204
Node: Foreword342156
-Node: Foreword446548
-Node: Preface47982
-Ref: Preface-Footnote-150853
-Ref: Preface-Footnote-250960
-Ref: Preface-Footnote-351193
-Node: History51335
-Node: Names53683
-Ref: Names-Footnote-154777
-Node: This Manual54923
-Ref: This Manual-Footnote-160752
-Node: Conventions60852
-Node: Manual History63192
-Ref: Manual History-Footnote-166183
-Ref: Manual History-Footnote-266224
-Node: How To Contribute66298
-Node: Acknowledgments67429
-Node: Getting Started72237
-Node: Running gawk74671
-Node: One-shot75861
-Node: Read Terminal77086
-Node: Long79113
-Node: Executable Scripts80629
-Ref: Executable Scripts-Footnote-183418
-Node: Comments83520
-Node: Quoting85993
-Node: DOS Quoting91499
-Node: Sample Data Files92174
-Node: Very Simple94767
-Node: Two Rules99658
-Node: More Complex101544
-Node: Statements/Lines104406
-Ref: Statements/Lines-Footnote-1108862
-Node: Other Features109127
-Node: When110058
-Ref: When-Footnote-1111814
-Node: Intro Summary111879
-Node: Invoking Gawk112762
-Node: Command Line114277
-Node: Options115068
-Ref: Options-Footnote-1130980
-Node: Other Arguments131005
-Node: Naming Standard Input133966
-Node: Environment Variables135059
-Node: AWKPATH Variable135617
-Ref: AWKPATH Variable-Footnote-1138917
-Ref: AWKPATH Variable-Footnote-2138962
-Node: AWKLIBPATH Variable139222
-Node: Other Environment Variables140365
-Node: Exit Status144085
-Node: Include Files144760
-Node: Loading Shared Libraries148348
-Node: Obsolete149775
-Node: Undocumented150472
-Node: Invoking Summary150739
-Node: Regexp152405
-Node: Regexp Usage153864
-Node: Escape Sequences155897
-Node: Regexp Operators161914
-Ref: Regexp Operators-Footnote-1169348
-Ref: Regexp Operators-Footnote-2169495
-Node: Bracket Expressions169593
-Ref: table-char-classes171610
-Node: Leftmost Longest174550
-Node: Computed Regexps175852
-Node: GNU Regexp Operators179249
-Node: Case-sensitivity182951
-Ref: Case-sensitivity-Footnote-1185841
-Ref: Case-sensitivity-Footnote-2186076
-Node: Regexp Summary186184
-Node: Reading Files187653
-Node: Records189747
-Node: awk split records190479
-Node: gawk split records195393
-Ref: gawk split records-Footnote-1199932
-Node: Fields199969
-Ref: Fields-Footnote-1202767
-Node: Nonconstant Fields202853
-Ref: Nonconstant Fields-Footnote-1205089
-Node: Changing Fields205291
-Node: Field Separators211223
-Node: Default Field Splitting213927
-Node: Regexp Field Splitting215044
-Node: Single Character Fields218394
-Node: Command Line Field Separator219453
-Node: Full Line Fields222665
-Ref: Full Line Fields-Footnote-1223173
-Node: Field Splitting Summary223219
-Ref: Field Splitting Summary-Footnote-1226350
-Node: Constant Size226451
-Node: Splitting By Content231057
-Ref: Splitting By Content-Footnote-1235130
-Node: Multiple Line235170
-Ref: Multiple Line-Footnote-1241059
-Node: Getline241238
-Node: Plain Getline243449
-Node: Getline/Variable246089
-Node: Getline/File247236
-Node: Getline/Variable/File248620
-Ref: Getline/Variable/File-Footnote-1250221
-Node: Getline/Pipe250308
-Node: Getline/Variable/Pipe252991
-Node: Getline/Coprocess254122
-Node: Getline/Variable/Coprocess255374
-Node: Getline Notes256113
-Node: Getline Summary258905
-Ref: table-getline-variants259317
-Node: Read Timeout260146
-Ref: Read Timeout-Footnote-1263960
-Node: Command-line directories264018
-Node: Input Summary264922
-Node: Input Exercises268174
-Node: Printing268902
-Node: Print270679
-Node: Print Examples272136
-Node: Output Separators274915
-Node: OFMT276933
-Node: Printf278287
-Node: Basic Printf279072
-Node: Control Letters280643
-Node: Format Modifiers284627
-Node: Printf Examples290634
-Node: Redirection293116
-Node: Special FD299955
-Ref: Special FD-Footnote-1303112
-Node: Special Files303186
-Node: Other Inherited Files303802
-Node: Special Network304802
-Node: Special Caveats305663
-Node: Close Files And Pipes306614
-Ref: Close Files And Pipes-Footnote-1313793
-Ref: Close Files And Pipes-Footnote-2313941
-Node: Output Summary314091
-Node: Output Exercises315087
-Node: Expressions315767
-Node: Values316952
-Node: Constants317628
-Node: Scalar Constants318308
-Ref: Scalar Constants-Footnote-1319167
-Node: Nondecimal-numbers319417
-Node: Regexp Constants322417
-Node: Using Constant Regexps322942
-Node: Variables326080
-Node: Using Variables326735
-Node: Assignment Options328645
-Node: Conversion330520
-Node: Strings And Numbers331044
-Ref: Strings And Numbers-Footnote-1334108
-Node: Locale influences conversions334217
-Ref: table-locale-affects336962
-Node: All Operators337550
-Node: Arithmetic Ops338180
-Node: Concatenation340685
-Ref: Concatenation-Footnote-1343504
-Node: Assignment Ops343610
-Ref: table-assign-ops348593
-Node: Increment Ops349871
-Node: Truth Values and Conditions353309
-Node: Truth Values354392
-Node: Typing and Comparison355441
-Node: Variable Typing356234
-Node: Comparison Operators359886
-Ref: table-relational-ops360296
-Node: POSIX String Comparison363811
-Ref: POSIX String Comparison-Footnote-1364883
-Node: Boolean Ops365021
-Ref: Boolean Ops-Footnote-1369500
-Node: Conditional Exp369591
-Node: Function Calls371318
-Node: Precedence375198
-Node: Locales378866
-Node: Expressions Summary380497
-Node: Patterns and Actions383071
-Node: Pattern Overview384191
-Node: Regexp Patterns385870
-Node: Expression Patterns386413
-Node: Ranges390193
-Node: BEGIN/END393299
-Node: Using BEGIN/END394061
-Ref: Using BEGIN/END-Footnote-1396798
-Node: I/O And BEGIN/END396904
-Node: BEGINFILE/ENDFILE399218
-Node: Empty402119
-Node: Using Shell Variables402436
-Node: Action Overview404712
-Node: Statements407039
-Node: If Statement408887
-Node: While Statement410385
-Node: Do Statement412413
-Node: For Statement413555
-Node: Switch Statement416710
-Node: Break Statement419098
-Node: Continue Statement421139
-Node: Next Statement422964
-Node: Nextfile Statement425344
-Node: Exit Statement427974
-Node: Built-in Variables430377
-Node: User-modified431510
-Ref: User-modified-Footnote-1439190
-Node: Auto-set439252
-Ref: Auto-set-Footnote-1452282
-Ref: Auto-set-Footnote-2452487
-Node: ARGC and ARGV452543
-Node: Pattern Action Summary456747
-Node: Arrays459174
-Node: Array Basics460503
-Node: Array Intro461347
-Ref: figure-array-elements463311
-Ref: Array Intro-Footnote-1465835
-Node: Reference to Elements465963
-Node: Assigning Elements468413
-Node: Array Example468904
-Node: Scanning an Array470662
-Node: Controlling Scanning473678
-Ref: Controlling Scanning-Footnote-1478867
-Node: Numeric Array Subscripts479183
-Node: Uninitialized Subscripts481368
-Node: Delete482985
-Ref: Delete-Footnote-1485729
-Node: Multidimensional485786
-Node: Multiscanning488881
-Node: Arrays of Arrays490470
-Node: Arrays Summary495231
-Node: Functions497336
-Node: Built-in498209
-Node: Calling Built-in499287
-Node: Numeric Functions501275
-Ref: Numeric Functions-Footnote-1505297
-Ref: Numeric Functions-Footnote-2505654
-Ref: Numeric Functions-Footnote-3505702
-Node: String Functions505971
-Ref: String Functions-Footnote-1529443
-Ref: String Functions-Footnote-2529572
-Ref: String Functions-Footnote-3529820
-Node: Gory Details529907
-Ref: table-sub-escapes531688
-Ref: table-sub-proposed533208
-Ref: table-posix-sub534572
-Ref: table-gensub-escapes536112
-Ref: Gory Details-Footnote-1536944
-Node: I/O Functions537095
-Ref: I/O Functions-Footnote-1544196
-Node: Time Functions544343
-Ref: Time Functions-Footnote-1554812
-Ref: Time Functions-Footnote-2554880
-Ref: Time Functions-Footnote-3555038
-Ref: Time Functions-Footnote-4555149
-Ref: Time Functions-Footnote-5555261
-Ref: Time Functions-Footnote-6555488
-Node: Bitwise Functions555754
-Ref: table-bitwise-ops556316
-Ref: Bitwise Functions-Footnote-1560624
-Node: Type Functions560793
-Node: I18N Functions561942
-Node: User-defined563587
-Node: Definition Syntax564391
-Ref: Definition Syntax-Footnote-1569797
-Node: Function Example569866
-Ref: Function Example-Footnote-1572783
-Node: Function Caveats572805
-Node: Calling A Function573323
-Node: Variable Scope574278
-Node: Pass By Value/Reference577266
-Node: Return Statement580776
-Node: Dynamic Typing583760
-Node: Indirect Calls584689
-Ref: Indirect Calls-Footnote-1595993
-Node: Functions Summary596121
-Node: Library Functions598820
-Ref: Library Functions-Footnote-1602438
-Ref: Library Functions-Footnote-2602581
-Node: Library Names602752
-Ref: Library Names-Footnote-1606212
-Ref: Library Names-Footnote-2606432
-Node: General Functions606518
-Node: Strtonum Function607621
-Node: Assert Function610641
-Node: Round Function613965
-Node: Cliff Random Function615506
-Node: Ordinal Functions616522
-Ref: Ordinal Functions-Footnote-1619587
-Ref: Ordinal Functions-Footnote-2619839
-Node: Join Function620050
-Ref: Join Function-Footnote-1621821
-Node: Getlocaltime Function622021
-Node: Readfile Function625762
-Node: Shell Quoting627732
-Node: Data File Management629133
-Node: Filetrans Function629765
-Node: Rewind Function633824
-Node: File Checking635209
-Ref: File Checking-Footnote-1636537
-Node: Empty Files636738
-Node: Ignoring Assigns638717
-Node: Getopt Function640268
-Ref: Getopt Function-Footnote-1651728
-Node: Passwd Functions651931
-Ref: Passwd Functions-Footnote-1660782
-Node: Group Functions660870
-Ref: Group Functions-Footnote-1668773
-Node: Walking Arrays668986
-Node: Library Functions Summary670589
-Node: Library Exercises671990
-Node: Sample Programs673270
-Node: Running Examples674040
-Node: Clones674768
-Node: Cut Program675992
-Node: Egrep Program685722
-Ref: Egrep Program-Footnote-1693226
-Node: Id Program693336
-Node: Split Program696980
-Ref: Split Program-Footnote-1700426
-Node: Tee Program700554
-Node: Uniq Program703341
-Node: Wc Program710762
-Ref: Wc Program-Footnote-1715010
-Node: Miscellaneous Programs715102
-Node: Dupword Program716315
-Node: Alarm Program718346
-Node: Translate Program723150
-Ref: Translate Program-Footnote-1727714
-Node: Labels Program727984
-Ref: Labels Program-Footnote-1731333
-Node: Word Sorting731417
-Node: History Sorting735487
-Node: Extract Program737323
-Node: Simple Sed744855
-Node: Igawk Program747917
-Ref: Igawk Program-Footnote-1762243
-Ref: Igawk Program-Footnote-2762444
-Ref: Igawk Program-Footnote-3762566
-Node: Anagram Program762681
-Node: Signature Program765743
-Node: Programs Summary766990
-Node: Programs Exercises768183
-Ref: Programs Exercises-Footnote-1772314
-Node: Advanced Features772405
-Node: Nondecimal Data774353
-Node: Array Sorting775943
-Node: Controlling Array Traversal776640
-Ref: Controlling Array Traversal-Footnote-1784971
-Node: Array Sorting Functions785089
-Ref: Array Sorting Functions-Footnote-1788981
-Node: Two-way I/O789175
-Ref: Two-way I/O-Footnote-1794119
-Ref: Two-way I/O-Footnote-2794305
-Node: TCP/IP Networking794387
-Node: Profiling797259
-Node: Advanced Features Summary804803
-Node: Internationalization806736
-Node: I18N and L10N808216
-Node: Explaining gettext808902
-Ref: Explaining gettext-Footnote-1813931
-Ref: Explaining gettext-Footnote-2814115
-Node: Programmer i18n814280
-Ref: Programmer i18n-Footnote-1819146
-Node: Translator i18n819195
-Node: String Extraction819989
-Ref: String Extraction-Footnote-1821120
-Node: Printf Ordering821206
-Ref: Printf Ordering-Footnote-1823992
-Node: I18N Portability824056
-Ref: I18N Portability-Footnote-1826505
-Node: I18N Example826568
-Ref: I18N Example-Footnote-1829368
-Node: Gawk I18N829440
-Node: I18N Summary830078
-Node: Debugger831417
-Node: Debugging832439
-Node: Debugging Concepts832880
-Node: Debugging Terms834737
-Node: Awk Debugging837312
-Node: Sample Debugging Session838204
-Node: Debugger Invocation838724
-Node: Finding The Bug840108
-Node: List of Debugger Commands846583
-Node: Breakpoint Control847915
-Node: Debugger Execution Control851607
-Node: Viewing And Changing Data854971
-Node: Execution Stack858336
-Node: Debugger Info859974
-Node: Miscellaneous Debugger Commands863991
-Node: Readline Support869183
-Node: Limitations870075
-Node: Debugging Summary872172
-Node: Arbitrary Precision Arithmetic873340
-Node: Computer Arithmetic874756
-Ref: table-numeric-ranges878357
-Ref: Computer Arithmetic-Footnote-1879216
-Node: Math Definitions879273
-Ref: table-ieee-formats882560
-Ref: Math Definitions-Footnote-1883164
-Node: MPFR features883269
-Node: FP Math Caution884940
-Ref: FP Math Caution-Footnote-1885990
-Node: Inexactness of computations886359
-Node: Inexact representation887307
-Node: Comparing FP Values888662
-Node: Errors accumulate889735
-Node: Getting Accuracy891168
-Node: Try To Round893827
-Node: Setting precision894726
-Ref: table-predefined-precision-strings895410
-Node: Setting the rounding mode897204
-Ref: table-gawk-rounding-modes897568
-Ref: Setting the rounding mode-Footnote-1901022
-Node: Arbitrary Precision Integers901201
-Ref: Arbitrary Precision Integers-Footnote-1904192
-Node: POSIX Floating Point Problems904341
-Ref: POSIX Floating Point Problems-Footnote-1908217
-Node: Floating point summary908255
-Node: Dynamic Extensions910447
-Node: Extension Intro911999
-Node: Plugin License913265
-Node: Extension Mechanism Outline914062
-Ref: figure-load-extension914490
-Ref: figure-register-new-function915970
-Ref: figure-call-new-function916974
-Node: Extension API Description918960
-Node: Extension API Functions Introduction920410
-Node: General Data Types925246
-Ref: General Data Types-Footnote-1930933
-Node: Memory Allocation Functions931232
-Ref: Memory Allocation Functions-Footnote-1934062
-Node: Constructor Functions934158
-Node: Registration Functions935892
-Node: Extension Functions936577
-Node: Exit Callback Functions938873
-Node: Extension Version String940121
-Node: Input Parsers940771
-Node: Output Wrappers950586
-Node: Two-way processors955102
-Node: Printing Messages957306
-Ref: Printing Messages-Footnote-1958383
-Node: Updating `ERRNO'958535
-Node: Requesting Values959275
-Ref: table-value-types-returned960003
-Node: Accessing Parameters960961
-Node: Symbol Table Access962192
-Node: Symbol table by name962706
-Node: Symbol table by cookie964686
-Ref: Symbol table by cookie-Footnote-1968825
-Node: Cached values968888
-Ref: Cached values-Footnote-1972392
-Node: Array Manipulation972483
-Ref: Array Manipulation-Footnote-1973581
-Node: Array Data Types973620
-Ref: Array Data Types-Footnote-1976277
-Node: Array Functions976369
-Node: Flattening Arrays980223
-Node: Creating Arrays987110
-Node: Extension API Variables991877
-Node: Extension Versioning992513
-Node: Extension API Informational Variables994414
-Node: Extension API Boilerplate995502
-Node: Finding Extensions999318
-Node: Extension Example999878
-Node: Internal File Description1000650
-Node: Internal File Ops1004717
-Ref: Internal File Ops-Footnote-11016375
-Node: Using Internal File Ops1016515
-Ref: Using Internal File Ops-Footnote-11018898
-Node: Extension Samples1019171
-Node: Extension Sample File Functions1020695
-Node: Extension Sample Fnmatch1028297
-Node: Extension Sample Fork1029779
-Node: Extension Sample Inplace1030992
-Node: Extension Sample Ord1032667
-Node: Extension Sample Readdir1033503
-Ref: table-readdir-file-types1034379
-Node: Extension Sample Revout1035190
-Node: Extension Sample Rev2way1035781
-Node: Extension Sample Read write array1036522
-Node: Extension Sample Readfile1038461
-Node: Extension Sample Time1039556
-Node: Extension Sample API Tests1040905
-Node: gawkextlib1041396
-Node: Extension summary1044046
-Node: Extension Exercises1047728
-Node: Language History1048450
-Node: V7/SVR3.11050107
-Node: SVR41052288
-Node: POSIX1053733
-Node: BTL1055122
-Node: POSIX/GNU1055856
-Node: Feature History1061425
-Node: Common Extensions1074523
-Node: Ranges and Locales1075847
-Ref: Ranges and Locales-Footnote-11080486
-Ref: Ranges and Locales-Footnote-21080513
-Ref: Ranges and Locales-Footnote-31080747
-Node: Contributors1080968
-Node: History summary1086508
-Node: Installation1087877
-Node: Gawk Distribution1088833
-Node: Getting1089317
-Node: Extracting1090141
-Node: Distribution contents1091783
-Node: Unix Installation1097500
-Node: Quick Installation1098117
-Node: Additional Configuration Options1100548
-Node: Configuration Philosophy1102288
-Node: Non-Unix Installation1104639
-Node: PC Installation1105097
-Node: PC Binary Installation1106423
-Node: PC Compiling1108271
-Ref: PC Compiling-Footnote-11111292
-Node: PC Testing1111397
-Node: PC Using1112573
-Node: Cygwin1116688
-Node: MSYS1117511
-Node: VMS Installation1118009
-Node: VMS Compilation1118801
-Ref: VMS Compilation-Footnote-11120023
-Node: VMS Dynamic Extensions1120081
-Node: VMS Installation Details1121765
-Node: VMS Running1124017
-Node: VMS GNV1126858
-Node: VMS Old Gawk1127592
-Node: Bugs1128062
-Node: Other Versions1131966
-Node: Installation summary1138179
-Node: Notes1139235
-Node: Compatibility Mode1140100
-Node: Additions1140882
-Node: Accessing The Source1141807
-Node: Adding Code1143243
-Node: New Ports1149415
-Node: Derived Files1153897
-Ref: Derived Files-Footnote-11159372
-Ref: Derived Files-Footnote-21159406
-Ref: Derived Files-Footnote-31160002
-Node: Future Extensions1160116
-Node: Implementation Limitations1160722
-Node: Extension Design1161970
-Node: Old Extension Problems1163124
-Ref: Old Extension Problems-Footnote-11164641
-Node: Extension New Mechanism Goals1164698
-Ref: Extension New Mechanism Goals-Footnote-11168058
-Node: Extension Other Design Decisions1168247
-Node: Extension Future Growth1170355
-Node: Old Extension Mechanism1171191
-Node: Notes summary1172953
-Node: Basic Concepts1174139
-Node: Basic High Level1174820
-Ref: figure-general-flow1175092
-Ref: figure-process-flow1175691
-Ref: Basic High Level-Footnote-11178920
-Node: Basic Data Typing1179105
-Node: Glossary1182433
-Node: Copying1207591
-Node: GNU Free Documentation License1245147
-Node: Index1270283
+Node: Foreword446598
+Node: Preface48031
+Ref: Preface-Footnote-150902
+Ref: Preface-Footnote-251009
+Ref: Preface-Footnote-351242
+Node: History51384
+Node: Names53730
+Ref: Names-Footnote-154824
+Node: This Manual54970
+Ref: This Manual-Footnote-161457
+Node: Conventions61557
+Node: Manual History63895
+Ref: Manual History-Footnote-166877
+Ref: Manual History-Footnote-266918
+Node: How To Contribute66992
+Node: Acknowledgments68121
+Node: Getting Started72925
+Node: Running gawk75358
+Node: One-shot76548
+Node: Read Terminal77796
+Node: Long79823
+Node: Executable Scripts81339
+Ref: Executable Scripts-Footnote-184128
+Node: Comments84231
+Node: Quoting86713
+Node: DOS Quoting92237
+Node: Sample Data Files92912
+Node: Very Simple95507
+Node: Two Rules100405
+Node: More Complex102291
+Node: Statements/Lines105153
+Ref: Statements/Lines-Footnote-1109608
+Node: Other Features109873
+Node: When110804
+Ref: When-Footnote-1112558
+Node: Intro Summary112623
+Node: Invoking Gawk113506
+Node: Command Line115020
+Node: Options115818
+Ref: Options-Footnote-1131749
+Node: Other Arguments131774
+Node: Naming Standard Input134722
+Node: Environment Variables135815
+Node: AWKPATH Variable136373
+Ref: AWKPATH Variable-Footnote-1139676
+Ref: AWKPATH Variable-Footnote-2139721
+Node: AWKLIBPATH Variable139981
+Node: Other Environment Variables141124
+Node: Exit Status144852
+Node: Include Files145528
+Node: Loading Shared Libraries149125
+Node: Obsolete150552
+Node: Undocumented151249
+Node: Invoking Summary151516
+Node: Regexp153180
+Node: Regexp Usage154634
+Node: Escape Sequences156671
+Node: Regexp Operators162682
+Ref: Regexp Operators-Footnote-1170108
+Ref: Regexp Operators-Footnote-2170255
+Node: Bracket Expressions170353
+Ref: table-char-classes172368
+Node: Leftmost Longest175292
+Node: Computed Regexps176594
+Node: GNU Regexp Operators179991
+Node: Case-sensitivity183664
+Ref: Case-sensitivity-Footnote-1186549
+Ref: Case-sensitivity-Footnote-2186784
+Node: Regexp Summary186892
+Node: Reading Files188359
+Node: Records190453
+Node: awk split records191186
+Node: gawk split records196101
+Ref: gawk split records-Footnote-1200641
+Node: Fields200678
+Ref: Fields-Footnote-1203454
+Node: Nonconstant Fields203540
+Ref: Nonconstant Fields-Footnote-1205783
+Node: Changing Fields205987
+Node: Field Separators211916
+Node: Default Field Splitting214621
+Node: Regexp Field Splitting215738
+Node: Single Character Fields219088
+Node: Command Line Field Separator220147
+Node: Full Line Fields223359
+Ref: Full Line Fields-Footnote-1224888
+Ref: Full Line Fields-Footnote-2224934
+Node: Field Splitting Summary225035
+Node: Constant Size227109
+Node: Splitting By Content231698
+Ref: Splitting By Content-Footnote-1235753
+Node: Multiple Line235793
+Ref: Multiple Line-Footnote-1241679
+Node: Getline241858
+Node: Plain Getline244070
+Node: Getline/Variable246710
+Node: Getline/File247858
+Node: Getline/Variable/File249242
+Ref: Getline/Variable/File-Footnote-1250845
+Node: Getline/Pipe250932
+Node: Getline/Variable/Pipe253615
+Node: Getline/Coprocess254746
+Node: Getline/Variable/Coprocess255998
+Node: Getline Notes256737
+Node: Getline Summary259529
+Ref: table-getline-variants259941
+Node: Read Timeout260770
+Ref: Read Timeout-Footnote-1264589
+Node: Command-line directories264647
+Node: Input Summary265552
+Node: Input Exercises268805
+Node: Printing269533
+Node: Print271310
+Node: Print Examples272767
+Node: Output Separators275546
+Node: OFMT277564
+Node: Printf278918
+Node: Basic Printf279703
+Node: Control Letters281272
+Node: Format Modifiers285256
+Node: Printf Examples291257
+Node: Redirection293743
+Node: Special FD300584
+Ref: Special FD-Footnote-1303744
+Node: Special Files303818
+Node: Other Inherited Files304435
+Node: Special Network305435
+Node: Special Caveats306297
+Node: Close Files And Pipes307248
+Ref: Close Files And Pipes-Footnote-1314430
+Ref: Close Files And Pipes-Footnote-2314578
+Node: Output Summary314728
+Node: Output Exercises315726
+Node: Expressions316406
+Node: Values317591
+Node: Constants318269
+Node: Scalar Constants318960
+Ref: Scalar Constants-Footnote-1319819
+Node: Nondecimal-numbers320069
+Node: Regexp Constants323087
+Node: Using Constant Regexps323612
+Node: Variables326755
+Node: Using Variables327410
+Node: Assignment Options329321
+Node: Conversion331196
+Node: Strings And Numbers331720
+Ref: Strings And Numbers-Footnote-1334785
+Node: Locale influences conversions334894
+Ref: table-locale-affects337641
+Node: All Operators338229
+Node: Arithmetic Ops338859
+Node: Concatenation341364
+Ref: Concatenation-Footnote-1344183
+Node: Assignment Ops344289
+Ref: table-assign-ops349268
+Node: Increment Ops350540
+Node: Truth Values and Conditions353978
+Node: Truth Values355063
+Node: Typing and Comparison356112
+Node: Variable Typing356922
+Node: Comparison Operators360575
+Ref: table-relational-ops360985
+Node: POSIX String Comparison364480
+Ref: POSIX String Comparison-Footnote-1365552
+Node: Boolean Ops365690
+Ref: Boolean Ops-Footnote-1370169
+Node: Conditional Exp370260
+Node: Function Calls371987
+Node: Precedence375867
+Node: Locales379528
+Node: Expressions Summary381160
+Node: Patterns and Actions383720
+Node: Pattern Overview384840
+Node: Regexp Patterns386519
+Node: Expression Patterns387062
+Node: Ranges390843
+Node: BEGIN/END393949
+Node: Using BEGIN/END394710
+Ref: Using BEGIN/END-Footnote-1397444
+Node: I/O And BEGIN/END397550
+Node: BEGINFILE/ENDFILE399864
+Node: Empty402765
+Node: Using Shell Variables403082
+Node: Action Overview405355
+Node: Statements407681
+Node: If Statement409529
+Node: While Statement411024
+Node: Do Statement413053
+Node: For Statement414197
+Node: Switch Statement417354
+Node: Break Statement419736
+Node: Continue Statement421777
+Node: Next Statement423604
+Node: Nextfile Statement425985
+Node: Exit Statement428615
+Node: Built-in Variables431018
+Node: User-modified432151
+Ref: User-modified-Footnote-1439832
+Node: Auto-set439894
+Ref: Auto-set-Footnote-1452929
+Ref: Auto-set-Footnote-2453134
+Node: ARGC and ARGV453190
+Node: Pattern Action Summary457408
+Node: Arrays459835
+Node: Array Basics461164
+Node: Array Intro462008
+Ref: figure-array-elements463972
+Ref: Array Intro-Footnote-1466498
+Node: Reference to Elements466626
+Node: Assigning Elements469078
+Node: Array Example469569
+Node: Scanning an Array471327
+Node: Controlling Scanning474343
+Ref: Controlling Scanning-Footnote-1479539
+Node: Numeric Array Subscripts479855
+Node: Uninitialized Subscripts482040
+Node: Delete483657
+Ref: Delete-Footnote-1486400
+Node: Multidimensional486457
+Node: Multiscanning489554
+Node: Arrays of Arrays491143
+Node: Arrays Summary495902
+Node: Functions497994
+Node: Built-in498867
+Node: Calling Built-in499945
+Node: Numeric Functions501936
+Ref: Numeric Functions-Footnote-1505953
+Ref: Numeric Functions-Footnote-2506310
+Ref: Numeric Functions-Footnote-3506358
+Node: String Functions506630
+Ref: String Functions-Footnote-1530105
+Ref: String Functions-Footnote-2530234
+Ref: String Functions-Footnote-3530482
+Node: Gory Details530569
+Ref: table-sub-escapes532350
+Ref: table-sub-proposed533870
+Ref: table-posix-sub535234
+Ref: table-gensub-escapes536770
+Ref: Gory Details-Footnote-1537602
+Node: I/O Functions537753
+Ref: I/O Functions-Footnote-1544971
+Node: Time Functions545118
+Ref: Time Functions-Footnote-1555606
+Ref: Time Functions-Footnote-2555674
+Ref: Time Functions-Footnote-3555832
+Ref: Time Functions-Footnote-4555943
+Ref: Time Functions-Footnote-5556055
+Ref: Time Functions-Footnote-6556282
+Node: Bitwise Functions556548
+Ref: table-bitwise-ops557110
+Ref: Bitwise Functions-Footnote-1561419
+Node: Type Functions561588
+Node: I18N Functions562739
+Node: User-defined564384
+Node: Definition Syntax565189
+Ref: Definition Syntax-Footnote-1570596
+Node: Function Example570667
+Ref: Function Example-Footnote-1573586
+Node: Function Caveats573608
+Node: Calling A Function574126
+Node: Variable Scope575084
+Node: Pass By Value/Reference578072
+Node: Return Statement581567
+Node: Dynamic Typing584548
+Node: Indirect Calls585477
+Ref: Indirect Calls-Footnote-1596779
+Node: Functions Summary596907
+Node: Library Functions599609
+Ref: Library Functions-Footnote-1603218
+Ref: Library Functions-Footnote-2603361
+Node: Library Names603532
+Ref: Library Names-Footnote-1606986
+Ref: Library Names-Footnote-2607209
+Node: General Functions607295
+Node: Strtonum Function608398
+Node: Assert Function611420
+Node: Round Function614744
+Node: Cliff Random Function616285
+Node: Ordinal Functions617301
+Ref: Ordinal Functions-Footnote-1620364
+Ref: Ordinal Functions-Footnote-2620616
+Node: Join Function620827
+Ref: Join Function-Footnote-1622596
+Node: Getlocaltime Function622796
+Node: Readfile Function626540
+Node: Shell Quoting628510
+Node: Data File Management629911
+Node: Filetrans Function630543
+Node: Rewind Function634599
+Node: File Checking635986
+Ref: File Checking-Footnote-1637318
+Node: Empty Files637519
+Node: Ignoring Assigns639498
+Node: Getopt Function641049
+Ref: Getopt Function-Footnote-1652511
+Node: Passwd Functions652711
+Ref: Passwd Functions-Footnote-1661560
+Node: Group Functions661648
+Ref: Group Functions-Footnote-1669542
+Node: Walking Arrays669755
+Node: Library Functions Summary671358
+Node: Library Exercises672759
+Node: Sample Programs674039
+Node: Running Examples674809
+Node: Clones675537
+Node: Cut Program676761
+Node: Egrep Program686480
+Ref: Egrep Program-Footnote-1693978
+Node: Id Program694088
+Node: Split Program697733
+Ref: Split Program-Footnote-1701181
+Node: Tee Program701309
+Node: Uniq Program704098
+Node: Wc Program711517
+Ref: Wc Program-Footnote-1715767
+Node: Miscellaneous Programs715861
+Node: Dupword Program717074
+Node: Alarm Program719105
+Node: Translate Program723909
+Ref: Translate Program-Footnote-1728474
+Node: Labels Program728744
+Ref: Labels Program-Footnote-1732095
+Node: Word Sorting732179
+Node: History Sorting736250
+Node: Extract Program738086
+Node: Simple Sed745611
+Node: Igawk Program748679
+Ref: Igawk Program-Footnote-1763003
+Ref: Igawk Program-Footnote-2763204
+Ref: Igawk Program-Footnote-3763326
+Node: Anagram Program763441
+Node: Signature Program766498
+Node: Programs Summary767745
+Node: Programs Exercises768938
+Ref: Programs Exercises-Footnote-1773069
+Node: Advanced Features773160
+Node: Nondecimal Data775108
+Node: Array Sorting776698
+Node: Controlling Array Traversal777395
+Ref: Controlling Array Traversal-Footnote-1785728
+Node: Array Sorting Functions785846
+Ref: Array Sorting Functions-Footnote-1789735
+Node: Two-way I/O789931
+Ref: Two-way I/O-Footnote-1794872
+Ref: Two-way I/O-Footnote-2795058
+Node: TCP/IP Networking795140
+Node: Profiling798013
+Node: Advanced Features Summary805560
+Node: Internationalization807493
+Node: I18N and L10N808973
+Node: Explaining gettext809659
+Ref: Explaining gettext-Footnote-1814684
+Ref: Explaining gettext-Footnote-2814868
+Node: Programmer i18n815033
+Ref: Programmer i18n-Footnote-1819899
+Node: Translator i18n819948
+Node: String Extraction820742
+Ref: String Extraction-Footnote-1821873
+Node: Printf Ordering821959
+Ref: Printf Ordering-Footnote-1824745
+Node: I18N Portability824809
+Ref: I18N Portability-Footnote-1827264
+Node: I18N Example827327
+Ref: I18N Example-Footnote-1830130
+Node: Gawk I18N830202
+Node: I18N Summary830840
+Node: Debugger832179
+Node: Debugging833201
+Node: Debugging Concepts833642
+Node: Debugging Terms835495
+Node: Awk Debugging838067
+Node: Sample Debugging Session838961
+Node: Debugger Invocation839481
+Node: Finding The Bug840865
+Node: List of Debugger Commands847340
+Node: Breakpoint Control848673
+Node: Debugger Execution Control852369
+Node: Viewing And Changing Data855733
+Node: Execution Stack859111
+Node: Debugger Info860748
+Node: Miscellaneous Debugger Commands864765
+Node: Readline Support869794
+Node: Limitations870686
+Node: Debugging Summary872800
+Node: Arbitrary Precision Arithmetic873968
+Node: Computer Arithmetic875384
+Ref: table-numeric-ranges878982
+Ref: Computer Arithmetic-Footnote-1879841
+Node: Math Definitions879898
+Ref: table-ieee-formats883186
+Ref: Math Definitions-Footnote-1883790
+Node: MPFR features883895
+Node: FP Math Caution885566
+Ref: FP Math Caution-Footnote-1886616
+Node: Inexactness of computations886985
+Node: Inexact representation887944
+Node: Comparing FP Values889301
+Node: Errors accumulate890383
+Node: Getting Accuracy891816
+Node: Try To Round894478
+Node: Setting precision895377
+Ref: table-predefined-precision-strings896061
+Node: Setting the rounding mode897850
+Ref: table-gawk-rounding-modes898214
+Ref: Setting the rounding mode-Footnote-1901669
+Node: Arbitrary Precision Integers901848
+Ref: Arbitrary Precision Integers-Footnote-1904834
+Node: POSIX Floating Point Problems904983
+Ref: POSIX Floating Point Problems-Footnote-1908856
+Node: Floating point summary908894
+Node: Dynamic Extensions911088
+Node: Extension Intro912640
+Node: Plugin License913906
+Node: Extension Mechanism Outline914703
+Ref: figure-load-extension915131
+Ref: figure-register-new-function916611
+Ref: figure-call-new-function917615
+Node: Extension API Description919601
+Node: Extension API Functions Introduction921051
+Node: General Data Types925875
+Ref: General Data Types-Footnote-1931614
+Node: Memory Allocation Functions931913
+Ref: Memory Allocation Functions-Footnote-1934752
+Node: Constructor Functions934848
+Node: Registration Functions936582
+Node: Extension Functions937267
+Node: Exit Callback Functions939564
+Node: Extension Version String940812
+Node: Input Parsers941477
+Node: Output Wrappers951354
+Node: Two-way processors955869
+Node: Printing Messages958073
+Ref: Printing Messages-Footnote-1959149
+Node: Updating `ERRNO'959301
+Node: Requesting Values960041
+Ref: table-value-types-returned960769
+Node: Accessing Parameters961726
+Node: Symbol Table Access962957
+Node: Symbol table by name963471
+Node: Symbol table by cookie965452
+Ref: Symbol table by cookie-Footnote-1969596
+Node: Cached values969659
+Ref: Cached values-Footnote-1973158
+Node: Array Manipulation973249
+Ref: Array Manipulation-Footnote-1974347
+Node: Array Data Types974384
+Ref: Array Data Types-Footnote-1977039
+Node: Array Functions977131
+Node: Flattening Arrays980985
+Node: Creating Arrays987877
+Node: Extension API Variables992646
+Node: Extension Versioning993282
+Node: Extension API Informational Variables995183
+Node: Extension API Boilerplate996271
+Node: Finding Extensions1000080
+Node: Extension Example1000640
+Node: Internal File Description1001412
+Node: Internal File Ops1005479
+Ref: Internal File Ops-Footnote-11017149
+Node: Using Internal File Ops1017289
+Ref: Using Internal File Ops-Footnote-11019672
+Node: Extension Samples1019945
+Node: Extension Sample File Functions1021471
+Node: Extension Sample Fnmatch1029109
+Node: Extension Sample Fork1030600
+Node: Extension Sample Inplace1031815
+Node: Extension Sample Ord1033490
+Node: Extension Sample Readdir1034326
+Ref: table-readdir-file-types1035202
+Node: Extension Sample Revout1036013
+Node: Extension Sample Rev2way1036603
+Node: Extension Sample Read write array1037343
+Node: Extension Sample Readfile1039283
+Node: Extension Sample Time1040378
+Node: Extension Sample API Tests1041727
+Node: gawkextlib1042218
+Node: Extension summary1044855
+Node: Extension Exercises1048532
+Node: Language History1049254
+Node: V7/SVR3.11050910
+Node: SVR41053091
+Node: POSIX1054536
+Node: BTL1055925
+Node: POSIX/GNU1056659
+Node: Feature History1062223
+Node: Common Extensions1075321
+Node: Ranges and Locales1076645
+Ref: Ranges and Locales-Footnote-11081263
+Ref: Ranges and Locales-Footnote-21081290
+Ref: Ranges and Locales-Footnote-31081524
+Node: Contributors1081745
+Node: History summary1087286
+Node: Installation1088656
+Node: Gawk Distribution1089602
+Node: Getting1090086
+Node: Extracting1090909
+Node: Distribution contents1092544
+Node: Unix Installation1098261
+Node: Quick Installation1098878
+Node: Additional Configuration Options1101302
+Node: Configuration Philosophy1103040
+Node: Non-Unix Installation1105409
+Node: PC Installation1105867
+Node: PC Binary Installation1107186
+Node: PC Compiling1109034
+Ref: PC Compiling-Footnote-11112055
+Node: PC Testing1112164
+Node: PC Using1113340
+Node: Cygwin1117455
+Node: MSYS1118278
+Node: VMS Installation1118778
+Node: VMS Compilation1119570
+Ref: VMS Compilation-Footnote-11120792
+Node: VMS Dynamic Extensions1120850
+Node: VMS Installation Details1122534
+Node: VMS Running1124786
+Node: VMS GNV1127622
+Node: VMS Old Gawk1128356
+Node: Bugs1128826
+Node: Other Versions1132709
+Node: Installation summary1139131
+Node: Notes1140187
+Node: Compatibility Mode1141052
+Node: Additions1141834
+Node: Accessing The Source1142759
+Node: Adding Code1144195
+Node: New Ports1150360
+Node: Derived Files1154842
+Ref: Derived Files-Footnote-11160317
+Ref: Derived Files-Footnote-21160351
+Ref: Derived Files-Footnote-31160947
+Node: Future Extensions1161061
+Node: Implementation Limitations1161667
+Node: Extension Design1162915
+Node: Old Extension Problems1164069
+Ref: Old Extension Problems-Footnote-11165586
+Node: Extension New Mechanism Goals1165643
+Ref: Extension New Mechanism Goals-Footnote-11169003
+Node: Extension Other Design Decisions1169192
+Node: Extension Future Growth1171300
+Node: Old Extension Mechanism1172136
+Node: Notes summary1173898
+Node: Basic Concepts1175084
+Node: Basic High Level1175765
+Ref: figure-general-flow1176037
+Ref: figure-process-flow1176636
+Ref: Basic High Level-Footnote-11179865
+Node: Basic Data Typing1180050
+Node: Glossary1183378
+Node: Copying1208536
+Node: GNU Free Documentation License1246092
+Node: Index1271228

End Tag Table