aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-05-02 08:43:44 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-05-02 08:43:44 +0300
commitf4cc4f9178ac30cdee6b2fca38b42985af42e097 (patch)
tree225476f4f427c79e5c6cab64c86c9c53d847dd4a
parent0ceab11e44cac45f8653fa79510726cc121719f4 (diff)
downloadegawk-f4cc4f9178ac30cdee6b2fca38b42985af42e097.tar.gz
egawk-f4cc4f9178ac30cdee6b2fca38b42985af42e097.tar.bz2
egawk-f4cc4f9178ac30cdee6b2fca38b42985af42e097.zip
Edits through Chapter 8, new figure.
-rw-r--r--doc/ChangeLog7
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/Makefile.in2
-rw-r--r--doc/array-elements.eps158
-rw-r--r--doc/array-elements.fig27
-rw-r--r--doc/array-elements.pdfbin0 -> 6822 bytes
-rw-r--r--doc/array-elements.pngbin0 -> 6143 bytes
-rw-r--r--doc/array-elements.txt4
-rw-r--r--doc/gawk.info1183
-rw-r--r--doc/gawk.texi494
-rw-r--r--doc/gawktexi.in494
11 files changed, 1401 insertions, 970 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index dde9c9af..10600c26 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2014-05-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Editing progress. Through Chapter 8.
+ * array-elements.eps, array-elements.fig, array-elements.pdf,
+ array-elements.png array-elements.txt: New files.
+ * Makefile.am (EXTRA_DIST): Add them.
+
2014-04-30 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Editing progress. Through Chapter 5.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 12692bd0..86321bbc 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -36,6 +36,8 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
api-figure2.png api-figure2.txt \
api-figure3.eps api-figure3.fig api-figure3.pdf \
api-figure3.png api-figure3.txt \
+ array-elements.eps array-elements.fig array-elements.pdf \
+ array-elements.png array-elements.txt \
gawktexi.in sidebar.awk \
general-program.eps general-program.fig general-program.pdf \
general-program.png general-program.txt \
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 52e5f873..abaf5601 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -350,6 +350,8 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
api-figure2.png api-figure2.txt \
api-figure3.eps api-figure3.fig api-figure3.pdf \
api-figure3.png api-figure3.txt \
+ array-elements.eps array-elements.fig array-elements.pdf \
+ array-elements.png array-elements.txt \
gawktexi.in sidebar.awk \
general-program.eps general-program.fig general-program.pdf \
general-program.png general-program.txt \
diff --git a/doc/array-elements.eps b/doc/array-elements.eps
new file mode 100644
index 00000000..a0649959
--- /dev/null
+++ b/doc/array-elements.eps
@@ -0,0 +1,158 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: array-figure1.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Thu May 1 22:19:24 2014
+%%BoundingBox: 0 0 384 76
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 76 moveto 0 0 lineto 384 0 lineto 384 76 lineto closepath clip newpath
+-203.3 199.4 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Polyline
+0 slj
+0 slc
+7.500 slw
+n 4455 1980 m 4455 2700 l 4455 2655 l
+ 4455 2700 l gs col0 s gr
+% Polyline
+n 6075 1980 m
+ 6075 2700 l gs col0 s gr
+% Polyline
+n 7425 1980 m
+ 7425 2700 l gs col0 s gr
+/Courier-Bold ff 180.00 scf sf
+3735 2340 m
+gs 1 -1 sc (8) col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+5175 2295 m
+gs 1 -1 sc ("foo") col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+6930 2295 m
+gs 1 -1 sc ("") col0 sh gr
+/Courier-Bold ff 180.00 scf sf
+7875 2250 m
+gs 1 -1 sc (30) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3735 3105 m
+gs 1 -1 sc (0) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+5175 3150 m
+gs 1 -1 sc (1) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+6795 3150 m
+gs 1 -1 sc (2) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7875 3105 m
+gs 1 -1 sc (3) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8730 2340 m
+gs 1 -1 sc (Value) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8820 3060 m
+gs 1 -1 sc (Index) col0 sh gr
+% here ends figure;
+%
+% here starts figure with depth 40
+% Polyline
+0 slj
+0 slc
+7.500 slw
+n 3240 1980 m 8415 1980 l 8415 2700 l 3240 2700 l
+ cp gs col0 s gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+%EOF
diff --git a/doc/array-elements.fig b/doc/array-elements.fig
new file mode 100644
index 00000000..c5d65ba4
--- /dev/null
+++ b/doc/array-elements.fig
@@ -0,0 +1,27 @@
+#FIG 3.2 Produced by xfig version 3.2.5b
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+2 2 0 1 0 7 40 -1 -1 0.000 0 0 -1 0 0 5
+ 3240 1980 8415 1980 8415 2700 3240 2700 3240 1980
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 4
+ 4455 1980 4455 2700 4455 2655 4455 2700
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 6075 1980 6075 2700
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+ 7425 1980 7425 2700
+4 0 0 50 -1 14 12 0.0000 4 120 120 3735 2340 8\001
+4 0 0 50 -1 14 12 0.0000 4 120 600 5175 2295 "foo"\001
+4 0 0 50 -1 14 12 0.0000 4 60 240 6930 2295 ""\001
+4 0 0 50 -1 14 12 0.0000 4 120 240 7875 2250 30\001
+4 0 0 50 -1 0 12 0.0000 4 135 105 3735 3105 0\001
+4 0 0 50 -1 0 12 0.0000 4 135 105 5175 3150 1\001
+4 0 0 50 -1 0 12 0.0000 4 135 105 6795 3150 2\001
+4 0 0 50 -1 0 12 0.0000 4 135 105 7875 3105 3\001
+4 0 0 50 -1 0 12 0.0000 4 135 480 8730 2340 Value\001
+4 0 0 50 -1 0 12 0.0000 4 135 465 8820 3060 Index\001
diff --git a/doc/array-elements.pdf b/doc/array-elements.pdf
new file mode 100644
index 00000000..af0ef3b9
--- /dev/null
+++ b/doc/array-elements.pdf
Binary files differ
diff --git a/doc/array-elements.png b/doc/array-elements.png
new file mode 100644
index 00000000..c51424d1
--- /dev/null
+++ b/doc/array-elements.png
Binary files differ
diff --git a/doc/array-elements.txt b/doc/array-elements.txt
new file mode 100644
index 00000000..8906318a
--- /dev/null
+++ b/doc/array-elements.txt
@@ -0,0 +1,4 @@
++---------+---------+--------+---------+
+| 8 | "foo" | "" | 30 | @r{Value}
++---------+---------+--------+---------+
+ 0 1 2 3 @r{Index}
diff --git a/doc/gawk.info b/doc/gawk.info
index 8c13d181..dfe1589e 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -9555,9 +9555,9 @@ of these automatically, so that they enable you to tell `awk' how to do
certain things. Others are set automatically by `awk', so that they
carry information from the internal workings of `awk' to your program.
- This minor node documents all the built-in variables of `gawk', most
-of which are also documented in the chapters describing their areas of
-activity.
+ This minor node documents all of `gawk''s built-in variables, most
+of which are also documented in the major nodes describing their areas
+of activity.
* Menu:
@@ -9574,8 +9574,13 @@ File: gawk.info, Node: User-modified, Next: Auto-set, Up: Built-in Variables
-------------------------------------------
The following is an alphabetical list of variables that you can change
-to control how `awk' does certain things. The variables that are
-specific to `gawk' are marked with a pound sign (`#').
+to control how `awk' does certain things.
+
+ 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. (Any exceptions are noted in the
+description of each variable.)
`BINMODE #'
On non-POSIX systems, this variable specifies use of binary mode
@@ -9588,14 +9593,11 @@ specific to `gawk' are marked with a pound sign (`#').
string value of `"rw"' or `"wr"' indicates that all files should
use binary I/O. Any other string value is treated the same as
`"rw"', but causes `gawk' to generate a warning message.
- `BINMODE' is described in more detail in *note PC Using::.
-
- This variable is a `gawk' extension. In other `awk'
- implementations (except `mawk', *note Other Versions::), or if
- `gawk' is in compatibility mode (*note Options::), it is not
- special.
+ `BINMODE' is described in more detail in *note PC Using::. `mawk'
+ *note Other Versions::), also supports this variable, but only
+ using numeric values.
-`CONVFMT'
+``CONVFMT''
This string controls conversion of numbers to strings (*note
Conversion::). It works by being passed, in effect, as the first
argument to the `sprintf()' function (*note String Functions::).
@@ -9603,29 +9605,21 @@ specific to `gawk' are marked with a pound sign (`#').
POSIX standard.
`FIELDWIDTHS #'
- This is a space-separated list of columns that tells `gawk' how to
- split input with fixed columnar boundaries. Assigning a value to
+ A space-separated list of columns that tells `gawk' how to split
+ input with fixed columnar boundaries. Assigning a value to
`FIELDWIDTHS' overrides the use of `FS' and `FPAT' for field
splitting. *Note Constant Size::, for more information.
- If `gawk' is in compatibility mode (*note Options::), then
- `FIELDWIDTHS' has no special meaning, and field-splitting
- operations occur based exclusively on the value of `FS'.
-
`FPAT #'
- This is a regular expression (as a string) that tells `gawk' to
- create the fields based on text that matches the regular
- expression. Assigning a value to `FPAT' overrides the use of `FS'
- and `FIELDWIDTHS' for field splitting. *Note Splitting By
- Content::, for more information.
-
- If `gawk' is in compatibility mode (*note Options::), then `FPAT'
- has no special meaning, and field-splitting operations occur based
- exclusively on the value of `FS'.
+ A regular expression (as a string) that tells `gawk' to create the
+ fields based on text that matches the regular expression.
+ Assigning a value to `FPAT' overrides the use of `FS' and
+ `FIELDWIDTHS' for field splitting. *Note Splitting By Content::,
+ for more information.
`FS'
- This is the input field separator (*note Field Separators::). The
- value is a single-character string or a multicharacter regular
+ The input field separator (*note Field Separators::). The value
+ is a single-character string or a multicharacter regular
expression that matches the separations between fields in an input
record. If the value is the null string (`""'), then each
character in the record becomes a separate field. (This behavior
@@ -9661,13 +9655,9 @@ specific to `gawk' are marked with a pound sign (`#').
splitting when using a single-character field separator. *Note
Case-sensitivity::.
- If `gawk' is in compatibility mode (*note Options::), then
- `IGNORECASE' has no special meaning. Thus, string and regexp
- operations are always case-sensitive.
-
`LINT #'
When this variable is true (nonzero or non-null), `gawk' behaves
- as if the `--lint' command-line option is in effect. (*note
+ as if the `--lint' command-line option is in effect (*note
Options::). With a value of `"fatal"', lint warnings become fatal
errors. With a value of `"invalid"', only warnings about things
that are actually invalid are issued. (This is not fully
@@ -9683,13 +9673,13 @@ specific to `gawk' are marked with a pound sign (`#').
execution is independent of the flavor of `awk' being executed.
`OFMT'
- This string controls conversion of numbers to strings (*note
- Conversion::) for printing with the `print' statement. It works
- by being passed as the first argument to the `sprintf()' function
- (*note String Functions::). Its default value is `"%.6g"'.
- Earlier versions of `awk' also used `OFMT' to specify the format
- for converting numbers to strings in general expressions; this is
- now done by `CONVFMT'.
+ Controls conversion of numbers to strings (*note Conversion::) for
+ printing with the `print' statement. It works by being passed as
+ the first argument to the `sprintf()' function (*note String
+ Functions::). Its default value is `"%.6g"'. Earlier versions of
+ `awk' also used `OFMT' to specify the format for converting
+ numbers to strings in general expressions; this is now done by
+ `CONVFMT'.
`OFS'
This is the output field separator (*note Output Separators::).
@@ -9697,8 +9687,8 @@ specific to `gawk' are marked with a pound sign (`#').
Its default value is `" "', a string consisting of a single space.
`ORS'
- This is the output record separator. It is output at the end of
- every `print' statement. Its default value is `"\n"', the newline
+ The output record separator. It is output at the end of every
+ `print' statement. Its default value is `"\n"', the newline
character. (*Note Output Separators::.)
`PREC #'
@@ -9708,38 +9698,34 @@ specific to `gawk' are marked with a pound sign (`#').
`ROUNDMODE #'
The rounding mode to use for arbitrary precision arithmetic on
numbers, by default `"N"' (`roundTiesToEven' in the IEEE-754
- standard) (*note Setting Rounding Mode::).
+ standard; *note Setting Rounding Mode::).
-`RS'
- This is `awk''s input record separator. Its default value is a
- string containing a single newline character, which means that an
- input record consists of a single line of text. It can also be
- the null string, in which case records are separated by runs of
- blank lines. If it is a regexp, records are separated by matches
- of the regexp in the input text. (*Note Records::.)
+``RS''
+ The input record separator. Its default value is a string
+ containing a single newline character, which means that an input
+ record consists of a single line of text. It can also be the null
+ string, in which case records are separated by runs of blank lines.
+ If it is a regexp, records are separated by matches of the regexp
+ in the input text. (*Note Records::.)
The ability for `RS' to be a regular expression is a `gawk'
extension. In most other `awk' implementations, or if `gawk' is
in compatibility mode (*note Options::), just the first character
of `RS''s value is used.
-`SUBSEP'
- This is the subscript separator. It has the default value of
- `"\034"' and is used to separate the parts of the indices of a
- multidimensional array. Thus, the expression `foo["A", "B"]'
- really accesses `foo["A\034B"]' (*note Multidimensional::).
+``SUBSEP''
+ The subscript separator. It has the default value of `"\034"' and
+ is used to separate the parts of the indices of a multidimensional
+ array. Thus, the expression `foo["A", "B"]' really accesses
+ `foo["A\034B"]' (*note Multidimensional::).
`TEXTDOMAIN #'
- This variable is 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 Internationalization::). The default value of `TEXTDOMAIN'
- is `"messages"'.
-
- This variable is a `gawk' extension. In other `awk'
- implementations, or if `gawk' is in compatibility mode (*note
- Options::), it is not special.
+ 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
+ Internationalization::). The default value of `TEXTDOMAIN' is
+ `"messages"'.
---------- Footnotes ----------
@@ -9753,8 +9739,12 @@ File: gawk.info, Node: Auto-set, Next: ARGC and ARGV, Prev: User-modified, U
The following is an alphabetical list of variables that `awk' sets
automatically on certain occasions in order to provide information to
-your program. The variables that are specific to `gawk' are marked
-with a pound sign (`#').
+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.
`ARGC', `ARGV'
The command-line arguments available to `awk' programs are stored
@@ -9785,7 +9775,7 @@ with a pound sign (`#').
are any of `awk''s command-line options. *Note ARGC and ARGV::,
for information about how `awk' uses these variables. (d.c.)
-`ARGIND' #
+`ARGIND #'
The index in `ARGV' of the current file being processed. Every
time `gawk' opens a new data file for processing, it sets `ARGIND'
to the index in `ARGV' of the file name. When `gawk' is
@@ -9801,26 +9791,23 @@ with a pound sign (`#').
program, `gawk' automatically sets it to a new value when the next
file is opened.
- This variable is a `gawk' extension. In other `awk'
- implementations, or if `gawk' is in compatibility mode (*note
- Options::), it is not special.
-
`ENVIRON'
An associative array containing the values of the environment.
The array indices are the environment variable names; the elements
are the values of the particular environment variables. For
- example, `ENVIRON["HOME"]' might be `/home/arnold'. Changing this
- array does not affect the environment passed on to any programs
- that `awk' may spawn via redirection or the `system()' function.
+ example, `ENVIRON["HOME"]' might be `"/home/arnold"'. Changing
+ this array does not affect the environment passed on to any
+ programs that `awk' may spawn via redirection or the `system()'
+ function. (In a future version of `gawk', it may do so.)
Some operating systems may not have environment variables. On
such systems, the `ENVIRON' array is empty (except for
- `ENVIRON["AWKPATH"]', *note AWKPATH Variable:: and
- `ENVIRON["AWKLIBPATH"]', *note AWKLIBPATH Variable::).
+ `ENVIRON["AWKPATH"]' and `ENVIRON["AWKLIBPATH"]'; *note AWKPATH
+ Variable::, and *note AWKLIBPATH Variable::).
-`ERRNO' #
- If a system error occurs during a redirection for `getline',
- during a read for `getline', or during a `close()' operation, then
+`ERRNO #'
+ If a system error occurs during a redirection for `getline', during
+ a read for `getline', or during a `close()' operation, then
`ERRNO' contains a string describing the error.
In addition, `gawk' clears `ERRNO' before opening each
@@ -9834,19 +9821,14 @@ with a pound sign (`#').
`getline' returning -1. You are, of course, free to clear it
yourself before doing an I/O operation.
- This variable is a `gawk' extension. In other `awk'
- implementations, or if `gawk' is in compatibility mode (*note
- Options::), it is not special.
-
`FILENAME'
- The name of the file that `awk' is currently reading. When no
- data files are listed on the command line, `awk' reads from the
- standard input and `FILENAME' is set to `"-"'. `FILENAME' is
- changed 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.
+ The name of the current input file. When no data files are listed
+ 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.
`FNR'
The current record number in the current file. `FNR' is
@@ -9864,21 +9846,20 @@ with a pound sign (`#').
create or remove fields from the current record. *Note Changing
Fields::.
-`FUNCTAB' #
+`FUNCTAB #'
An array whose indices and corresponding values are the names of
all the user-defined or extension functions in the program.
NOTE: Attempting to use the `delete' statement with the
- `FUNCTAB' array will cause a fatal error. Any attempt to
- assign to an element of the `FUNCTAB' array will also cause a
- fatal error.
+ `FUNCTAB' array causes a fatal error. Any attempt to assign
+ to an element of `FUNCTAB' also causes a fatal error.
`NR'
The number of input records `awk' has processed since the
beginning of the program's execution (*note Records::). `NR' is
incremented each time a new record is read.
-`PROCINFO' #
+`PROCINFO #'
The elements of this array provide access to information about the
running `awk' program. The following elements (listed
alphabetically) are guaranteed to be available:
@@ -9935,8 +9916,8 @@ with a pound sign (`#').
`PROCINFO["sorted_in"]'
If this element exists in `PROCINFO', its value controls the
- order in which array indices will be processed by `for (index
- in array) ...' loops. Since this is an advanced feature, we
+ order in which array indices will be processed by `for (INDEX
+ in ARRAY)' loops. Since this is an advanced feature, we
defer the full description until later; see *note Scanning an
Array::.
@@ -9994,10 +9975,6 @@ with a pound sign (`#').
open input file, pipe, or coprocess. *Note Read Timeout::,
for more information.
- This array is a `gawk' extension. In other `awk' implementations,
- or if `gawk' is in compatibility mode (*note Options::), it is not
- special.
-
`RLENGTH'
The length of the substring matched by the `match()' function
(*note String Functions::). `RLENGTH' is set by invoking the
@@ -10011,15 +9988,11 @@ with a pound sign (`#').
of the string where the matched substring starts, or zero if no
match was found.
-`RT' #
- This is set each time a record is read. It contains the input text
- that matched the text denoted by `RS', the record separator.
-
- This variable is a `gawk' extension. In other `awk'
- implementations, or if `gawk' is in compatibility mode (*note
- Options::), it is not special.
+`RT #'
+ The input text that matched the text denoted by `RS', the record
+ separator. It is set every time a record is read.
-`SYMTAB' #
+`SYMTAB #'
An array whose indices are the names of all currently defined
global variables and arrays in the program. The array may be used
for indirect access to read or write the value of a variable:
@@ -10053,7 +10026,7 @@ with a pound sign (`#').
return SYMTAB[variable] *= amount
}
- NOTE: In order to avoid severe time-travel paradoxes(2),
+ NOTE: In order to avoid severe time-travel paradoxes,(2)
neither `FUNCTAB' nor `SYMTAB' are available as elements
within the `SYMTAB' array.
@@ -10203,7 +10176,7 @@ remove array elements. It also describes how `awk' simulates
multidimensional arrays, as well as some of the less obvious points
about array usage. The major node moves on to discuss `gawk''s facility
for sorting arrays, and ends with a brief description of `gawk''s
-ability to support true multidimensional arrays.
+ability to support true arrays of arrays.
`awk' maintains a single set of names that may be used for naming
variables, arrays, and functions (*note User-defined::). Thus, you
@@ -10281,12 +10254,13 @@ declared.)
A contiguous array of four elements might look like the following
example, conceptually, if the element values are 8, `"foo"', `""', and
-30:
+30 as shown in *note figure-array-elements:::
- +---------+---------+--------+---------+
- | 8 | "foo" | "" | 30 | Value
- +---------+---------+--------+---------+
- 0 1 2 3 Index
++---------+---------+--------+---------+
+| 8 | "foo" | "" | 30 | @r{Value}
++---------+---------+--------+---------+
+ 0 1 2 3 @r{Index}
+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
@@ -10329,9 +10303,9 @@ from English to French:
Here we decided to translate the number one in both spelled-out and
numeric form--thus illustrating that a single array can have both
-numbers and strings as indices. In fact, array subscripts are always
+numbers and strings as indices. (In fact, array subscripts are always
strings; this is discussed in more detail in *note Numeric Array
-Subscripts::. Here, the number `1' isn't double-quoted, since `awk'
+Subscripts::.) Here, the number `1' isn't double-quoted, since `awk'
automatically converts it to a string.
The value of `IGNORECASE' has no effect upon array subscripting.
@@ -10383,11 +10357,11 @@ been assigned any value as well as elements that have been deleted
To determine whether an element exists in an array at a certain
index, use the following expression:
- IND in ARRAY
+ INDX in ARRAY
-This expression tests whether the particular index IND exists, without
+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[IND]' exists and zero
+expression has the value one (true) if `ARRAY[INDX]' exists and zero
(false) if it does not exist. For example, this statement tests
whether the array `frequencies' contains the index `2':
@@ -10522,19 +10496,54 @@ built-in function `length()'.
The order in which elements of the array are accessed by this
statement is determined by the internal arrangement of the array
-elements within `awk' and normally cannot be controlled or changed.
-This can lead to problems if new elements are added to ARRAY by
-statements in the loop body; it is not predictable whether the `for'
+elements within `awk' and in standard `awk' cannot be controlled or
+changed. This can lead to problems if new elements are added to ARRAY
+by statements in the loop body; it is not predictable whether the `for'
loop will reach them. Similarly, changing VAR inside the loop may
produce strange results. It is best to avoid such things.
+ As a point of information, `gawk' sets up the list of elements to be
+iterated over before the loop starts, and does not change it. But not
+all `awk' versions do so. Consider this program, named `loopcheck.awk':
+
+ BEGIN {
+ a["here"] = "here"
+ a["is"] = "is"
+ a["a"] = "a"
+ a["loop"] = "loop"
+ for (i in a) {
+ j++
+ a[j] = j
+ print i
+ }
+ }
+
+ Here is what happens when run with `gawk':
+
+ $ gawk -f loopcheck.awk
+ -| here
+ -| loop
+ -| a
+ -| is
+
+ Contrast this to Brian Kernighan's `awk':
+
+ $ nawk -f loopcheck.awk
+ -| loop
+ -| here
+ -| is
+ -| a
+ -| 1
+

File: gawk.info, Node: Controlling Scanning, Prev: Scanning an Array, Up: Array Basics
-8.1.6 Using Predefined Array Scanning Orders
---------------------------------------------
+8.1.6 Using Predefined Array Scanning Orders With `gawk'
+--------------------------------------------------------
+
+This node describes a feature that is specific to `gawk'.
-By default, when a `for' loop traverses an array, the order is
+ By default, when a `for' loop traverses an array, the order is
undefined, meaning that the `awk' implementation determines the order
in which the array is traversed. This order is usually based on the
internal implementation of arrays and will vary from one version of
@@ -10820,7 +10829,7 @@ might look like this:
-| line 3
-| line 2
- Unfortunately, the very first line of input data did not come out in
+ Unfortunately, the very first line of input data did not appear in
the output!
Upon first glance, we would think that this program should have
@@ -30424,15 +30433,15 @@ Index
(line 6)
* archeologists: Bugs. (line 6)
* arctangent: Numeric Functions. (line 11)
-* ARGC/ARGV variables: Auto-set. (line 11)
+* ARGC/ARGV variables: Auto-set. (line 15)
* ARGC/ARGV variables, command-line arguments: Other Arguments.
(line 12)
* ARGC/ARGV variables, how to use: ARGC and ARGV. (line 6)
* ARGC/ARGV variables, portability and: Executable Scripts. (line 42)
-* ARGIND variable: Auto-set. (line 40)
+* ARGIND variable: Auto-set. (line 44)
* ARGIND variable, command-line arguments: Other Arguments. (line 12)
* arguments, command-line <1>: ARGC and ARGV. (line 6)
-* arguments, command-line <2>: Auto-set. (line 11)
+* arguments, command-line <2>: Auto-set. (line 15)
* arguments, command-line: Other Arguments. (line 6)
* arguments, command-line, invoking awk: Command Line. (line 6)
* arguments, in function calls: Function Calls. (line 18)
@@ -30443,15 +30452,15 @@ Index
* array members: Reference to Elements.
(line 6)
* array scanning order, controlling: Controlling Scanning.
- (line 12)
+ (line 14)
* array, number of elements: String Functions. (line 194)
* 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 91)
+* arrays, and IGNORECASE variable: Array Intro. (line 92)
* arrays, as parameters to functions: Pass By Value/Reference.
(line 47)
-* arrays, associative: Array Intro. (line 49)
+* arrays, associative: Array Intro. (line 50)
* arrays, associative, library functions and: Library Names. (line 57)
* arrays, deleting entire contents: Delete. (line 39)
* arrays, elements that don't exist: Reference to Elements.
@@ -30462,7 +30471,7 @@ Index
(line 48)
* arrays, elements, retrieving number of: String Functions. (line 32)
* arrays, for statement and: Scanning an Array. (line 20)
-* arrays, indexing: Array Intro. (line 49)
+* arrays, indexing: Array Intro. (line 50)
* arrays, merging into strings: Join Function. (line 6)
* arrays, multidimensional: Multidimensional. (line 10)
* arrays, multidimensional, scanning: Multiscanning. (line 11)
@@ -30476,7 +30485,7 @@ Index
(line 6)
* arrays, sorting, and IGNORECASE variable: Array Sorting Functions.
(line 83)
-* arrays, sparse: Array Intro. (line 70)
+* arrays, sparse: Array Intro. (line 71)
* arrays, subscripts, uninitialized variables as: Uninitialized Subscripts.
(line 6)
* arrays, unassigned elements: Reference to Elements.
@@ -30504,7 +30513,7 @@ Index
* assignment operators, evaluation order: Assignment Ops. (line 111)
* assignment operators, lvalues/rvalues: Assignment Ops. (line 32)
* assignments as filenames: Ignoring Assigns. (line 6)
-* associative arrays: Array Intro. (line 49)
+* associative arrays: Array Intro. (line 50)
* asterisk (*), * operator, as multiplication operator: Precedence.
(line 55)
* asterisk (*), * operator, as regexp operator: Regexp Operators.
@@ -30662,14 +30671,14 @@ Index
* Benzinger, Michael: Contributors. (line 97)
* Berry, Karl <1>: Ranges and Locales. (line 74)
* Berry, Karl: Acknowledgments. (line 33)
-* binary input/output: User-modified. (line 10)
+* binary input/output: User-modified. (line 15)
* bindtextdomain <1>: Programmer i18n. (line 47)
* bindtextdomain: I18N Functions. (line 12)
* bindtextdomain() function (C library): Explaining gettext. (line 49)
* bindtextdomain() function (gawk), portability and: I18N Portability.
(line 33)
* BINMODE variable <1>: PC Using. (line 33)
-* BINMODE variable: User-modified. (line 10)
+* BINMODE variable: User-modified. (line 15)
* bit-manipulation functions: Bitwise Functions. (line 6)
* bits2str() user-defined function: Bitwise Functions. (line 70)
* bitwise AND: Bitwise Functions. (line 39)
@@ -30773,9 +30782,9 @@ Index
(line 59)
* caret (^), regexp operator: Regexp Operators. (line 22)
* case keyword: Switch Statement. (line 6)
-* case sensitivity, and regexps: User-modified. (line 82)
-* case sensitivity, and string comparisons: User-modified. (line 82)
-* case sensitivity, array indices and: Array Intro. (line 91)
+* 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 92)
* case sensitivity, converting case: String Functions. (line 520)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
@@ -30827,7 +30836,7 @@ Index
* comma (,), in range patterns: Ranges. (line 6)
* command completion, in debugger: Readline Support. (line 6)
* command line, arguments <1>: ARGC and ARGV. (line 6)
-* command line, arguments <2>: Auto-set. (line 11)
+* command line, arguments <2>: Auto-set. (line 15)
* command line, arguments: Other Arguments. (line 6)
* command line, directories on: Command line directories.
(line 6)
@@ -30909,7 +30918,7 @@ Index
* continue statement: Continue Statement. (line 6)
* control statements: Statements. (line 6)
* controlling array scanning order: Controlling Scanning.
- (line 12)
+ (line 14)
* convert string to lower case: String Functions. (line 521)
* convert string to number: String Functions. (line 385)
* convert string to upper case: String Functions. (line 527)
@@ -30920,7 +30929,7 @@ Index
* converting, numbers to strings: Conversion. (line 6)
* converting, strings to numbers <1>: Bitwise Functions. (line 109)
* converting, strings to numbers: Conversion. (line 6)
-* CONVFMT variable <1>: User-modified. (line 28)
+* CONVFMT variable <1>: User-modified. (line 30)
* CONVFMT variable: Conversion. (line 29)
* CONVFMT variable, and array subscripts: Numeric Array Subscripts.
(line 6)
@@ -30969,9 +30978,9 @@ Index
* dark corner, exit statement: Exit Statement. (line 30)
* dark corner, field separators: Field Splitting Summary.
(line 46)
-* dark corner, FILENAME variable <1>: Auto-set. (line 93)
+* 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 314)
+* dark corner, FNR/NR variables: Auto-set. (line 301)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
@@ -30990,7 +30999,7 @@ Index
(line 43)
* dark corner, split() function: String Functions. (line 359)
* dark corner, strings, storing: gawk split records. (line 83)
-* dark corner, value of ARGV[0]: Auto-set. (line 35)
+* dark corner, value of ARGV[0]: Auto-set. (line 39)
* data, fixed-width: Constant Size. (line 10)
* data-driven languages: Basic High Level. (line 85)
* database, group, reading: Group Functions. (line 6)
@@ -31136,7 +31145,7 @@ Index
* differences between gawk and awk: String Functions. (line 194)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 88)
-* differences in awk and gawk, ARGIND variable: Auto-set. (line 40)
+* differences in awk and gawk, ARGIND variable: Auto-set. (line 44)
* differences in awk and gawk, array elements, deleting: Delete.
(line 39)
* differences in awk and gawk, AWKLIBPATH environment variable: AWKLIBPATH Variable.
@@ -31150,22 +31159,22 @@ Index
* differences in awk and gawk, BINMODE variable <1>: PC Using.
(line 33)
* differences in awk and gawk, BINMODE variable: User-modified.
- (line 23)
+ (line 15)
* differences in awk and gawk, close() function: Close Files And Pipes.
(line 81)
* differences in awk and gawk, command line directories: Command line directories.
(line 6)
-* differences in awk and gawk, ERRNO variable: Auto-set. (line 73)
+* differences in awk and gawk, ERRNO variable: Auto-set. (line 74)
* differences in awk and gawk, error messages: Special FD. (line 16)
* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
- (line 35)
-* differences in awk and gawk, FPAT variable: User-modified. (line 45)
-* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 119)
+ (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, function arguments (gawk): Calling Built-in.
(line 16)
* differences in awk and gawk, getline command: Getline. (line 19)
* differences in awk and gawk, IGNORECASE variable: User-modified.
- (line 82)
+ (line 76)
* differences in awk and gawk, implementation limitations <1>: Redirection.
(line 135)
* differences in awk and gawk, implementation limitations: Getline Notes.
@@ -31178,12 +31187,12 @@ Index
(line 6)
* differences in awk and gawk, line continuations: Conditional Exp.
(line 34)
-* differences in awk and gawk, LINT variable: User-modified. (line 98)
+* differences in awk and gawk, LINT variable: User-modified. (line 88)
* differences in awk and gawk, match() function: String Functions.
(line 257)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
-* differences in awk and gawk, PROCINFO array: Auto-set. (line 133)
+* differences in awk and gawk, PROCINFO array: Auto-set. (line 128)
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 124)
@@ -31193,7 +31202,7 @@ 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 266)
+* differences in awk and gawk, RT variable: Auto-set. (line 257)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
@@ -31201,9 +31210,9 @@ Index
* 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 274)
+* differences in awk and gawk, SYMTAB variable: Auto-set. (line 261)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
- (line 162)
+ (line 152)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
(line 66)
* directories, command line: Command line directories.
@@ -31242,8 +31251,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 138)
-* effective user ID of gawk user: Auto-set. (line 142)
+* effective group ID of gawk user: Auto-set. (line 133)
+* effective user ID of gawk user: Auto-set. (line 137)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 24)
* egrep.awk program: Egrep Program. (line 54)
@@ -31298,13 +31307,13 @@ Index
(line 11)
* EREs (Extended Regular Expressions): Bracket Expressions. (line 24)
* ERRNO variable <1>: TCP/IP Networking. (line 54)
-* ERRNO variable: Auto-set. (line 73)
+* 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 139)
* ERRNO variable, with getline command: Getline. (line 19)
* error handling: Special FD. (line 16)
-* error handling, ERRNO variable and: Auto-set. (line 73)
+* error handling, ERRNO variable and: Auto-set. (line 74)
* error output: Special FD. (line 6)
* escape processing, gsub()/gensub()/sub() functions: Gory Details.
(line 6)
@@ -31358,7 +31367,7 @@ Index
(line 6)
* extension API version: Extension Versioning.
(line 6)
-* extension API, version number: Auto-set. (line 229)
+* extension API, version number: Auto-set. (line 224)
* extension example: Extension Example. (line 6)
* extension registration: Registration Functions.
(line 6)
@@ -31407,11 +31416,11 @@ Index
(line 6)
* field separator, POSIX and: Field Splitting Summary.
(line 40)
-* field separators <1>: User-modified. (line 56)
+* field separators <1>: User-modified. (line 50)
* field separators: Field Separators. (line 15)
* field separators, choice of: Field Separators. (line 51)
-* field separators, FIELDWIDTHS variable and: User-modified. (line 35)
-* field separators, FPAT variable and: User-modified. (line 45)
+* field separators, FIELDWIDTHS variable and: User-modified. (line 37)
+* field separators, FPAT variable and: User-modified. (line 43)
* field separators, POSIX and: Fields. (line 6)
* field separators, regular expressions as <1>: Regexp Field Splitting.
(line 6)
@@ -31431,13 +31440,13 @@ Index
* fields, separating: Field Separators. (line 15)
* fields, single-character: Single Character Fields.
(line 6)
-* FIELDWIDTHS variable <1>: User-modified. (line 35)
+* FIELDWIDTHS variable <1>: User-modified. (line 37)
* FIELDWIDTHS variable: Constant Size. (line 23)
* file descriptors: Special FD. (line 6)
-* file names, distinguishing: Auto-set. (line 52)
+* file names, distinguishing: Auto-set. (line 56)
* file names, in compatibility mode: Special Caveats. (line 9)
* file names, standard streams in gawk: Special FD. (line 46)
-* FILENAME variable <1>: Auto-set. (line 93)
+* FILENAME variable <1>: Auto-set. (line 90)
* FILENAME variable: Reading Files. (line 6)
* FILENAME variable, getline, setting with: Getline Notes. (line 19)
* filenames, assignments as: Ignoring Assigns. (line 6)
@@ -31483,7 +31492,7 @@ Index
* files, portable object, converting to message object files: I18N Example.
(line 62)
* files, portable object, generating: Options. (line 147)
-* files, processing, ARGIND variable and: Auto-set. (line 47)
+* files, processing, ARGIND variable and: Auto-set. (line 51)
* files, reading: Rewind Function. (line 6)
* files, reading, multiline records: Multiple Line. (line 6)
* files, searching for regular expressions: Egrep Program. (line 6)
@@ -31507,9 +31516,9 @@ Index
* flush buffered output: I/O Functions. (line 25)
* fnmatch() extension function: Extension Sample Fnmatch.
(line 12)
-* FNR variable <1>: Auto-set. (line 103)
+* FNR variable <1>: Auto-set. (line 99)
* FNR variable: Records. (line 6)
-* FNR variable, changing: Auto-set. (line 314)
+* FNR variable, changing: Auto-set. (line 301)
* for statement: For Statement. (line 6)
* for statement, looping over arrays: Scanning an Array. (line 20)
* fork() extension function: Extension Sample Fork.
@@ -31531,7 +31540,7 @@ Index
* forward slash (/), /= operator, vs. /=.../ regexp constant: Assignment Ops.
(line 148)
* forward slash (/), patterns and: Expression Patterns. (line 24)
-* FPAT variable <1>: User-modified. (line 45)
+* FPAT variable <1>: User-modified. (line 43)
* FPAT variable: Splitting By Content.
(line 27)
* frame debugger command: Execution Stack. (line 25)
@@ -31541,7 +31550,7 @@ Index
* Free Software Foundation (FSF) <2>: Getting. (line 10)
* Free Software Foundation (FSF): Manual History. (line 6)
* FreeBSD: Glossary. (line 616)
-* FS variable <1>: User-modified. (line 56)
+* FS variable <1>: User-modified. (line 50)
* FS variable: Field Separators. (line 15)
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
@@ -31559,7 +31568,7 @@ Index
* FSF (Free Software Foundation): Manual History. (line 6)
* fts() extension function: Extension Sample File Functions.
(line 77)
-* FUNCTAB array: Auto-set. (line 119)
+* FUNCTAB array: Auto-set. (line 115)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function definition example: Function Example. (line 6)
@@ -31609,7 +31618,7 @@ Index
* G-d: Acknowledgments. (line 78)
* Garfinkle, Scott: Contributors. (line 34)
* gawk program, dynamic profiling: Profiling. (line 179)
-* gawk version: Auto-set. (line 204)
+* gawk version: Auto-set. (line 199)
* gawk, ARGIND variable in: Other Arguments. (line 12)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 23)
@@ -31630,7 +31639,7 @@ Index
* gawk, distribution: Distribution contents.
(line 6)
* gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54)
-* gawk, ERRNO variable in <2>: Auto-set. (line 73)
+* 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 139)
@@ -31639,22 +31648,22 @@ Index
* gawk, extensions, disabling: Options. (line 254)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
-* gawk, field separators and: User-modified. (line 77)
-* gawk, FIELDWIDTHS variable in <1>: User-modified. (line 35)
+* 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, file names in: Special Files. (line 6)
* gawk, format-control characters: Control Letters. (line 18)
-* gawk, FPAT variable in <1>: User-modified. (line 45)
+* 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 119)
+* gawk, FUNCTAB array in: Auto-set. (line 115)
* 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 48)
-* gawk, IGNORECASE variable in <3>: Array Intro. (line 91)
-* gawk, IGNORECASE variable in <4>: User-modified. (line 82)
+* gawk, IGNORECASE variable in <3>: Array Intro. (line 92)
+* gawk, IGNORECASE variable in <4>: User-modified. (line 76)
* gawk, IGNORECASE variable in: Case-sensitivity. (line 26)
* gawk, implementation issues: Notes. (line 6)
* gawk, implementation issues, debugging: Compatibility Mode. (line 6)
@@ -31669,7 +31678,7 @@ Index
(line 6)
* gawk, interval expressions and: Regexp Operators. (line 140)
* gawk, line continuation in: Conditional Exp. (line 34)
-* gawk, LINT variable in: User-modified. (line 98)
+* gawk, LINT variable in: User-modified. (line 88)
* gawk, list of contributors to: Contributors. (line 6)
* gawk, MS-DOS version of: PC Using. (line 10)
* gawk, MS-Windows version of: PC Using. (line 10)
@@ -31678,7 +31687,7 @@ Index
* gawk, OS/2 version of: PC Using. (line 10)
* gawk, PROCINFO array in <1>: Two-way I/O. (line 116)
* gawk, PROCINFO array in <2>: Time Functions. (line 47)
-* gawk, PROCINFO array in: Auto-set. (line 133)
+* gawk, PROCINFO array in: Auto-set. (line 128)
* gawk, regexp constants and: Using Constant Regexps.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
@@ -31686,15 +31695,15 @@ Index
* gawk, regular expressions, operators: GNU Regexp Operators.
(line 6)
* gawk, regular expressions, precedence: Regexp Operators. (line 162)
-* gawk, RT variable in <1>: Auto-set. (line 266)
+* gawk, RT variable in <1>: Auto-set. (line 257)
* gawk, RT variable in <2>: Multiple Line. (line 129)
* gawk, RT variable in: awk split records. (line 124)
* gawk, See Also awk: Preface. (line 36)
* gawk, source code, obtaining: Getting. (line 6)
* gawk, splitting fields and: Constant Size. (line 88)
* gawk, string-translation functions: I18N Functions. (line 6)
-* gawk, SYMTAB array in: Auto-set. (line 274)
-* gawk, TEXTDOMAIN variable in: User-modified. (line 162)
+* gawk, SYMTAB array in: Auto-set. (line 261)
+* gawk, TEXTDOMAIN variable in: User-modified. (line 152)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 36)
* gawk, versions of, information about, printing: Options. (line 300)
@@ -31780,7 +31789,7 @@ 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 177)
+* group ID of gawk user: Auto-set. (line 172)
* groups, information about: Group Functions. (line 6)
* gsub <1>: String Functions. (line 135)
* gsub: Using Constant Regexps.
@@ -31821,8 +31830,8 @@ Index
* igawk.sh program: Igawk Program. (line 124)
* ignore breakpoint: Breakpoint Control. (line 87)
* ignore debugger command: Breakpoint Control. (line 87)
-* IGNORECASE variable: User-modified. (line 82)
-* IGNORECASE variable, and array indices: Array Intro. (line 91)
+* IGNORECASE variable: User-modified. (line 76)
+* IGNORECASE variable, and array indices: Array Intro. (line 92)
* IGNORECASE variable, and array sorting functions: Array Sorting Functions.
(line 83)
* IGNORECASE variable, in example programs: Library Functions.
@@ -31847,7 +31856,7 @@ Index
* in operator, use in loops: Scanning an Array. (line 17)
* increment operators: Increment Ops. (line 6)
* index: String Functions. (line 151)
-* indexing arrays: Array Intro. (line 49)
+* indexing arrays: Array Intro. (line 50)
* indirect function calls: Indirect Calls. (line 6)
* infinite precision: Arbitrary Precision Arithmetic.
(line 6)
@@ -31874,7 +31883,7 @@ Index
* input, standard <1>: Special FD. (line 6)
* input, standard: Read Terminal. (line 6)
* input/output functions: I/O Functions. (line 6)
-* input/output, binary: User-modified. (line 10)
+* input/output, binary: User-modified. (line 15)
* input/output, from BEGIN and END: I/O And BEGIN/END. (line 6)
* input/output, two-way: Two-way I/O. (line 44)
* insomnia, cure for: Alarm Program. (line 6)
@@ -31894,7 +31903,7 @@ Index
* internationalization: I18N Functions. (line 6)
* internationalization, localization <1>: Internationalization.
(line 13)
-* internationalization, localization: User-modified. (line 162)
+* internationalization, localization: User-modified. (line 152)
* internationalization, localization, character classes: Bracket Expressions.
(line 90)
* internationalization, localization, gawk and: Internationalization.
@@ -32006,7 +32015,7 @@ Index
* lines, duplicate, removing: History Sorting. (line 6)
* lines, matching ranges of: Ranges. (line 6)
* lines, skipping between markers: Ranges. (line 43)
-* lint checking: User-modified. (line 98)
+* lint checking: User-modified. (line 88)
* lint checking, array elements: Delete. (line 34)
* lint checking, array subscripts: Uninitialized Subscripts.
(line 43)
@@ -32016,7 +32025,7 @@ Index
(line 340)
* lint checking, undefined functions: Pass By Value/Reference.
(line 88)
-* LINT variable: User-modified. (line 98)
+* LINT variable: User-modified. (line 88)
* Linux <1>: Glossary. (line 616)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
@@ -32075,7 +32084,7 @@ Index
* mawk utility <3>: Concatenation. (line 36)
* mawk utility <4>: Getline/Pipe. (line 62)
* mawk utility: Escape Sequences. (line 124)
-* maximum precision supported by MPFR library: Auto-set. (line 218)
+* maximum precision supported by MPFR library: Auto-set. (line 213)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 41)
* message object files, converting from portable object files: I18N Example.
@@ -32087,7 +32096,7 @@ Index
* messages from extensions: Printing Messages. (line 6)
* metacharacters in regular expressions: Regexp Operators. (line 6)
* metacharacters, escape sequences for: Escape Sequences. (line 130)
-* minimum precision supported by MPFR library: Auto-set. (line 221)
+* minimum precision supported by MPFR library: Auto-set. (line 216)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 103)
@@ -32141,7 +32150,7 @@ Index
(line 47)
* nexti debugger command: Debugger Execution Control.
(line 49)
-* NF variable <1>: Auto-set. (line 108)
+* NF variable <1>: Auto-set. (line 104)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
* ni debugger command (alias for nexti): Debugger Execution Control.
@@ -32150,9 +32159,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 128)
+* NR variable <1>: Auto-set. (line 123)
* NR variable: Records. (line 6)
-* NR variable, changing: Auto-set. (line 314)
+* NR variable, changing: Auto-set. (line 301)
* null strings <1>: Basic Data Typing. (line 26)
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
@@ -32176,7 +32185,7 @@ Index
(line 6)
* numbers, converting <1>: Bitwise Functions. (line 109)
* numbers, converting: Conversion. (line 6)
-* numbers, converting, to strings: User-modified. (line 28)
+* numbers, converting, to strings: User-modified. (line 30)
* numbers, floating-point: General Arithmetic. (line 6)
* numbers, hexadecimal: Nondecimal-numbers. (line 6)
* numbers, octal: Nondecimal-numbers. (line 6)
@@ -32190,11 +32199,11 @@ Index
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
* octal values, enabling interpretation of: Options. (line 211)
-* OFMT variable <1>: User-modified. (line 115)
+* OFMT variable <1>: User-modified. (line 105)
* OFMT variable <2>: Conversion. (line 55)
* OFMT variable: OFMT. (line 15)
* OFMT variable, POSIX awk and: OFMT. (line 27)
-* OFS variable <1>: User-modified. (line 124)
+* OFS variable <1>: User-modified. (line 114)
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
* OpenBSD: Glossary. (line 616)
@@ -32247,7 +32256,7 @@ Index
(line 12)
* ord() user-defined function: Ordinal Functions. (line 16)
* order of evaluation, concatenation: Concatenation. (line 41)
-* ORS variable <1>: User-modified. (line 129)
+* ORS variable <1>: User-modified. (line 119)
* ORS variable: Output Separators. (line 20)
* output field separator, See OFS variable: Changing Fields. (line 64)
* output record separator, See ORS variable: Output Separators.
@@ -32267,7 +32276,7 @@ Index
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
* P1003.1 POSIX standard: Glossary. (line 454)
-* parent process ID of gawk process: Auto-set. (line 186)
+* parent process ID of gawk process: Auto-set. (line 181)
* parentheses (), in a profile: Profiling. (line 146)
* parentheses (), regexp operator: Regexp Operators. (line 80)
* password file: Passwd Functions. (line 16)
@@ -32364,12 +32373,12 @@ Index
* POSIX awk, break statement and: Break Statement. (line 51)
* POSIX awk, changes in awk versions: POSIX. (line 6)
* POSIX awk, continue statement and: Continue Statement. (line 43)
-* POSIX awk, CONVFMT variable and: User-modified. (line 28)
+* POSIX awk, CONVFMT variable and: User-modified. (line 30)
* POSIX awk, date utility and: Time Functions. (line 263)
* POSIX awk, field separators and <1>: Field Splitting Summary.
(line 40)
* POSIX awk, field separators and: Fields. (line 6)
-* POSIX awk, FS variable and: User-modified. (line 66)
+* POSIX awk, FS variable and: User-modified. (line 60)
* POSIX awk, function keyword in: Definition Syntax. (line 83)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 54)
* POSIX awk, functions and, length(): String Functions. (line 173)
@@ -32390,7 +32399,7 @@ Index
* POSIX, programs, implementing in awk: Clones. (line 6)
* POSIXLY_CORRECT environment variable: Options. (line 340)
* PREC variable <1>: Setting Precision. (line 6)
-* PREC variable: User-modified. (line 134)
+* PREC variable: User-modified. (line 124)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 60)
* precedence, regexp operators: Regexp Operators. (line 157)
@@ -32401,7 +32410,7 @@ Index
* print statement, commas, omitting: Print Examples. (line 31)
* print statement, I/O operators in: Precedence. (line 71)
* print statement, line continuations and: Print Examples. (line 76)
-* print statement, OFMT variable and: User-modified. (line 124)
+* print statement, OFMT variable and: User-modified. (line 114)
* print statement, See Also redirection, of output: Redirection.
(line 17)
* print statement, sprintf() function and: Round Function. (line 6)
@@ -32432,29 +32441,29 @@ 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 180)
-* process ID of gawk process: Auto-set. (line 183)
+* process group idIDof gawk process: Auto-set. (line 175)
+* process ID of gawk process: Auto-set. (line 178)
* processes, two-way communications with: Two-way I/O. (line 23)
* 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 133)
+* PROCINFO array: Auto-set. (line 128)
* PROCINFO array, and communications via ptys: Two-way I/O. (line 116)
* 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 161)
-* PROCINFO array, uses: Auto-set. (line 239)
+* PROCINFO array, uses: Auto-set. (line 234)
* PROCINFO, values of sorted_in: Controlling Scanning.
- (line 24)
+ (line 26)
* profiling awk programs: Profiling. (line 6)
* profiling awk programs, dynamically: Profiling. (line 179)
-* program identifiers: Auto-set. (line 151)
+* program identifiers: Auto-set. (line 146)
* program, definition of: Getting Started. (line 21)
* programmers, attractiveness of: Two-way I/O. (line 6)
* programming conventions, --non-decimal-data option: Nondecimal Data.
(line 36)
-* programming conventions, ARGC/ARGV variables: Auto-set. (line 31)
+* programming conventions, ARGC/ARGV variables: Auto-set. (line 35)
* programming conventions, exit statement: Exit Statement. (line 38)
* programming conventions, function parameters: Return Statement.
(line 45)
@@ -32518,7 +32527,7 @@ Index
* readfile() user-defined function: Readfile Function. (line 30)
* reading input files: Reading Files. (line 6)
* recipe for a programming language: History. (line 6)
-* record separators <1>: User-modified. (line 143)
+* record separators <1>: User-modified. (line 133)
* record separators: awk split records. (line 6)
* record separators, changing: awk split records. (line 85)
* record separators, regular expressions as: awk split records.
@@ -32559,7 +32568,7 @@ Index
* regular expressions, as patterns: Regexp Usage. (line 6)
* regular expressions, as record separators: awk split records.
(line 124)
-* regular expressions, case sensitivity <1>: User-modified. (line 82)
+* regular expressions, case sensitivity <1>: User-modified. (line 76)
* regular expressions, case sensitivity: Case-sensitivity. (line 6)
* regular expressions, computed: Computed Regexps. (line 6)
* regular expressions, constants, See regexp constants: Regexp Usage.
@@ -32609,7 +32618,7 @@ Index
* right shift: Bitwise Functions. (line 52)
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 55)
-* RLENGTH variable: Auto-set. (line 253)
+* RLENGTH variable: Auto-set. (line 244)
* RLENGTH variable, match() function and: String Functions. (line 221)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 32)
@@ -32633,14 +32642,14 @@ Index
* rounding numbers: Round Function. (line 6)
* ROUNDMODE variable <1>: Setting Rounding Mode.
(line 6)
-* ROUNDMODE variable: User-modified. (line 138)
-* RS variable <1>: User-modified. (line 143)
+* ROUNDMODE variable: User-modified. (line 128)
+* RS variable <1>: User-modified. (line 133)
* RS variable: awk split records. (line 12)
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift: Bitwise Functions. (line 52)
-* RSTART variable: Auto-set. (line 259)
+* RSTART variable: Auto-set. (line 250)
* RSTART variable, match() function and: String Functions. (line 221)
-* RT variable <1>: Auto-set. (line 266)
+* RT variable <1>: Auto-set. (line 257)
* RT variable <2>: Multiple Line. (line 129)
* RT variable: awk split records. (line 124)
* Rubin, Paul <1>: Contributors. (line 15)
@@ -32660,6 +32669,7 @@ Index
* scanning arrays: Scanning an Array. (line 6)
* scanning multidimensional arrays: Multiscanning. (line 11)
* Schorr, Andrew <1>: Contributors. (line 131)
+* Schorr, Andrew <2>: Auto-set. (line 284)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
@@ -32687,16 +32697,16 @@ Index
(line 19)
* semicolon (;), separating statements in actions: Statements/Lines.
(line 91)
-* separators, field: User-modified. (line 56)
-* separators, field, FIELDWIDTHS variable and: User-modified. (line 35)
-* separators, field, FPAT variable and: User-modified. (line 45)
+* separators, field: User-modified. (line 50)
+* separators, field, FIELDWIDTHS variable and: User-modified. (line 37)
+* separators, field, FPAT variable and: User-modified. (line 43)
* separators, field, POSIX and: Fields. (line 6)
-* separators, for records <1>: User-modified. (line 143)
+* separators, for records <1>: User-modified. (line 133)
* separators, for records: awk split records. (line 6)
* separators, for records, regular expressions as: awk split records.
(line 124)
* separators, for statements in actions: Action Overview. (line 19)
-* separators, subscript: User-modified. (line 156)
+* separators, subscript: User-modified. (line 146)
* set breakpoint: Breakpoint Control. (line 11)
* set debugger command: Viewing And Changing Data.
(line 59)
@@ -32747,7 +32757,7 @@ Index
(line 110)
* sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary.
(line 38)
-* sidebar, Changing NR and FNR: Auto-set. (line 312)
+* sidebar, Changing NR and FNR: Auto-set. (line 299)
* sidebar, Controlling Output Buffering with system(): I/O Functions.
(line 135)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
@@ -32822,7 +32832,7 @@ Index
* source code, QuikTrim Awk: Other Versions. (line 134)
* source code, Solaris awk: Other Versions. (line 96)
* source files, search path for: Igawk Program. (line 368)
-* sparse arrays: Array Intro. (line 70)
+* sparse arrays: Array Intro. (line 71)
* Spencer, Henry: Glossary. (line 12)
* split: String Functions. (line 313)
* split string into array: String Functions. (line 291)
@@ -32831,7 +32841,7 @@ Index
* split.awk program: Split Program. (line 30)
* sprintf <1>: String Functions. (line 378)
* sprintf: OFMT. (line 15)
-* sprintf() function, OFMT variable and: User-modified. (line 124)
+* sprintf() function, OFMT variable and: User-modified. (line 114)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
* sqrt: Numeric Functions. (line 78)
@@ -32877,7 +32887,7 @@ Index
* strings, converting <1>: Bitwise Functions. (line 109)
* strings, converting: Conversion. (line 6)
* strings, converting letter case: String Functions. (line 520)
-* strings, converting, numbers to: User-modified. (line 28)
+* strings, converting, numbers to: User-modified. (line 30)
* strings, empty, See null strings: awk split records. (line 114)
* strings, extracting: String Extraction. (line 6)
* strings, for localization: Programmer i18n. (line 14)
@@ -32894,7 +32904,7 @@ Index
(line 43)
* sub() function, arguments of: String Functions. (line 460)
* sub() function, escape processing: Gory Details. (line 6)
-* subscript separators: User-modified. (line 156)
+* subscript separators: User-modified. (line 146)
* subscripts in arrays, multidimensional: Multidimensional. (line 10)
* subscripts in arrays, multidimensional, scanning: Multiscanning.
(line 11)
@@ -32902,16 +32912,16 @@ Index
(line 6)
* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
(line 6)
-* SUBSEP variable: User-modified. (line 156)
+* SUBSEP variable: User-modified. (line 146)
* SUBSEP variable, and multidimensional arrays: Multidimensional.
(line 16)
* substitute in string: String Functions. (line 82)
* substr: String Functions. (line 479)
* substring: String Functions. (line 479)
* Sumner, Andrew: Other Versions. (line 64)
-* supplementary groups of gawk process: Auto-set. (line 234)
+* supplementary groups of gawk process: Auto-set. (line 229)
* switch statement: Switch Statement. (line 6)
-* SYMTAB array: Auto-set. (line 274)
+* SYMTAB array: Auto-set. (line 261)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
* system: I/O Functions. (line 72)
@@ -32941,7 +32951,7 @@ Index
* text, printing: Print. (line 22)
* text, printing, unduplicated lines of: Uniq Program. (line 6)
* TEXTDOMAIN variable <1>: Programmer i18n. (line 9)
-* TEXTDOMAIN variable: User-modified. (line 162)
+* TEXTDOMAIN variable: User-modified. (line 152)
* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60)
* TEXTDOMAIN variable, portability and: I18N Portability. (line 20)
* textdomain() function (C library): Explaining gettext. (line 27)
@@ -33090,10 +33100,10 @@ Index
* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
(line 6)
* variables, user-defined: Variables. (line 6)
-* version of gawk: Auto-set. (line 204)
-* version of gawk extension API: Auto-set. (line 229)
-* version of GNU MP library: Auto-set. (line 215)
-* version of GNU MPFR library: Auto-set. (line 211)
+* version of gawk: Auto-set. (line 199)
+* version of gawk extension API: Auto-set. (line 224)
+* version of GNU MP library: Auto-set. (line 210)
+* version of GNU MPFR library: Auto-set. (line 206)
* vertical bar (|): Regexp Operators. (line 70)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 9)
@@ -33369,344 +33379,345 @@ Node: Next Statement400827
Node: Nextfile Statement403217
Node: Exit Statement405872
Node: Built-in Variables408274
-Node: User-modified409369
-Ref: User-modified-Footnote-1417727
-Node: Auto-set417789
-Ref: Auto-set-Footnote-1430856
-Ref: Auto-set-Footnote-2431061
-Node: ARGC and ARGV431117
-Node: Arrays434971
-Node: Array Basics436476
-Node: Array Intro437302
-Node: Reference to Elements441619
-Node: Assigning Elements443889
-Node: Array Example444380
-Node: Scanning an Array446112
-Node: Controlling Scanning448426
-Ref: Controlling Scanning-Footnote-1453513
-Node: Delete453829
-Ref: Delete-Footnote-1456594
-Node: Numeric Array Subscripts456651
-Node: Uninitialized Subscripts458834
-Node: Multidimensional460461
-Node: Multiscanning463554
-Node: Arrays of Arrays465143
-Node: Functions469783
-Node: Built-in470602
-Node: Calling Built-in471680
-Node: Numeric Functions473668
-Ref: Numeric Functions-Footnote-1477502
-Ref: Numeric Functions-Footnote-2477859
-Ref: Numeric Functions-Footnote-3477907
-Node: String Functions478176
-Ref: String Functions-Footnote-1501179
-Ref: String Functions-Footnote-2501308
-Ref: String Functions-Footnote-3501556
-Node: Gory Details501643
-Ref: table-sub-escapes503322
-Ref: table-sub-posix-92504676
-Ref: table-sub-proposed506027
-Ref: table-posix-sub507381
-Ref: table-gensub-escapes508926
-Ref: Gory Details-Footnote-1510102
-Ref: Gory Details-Footnote-2510153
-Node: I/O Functions510304
-Ref: I/O Functions-Footnote-1517300
-Node: Time Functions517447
-Ref: Time Functions-Footnote-1528440
-Ref: Time Functions-Footnote-2528508
-Ref: Time Functions-Footnote-3528666
-Ref: Time Functions-Footnote-4528777
-Ref: Time Functions-Footnote-5528889
-Ref: Time Functions-Footnote-6529116
-Node: Bitwise Functions529382
-Ref: table-bitwise-ops529944
-Ref: Bitwise Functions-Footnote-1534189
-Node: Type Functions534373
-Node: I18N Functions535524
-Node: User-defined537176
-Node: Definition Syntax537980
-Ref: Definition Syntax-Footnote-1542894
-Node: Function Example542963
-Ref: Function Example-Footnote-1545612
-Node: Function Caveats545634
-Node: Calling A Function546152
-Node: Variable Scope547107
-Node: Pass By Value/Reference550070
-Node: Return Statement553578
-Node: Dynamic Typing556559
-Node: Indirect Calls557490
-Node: Library Functions567177
-Ref: Library Functions-Footnote-1570690
-Ref: Library Functions-Footnote-2570833
-Node: Library Names571004
-Ref: Library Names-Footnote-1574477
-Ref: Library Names-Footnote-2574697
-Node: General Functions574783
-Node: Strtonum Function575811
-Node: Assert Function578741
-Node: Round Function582067
-Node: Cliff Random Function583608
-Node: Ordinal Functions584624
-Ref: Ordinal Functions-Footnote-1587701
-Ref: Ordinal Functions-Footnote-2587953
-Node: Join Function588164
-Ref: Join Function-Footnote-1589935
-Node: Getlocaltime Function590135
-Node: Readfile Function593876
-Node: Data File Management595715
-Node: Filetrans Function596347
-Node: Rewind Function600416
-Node: File Checking601803
-Node: Empty Files602897
-Node: Ignoring Assigns605127
-Node: Getopt Function606681
-Ref: Getopt Function-Footnote-1617984
-Node: Passwd Functions618187
-Ref: Passwd Functions-Footnote-1627165
-Node: Group Functions627253
-Node: Walking Arrays635337
-Node: Sample Programs637473
-Node: Running Examples638147
-Node: Clones638875
-Node: Cut Program640099
-Node: Egrep Program649950
-Ref: Egrep Program-Footnote-1657723
-Node: Id Program657833
-Node: Split Program661482
-Ref: Split Program-Footnote-1665001
-Node: Tee Program665129
-Node: Uniq Program667932
-Node: Wc Program675361
-Ref: Wc Program-Footnote-1679627
-Ref: Wc Program-Footnote-2679827
-Node: Miscellaneous Programs679919
-Node: Dupword Program681107
-Node: Alarm Program683138
-Node: Translate Program687945
-Ref: Translate Program-Footnote-1692332
-Ref: Translate Program-Footnote-2692580
-Node: Labels Program692714
-Ref: Labels Program-Footnote-1696085
-Node: Word Sorting696169
-Node: History Sorting700053
-Node: Extract Program701892
-Ref: Extract Program-Footnote-1709395
-Node: Simple Sed709523
-Node: Igawk Program712585
-Ref: Igawk Program-Footnote-1727756
-Ref: Igawk Program-Footnote-2727957
-Node: Anagram Program728095
-Node: Signature Program731163
-Node: Advanced Features732263
-Node: Nondecimal Data734149
-Node: Array Sorting735732
-Node: Controlling Array Traversal736429
-Node: Array Sorting Functions744713
-Ref: Array Sorting Functions-Footnote-1748582
-Node: Two-way I/O748776
-Ref: Two-way I/O-Footnote-1754208
-Node: TCP/IP Networking754290
-Node: Profiling757134
-Node: Internationalization764637
-Node: I18N and L10N766062
-Node: Explaining gettext766748
-Ref: Explaining gettext-Footnote-1771816
-Ref: Explaining gettext-Footnote-2772000
-Node: Programmer i18n772165
-Node: Translator i18n776392
-Node: String Extraction777186
-Ref: String Extraction-Footnote-1778147
-Node: Printf Ordering778233
-Ref: Printf Ordering-Footnote-1781015
-Node: I18N Portability781079
-Ref: I18N Portability-Footnote-1783528
-Node: I18N Example783591
-Ref: I18N Example-Footnote-1786229
-Node: Gawk I18N786301
-Node: Debugger786922
-Node: Debugging787893
-Node: Debugging Concepts788326
-Node: Debugging Terms790182
-Node: Awk Debugging792779
-Node: Sample Debugging Session793671
-Node: Debugger Invocation794191
-Node: Finding The Bug795524
-Node: List of Debugger Commands802011
-Node: Breakpoint Control803345
-Node: Debugger Execution Control807009
-Node: Viewing And Changing Data810369
-Node: Execution Stack813725
-Node: Debugger Info815192
-Node: Miscellaneous Debugger Commands819186
-Node: Readline Support824364
-Node: Limitations825195
-Node: Arbitrary Precision Arithmetic827447
-Ref: Arbitrary Precision Arithmetic-Footnote-1829096
-Node: General Arithmetic829244
-Node: Floating Point Issues830964
-Node: String Conversion Precision831845
-Ref: String Conversion Precision-Footnote-1833550
-Node: Unexpected Results833659
-Node: POSIX Floating Point Problems835812
-Ref: POSIX Floating Point Problems-Footnote-1839637
-Node: Integer Programming839675
-Node: Floating-point Programming841414
-Ref: Floating-point Programming-Footnote-1847745
-Ref: Floating-point Programming-Footnote-2848015
-Node: Floating-point Representation848279
-Node: Floating-point Context849444
-Ref: table-ieee-formats850283
-Node: Rounding Mode851667
-Ref: table-rounding-modes852146
-Ref: Rounding Mode-Footnote-1855161
-Node: Gawk and MPFR855340
-Node: Arbitrary Precision Floats856749
-Ref: Arbitrary Precision Floats-Footnote-1859192
-Node: Setting Precision859508
-Ref: table-predefined-precision-strings860194
-Node: Setting Rounding Mode862339
-Ref: table-gawk-rounding-modes862743
-Node: Floating-point Constants863930
-Node: Changing Precision865359
-Ref: Changing Precision-Footnote-1866756
-Node: Exact Arithmetic866930
-Node: Arbitrary Precision Integers870068
-Ref: Arbitrary Precision Integers-Footnote-1873083
-Node: Dynamic Extensions873230
-Node: Extension Intro874688
-Node: Plugin License875953
-Node: Extension Mechanism Outline876638
-Ref: load-extension877055
-Ref: load-new-function878533
-Ref: call-new-function879528
-Node: Extension API Description881543
-Node: Extension API Functions Introduction882830
-Node: General Data Types887757
-Ref: General Data Types-Footnote-1893452
-Node: Requesting Values893751
-Ref: table-value-types-returned894488
-Node: Memory Allocation Functions895442
-Ref: Memory Allocation Functions-Footnote-1898188
-Node: Constructor Functions898284
-Node: Registration Functions900042
-Node: Extension Functions900727
-Node: Exit Callback Functions903029
-Node: Extension Version String904278
-Node: Input Parsers904928
-Node: Output Wrappers914685
-Node: Two-way processors919195
-Node: Printing Messages921403
-Ref: Printing Messages-Footnote-1922480
-Node: Updating `ERRNO'922632
-Node: Accessing Parameters923371
-Node: Symbol Table Access924601
-Node: Symbol table by name925115
-Node: Symbol table by cookie927091
-Ref: Symbol table by cookie-Footnote-1931223
-Node: Cached values931286
-Ref: Cached values-Footnote-1934776
-Node: Array Manipulation934867
-Ref: Array Manipulation-Footnote-1935965
-Node: Array Data Types936004
-Ref: Array Data Types-Footnote-1938707
-Node: Array Functions938799
-Node: Flattening Arrays942635
-Node: Creating Arrays949487
-Node: Extension API Variables954212
-Node: Extension Versioning954848
-Node: Extension API Informational Variables956749
-Node: Extension API Boilerplate957835
-Node: Finding Extensions961639
-Node: Extension Example962199
-Node: Internal File Description962929
-Node: Internal File Ops967020
-Ref: Internal File Ops-Footnote-1978529
-Node: Using Internal File Ops978669
-Ref: Using Internal File Ops-Footnote-1981016
-Node: Extension Samples981282
-Node: Extension Sample File Functions982806
-Node: Extension Sample Fnmatch991293
-Node: Extension Sample Fork993062
-Node: Extension Sample Inplace994275
-Node: Extension Sample Ord996053
-Node: Extension Sample Readdir996889
-Node: Extension Sample Revout998421
-Node: Extension Sample Rev2way999014
-Node: Extension Sample Read write array999704
-Node: Extension Sample Readfile1001587
-Node: Extension Sample API Tests1002687
-Node: Extension Sample Time1003212
-Node: gawkextlib1004576
-Node: Language History1007357
-Node: V7/SVR3.11008950
-Node: SVR41011270
-Node: POSIX1012712
-Node: BTL1014098
-Node: POSIX/GNU1014832
-Node: Feature History1020431
-Node: Common Extensions1033407
-Node: Ranges and Locales1034719
-Ref: Ranges and Locales-Footnote-11039336
-Ref: Ranges and Locales-Footnote-21039363
-Ref: Ranges and Locales-Footnote-31039597
-Node: Contributors1039818
-Node: Installation1045199
-Node: Gawk Distribution1046093
-Node: Getting1046577
-Node: Extracting1047403
-Node: Distribution contents1049095
-Node: Unix Installation1054816
-Node: Quick Installation1055433
-Node: Additional Configuration Options1057879
-Node: Configuration Philosophy1059615
-Node: Non-Unix Installation1061969
-Node: PC Installation1062427
-Node: PC Binary Installation1063726
-Node: PC Compiling1065574
-Node: PC Testing1068518
-Node: PC Using1069694
-Node: Cygwin1073862
-Node: MSYS1074671
-Node: VMS Installation1075185
-Node: VMS Compilation1075981
-Ref: VMS Compilation-Footnote-11077233
-Node: VMS Dynamic Extensions1077291
-Node: VMS Installation Details1078664
-Node: VMS Running1080915
-Node: VMS GNV1083749
-Node: VMS Old Gawk1084472
-Node: Bugs1084942
-Node: Other Versions1088860
-Node: Notes1094944
-Node: Compatibility Mode1095744
-Node: Additions1096527
-Node: Accessing The Source1097454
-Node: Adding Code1098894
-Node: New Ports1104939
-Node: Derived Files1109074
-Ref: Derived Files-Footnote-11114395
-Ref: Derived Files-Footnote-21114429
-Ref: Derived Files-Footnote-31115029
-Node: Future Extensions1115127
-Node: Implementation Limitations1115710
-Node: Extension Design1116958
-Node: Old Extension Problems1118112
-Ref: Old Extension Problems-Footnote-11119620
-Node: Extension New Mechanism Goals1119677
-Ref: Extension New Mechanism Goals-Footnote-11123042
-Node: Extension Other Design Decisions1123228
-Node: Extension Future Growth1125334
-Node: Old Extension Mechanism1126170
-Node: Basic Concepts1127910
-Node: Basic High Level1128591
-Ref: figure-general-flow1128863
-Ref: figure-process-flow1129462
-Ref: Basic High Level-Footnote-11132691
-Node: Basic Data Typing1132876
-Node: Glossary1136231
-Node: Copying1161462
-Node: GNU Free Documentation License1199018
-Node: Index1224154
+Node: User-modified409370
+Ref: User-modified-Footnote-1417055
+Node: Auto-set417117
+Ref: Auto-set-Footnote-1429682
+Ref: Auto-set-Footnote-2429887
+Node: ARGC and ARGV429943
+Node: Arrays433797
+Node: Array Basics435295
+Node: Array Intro436121
+Ref: figure-array-elements438094
+Node: Reference to Elements440501
+Node: Assigning Elements442774
+Node: Array Example443265
+Node: Scanning an Array444997
+Node: Controlling Scanning448012
+Ref: Controlling Scanning-Footnote-1453185
+Node: Delete453501
+Ref: Delete-Footnote-1456266
+Node: Numeric Array Subscripts456323
+Node: Uninitialized Subscripts458506
+Node: Multidimensional460131
+Node: Multiscanning463224
+Node: Arrays of Arrays464813
+Node: Functions469453
+Node: Built-in470272
+Node: Calling Built-in471350
+Node: Numeric Functions473338
+Ref: Numeric Functions-Footnote-1477172
+Ref: Numeric Functions-Footnote-2477529
+Ref: Numeric Functions-Footnote-3477577
+Node: String Functions477846
+Ref: String Functions-Footnote-1500849
+Ref: String Functions-Footnote-2500978
+Ref: String Functions-Footnote-3501226
+Node: Gory Details501313
+Ref: table-sub-escapes502992
+Ref: table-sub-posix-92504346
+Ref: table-sub-proposed505697
+Ref: table-posix-sub507051
+Ref: table-gensub-escapes508596
+Ref: Gory Details-Footnote-1509772
+Ref: Gory Details-Footnote-2509823
+Node: I/O Functions509974
+Ref: I/O Functions-Footnote-1516970
+Node: Time Functions517117
+Ref: Time Functions-Footnote-1528110
+Ref: Time Functions-Footnote-2528178
+Ref: Time Functions-Footnote-3528336
+Ref: Time Functions-Footnote-4528447
+Ref: Time Functions-Footnote-5528559
+Ref: Time Functions-Footnote-6528786
+Node: Bitwise Functions529052
+Ref: table-bitwise-ops529614
+Ref: Bitwise Functions-Footnote-1533859
+Node: Type Functions534043
+Node: I18N Functions535194
+Node: User-defined536846
+Node: Definition Syntax537650
+Ref: Definition Syntax-Footnote-1542564
+Node: Function Example542633
+Ref: Function Example-Footnote-1545282
+Node: Function Caveats545304
+Node: Calling A Function545822
+Node: Variable Scope546777
+Node: Pass By Value/Reference549740
+Node: Return Statement553248
+Node: Dynamic Typing556229
+Node: Indirect Calls557160
+Node: Library Functions566847
+Ref: Library Functions-Footnote-1570360
+Ref: Library Functions-Footnote-2570503
+Node: Library Names570674
+Ref: Library Names-Footnote-1574147
+Ref: Library Names-Footnote-2574367
+Node: General Functions574453
+Node: Strtonum Function575481
+Node: Assert Function578411
+Node: Round Function581737
+Node: Cliff Random Function583278
+Node: Ordinal Functions584294
+Ref: Ordinal Functions-Footnote-1587371
+Ref: Ordinal Functions-Footnote-2587623
+Node: Join Function587834
+Ref: Join Function-Footnote-1589605
+Node: Getlocaltime Function589805
+Node: Readfile Function593546
+Node: Data File Management595385
+Node: Filetrans Function596017
+Node: Rewind Function600086
+Node: File Checking601473
+Node: Empty Files602567
+Node: Ignoring Assigns604797
+Node: Getopt Function606351
+Ref: Getopt Function-Footnote-1617654
+Node: Passwd Functions617857
+Ref: Passwd Functions-Footnote-1626835
+Node: Group Functions626923
+Node: Walking Arrays635007
+Node: Sample Programs637143
+Node: Running Examples637817
+Node: Clones638545
+Node: Cut Program639769
+Node: Egrep Program649620
+Ref: Egrep Program-Footnote-1657393
+Node: Id Program657503
+Node: Split Program661152
+Ref: Split Program-Footnote-1664671
+Node: Tee Program664799
+Node: Uniq Program667602
+Node: Wc Program675031
+Ref: Wc Program-Footnote-1679297
+Ref: Wc Program-Footnote-2679497
+Node: Miscellaneous Programs679589
+Node: Dupword Program680777
+Node: Alarm Program682808
+Node: Translate Program687615
+Ref: Translate Program-Footnote-1692002
+Ref: Translate Program-Footnote-2692250
+Node: Labels Program692384
+Ref: Labels Program-Footnote-1695755
+Node: Word Sorting695839
+Node: History Sorting699723
+Node: Extract Program701562
+Ref: Extract Program-Footnote-1709065
+Node: Simple Sed709193
+Node: Igawk Program712255
+Ref: Igawk Program-Footnote-1727426
+Ref: Igawk Program-Footnote-2727627
+Node: Anagram Program727765
+Node: Signature Program730833
+Node: Advanced Features731933
+Node: Nondecimal Data733819
+Node: Array Sorting735402
+Node: Controlling Array Traversal736099
+Node: Array Sorting Functions744383
+Ref: Array Sorting Functions-Footnote-1748252
+Node: Two-way I/O748446
+Ref: Two-way I/O-Footnote-1753878
+Node: TCP/IP Networking753960
+Node: Profiling756804
+Node: Internationalization764307
+Node: I18N and L10N765732
+Node: Explaining gettext766418
+Ref: Explaining gettext-Footnote-1771486
+Ref: Explaining gettext-Footnote-2771670
+Node: Programmer i18n771835
+Node: Translator i18n776062
+Node: String Extraction776856
+Ref: String Extraction-Footnote-1777817
+Node: Printf Ordering777903
+Ref: Printf Ordering-Footnote-1780685
+Node: I18N Portability780749
+Ref: I18N Portability-Footnote-1783198
+Node: I18N Example783261
+Ref: I18N Example-Footnote-1785899
+Node: Gawk I18N785971
+Node: Debugger786592
+Node: Debugging787563
+Node: Debugging Concepts787996
+Node: Debugging Terms789852
+Node: Awk Debugging792449
+Node: Sample Debugging Session793341
+Node: Debugger Invocation793861
+Node: Finding The Bug795194
+Node: List of Debugger Commands801681
+Node: Breakpoint Control803015
+Node: Debugger Execution Control806679
+Node: Viewing And Changing Data810039
+Node: Execution Stack813395
+Node: Debugger Info814862
+Node: Miscellaneous Debugger Commands818856
+Node: Readline Support824034
+Node: Limitations824865
+Node: Arbitrary Precision Arithmetic827117
+Ref: Arbitrary Precision Arithmetic-Footnote-1828766
+Node: General Arithmetic828914
+Node: Floating Point Issues830634
+Node: String Conversion Precision831515
+Ref: String Conversion Precision-Footnote-1833220
+Node: Unexpected Results833329
+Node: POSIX Floating Point Problems835482
+Ref: POSIX Floating Point Problems-Footnote-1839307
+Node: Integer Programming839345
+Node: Floating-point Programming841084
+Ref: Floating-point Programming-Footnote-1847415
+Ref: Floating-point Programming-Footnote-2847685
+Node: Floating-point Representation847949
+Node: Floating-point Context849114
+Ref: table-ieee-formats849953
+Node: Rounding Mode851337
+Ref: table-rounding-modes851816
+Ref: Rounding Mode-Footnote-1854831
+Node: Gawk and MPFR855010
+Node: Arbitrary Precision Floats856419
+Ref: Arbitrary Precision Floats-Footnote-1858862
+Node: Setting Precision859178
+Ref: table-predefined-precision-strings859864
+Node: Setting Rounding Mode862009
+Ref: table-gawk-rounding-modes862413
+Node: Floating-point Constants863600
+Node: Changing Precision865029
+Ref: Changing Precision-Footnote-1866426
+Node: Exact Arithmetic866600
+Node: Arbitrary Precision Integers869738
+Ref: Arbitrary Precision Integers-Footnote-1872753
+Node: Dynamic Extensions872900
+Node: Extension Intro874358
+Node: Plugin License875623
+Node: Extension Mechanism Outline876308
+Ref: load-extension876725
+Ref: load-new-function878203
+Ref: call-new-function879198
+Node: Extension API Description881213
+Node: Extension API Functions Introduction882500
+Node: General Data Types887427
+Ref: General Data Types-Footnote-1893122
+Node: Requesting Values893421
+Ref: table-value-types-returned894158
+Node: Memory Allocation Functions895112
+Ref: Memory Allocation Functions-Footnote-1897858
+Node: Constructor Functions897954
+Node: Registration Functions899712
+Node: Extension Functions900397
+Node: Exit Callback Functions902699
+Node: Extension Version String903948
+Node: Input Parsers904598
+Node: Output Wrappers914355
+Node: Two-way processors918865
+Node: Printing Messages921073
+Ref: Printing Messages-Footnote-1922150
+Node: Updating `ERRNO'922302
+Node: Accessing Parameters923041
+Node: Symbol Table Access924271
+Node: Symbol table by name924785
+Node: Symbol table by cookie926761
+Ref: Symbol table by cookie-Footnote-1930893
+Node: Cached values930956
+Ref: Cached values-Footnote-1934446
+Node: Array Manipulation934537
+Ref: Array Manipulation-Footnote-1935635
+Node: Array Data Types935674
+Ref: Array Data Types-Footnote-1938377
+Node: Array Functions938469
+Node: Flattening Arrays942305
+Node: Creating Arrays949157
+Node: Extension API Variables953882
+Node: Extension Versioning954518
+Node: Extension API Informational Variables956419
+Node: Extension API Boilerplate957505
+Node: Finding Extensions961309
+Node: Extension Example961869
+Node: Internal File Description962599
+Node: Internal File Ops966690
+Ref: Internal File Ops-Footnote-1978199
+Node: Using Internal File Ops978339
+Ref: Using Internal File Ops-Footnote-1980686
+Node: Extension Samples980952
+Node: Extension Sample File Functions982476
+Node: Extension Sample Fnmatch990963
+Node: Extension Sample Fork992732
+Node: Extension Sample Inplace993945
+Node: Extension Sample Ord995723
+Node: Extension Sample Readdir996559
+Node: Extension Sample Revout998091
+Node: Extension Sample Rev2way998684
+Node: Extension Sample Read write array999374
+Node: Extension Sample Readfile1001257
+Node: Extension Sample API Tests1002357
+Node: Extension Sample Time1002882
+Node: gawkextlib1004246
+Node: Language History1007027
+Node: V7/SVR3.11008620
+Node: SVR41010940
+Node: POSIX1012382
+Node: BTL1013768
+Node: POSIX/GNU1014502
+Node: Feature History1020101
+Node: Common Extensions1033077
+Node: Ranges and Locales1034389
+Ref: Ranges and Locales-Footnote-11039006
+Ref: Ranges and Locales-Footnote-21039033
+Ref: Ranges and Locales-Footnote-31039267
+Node: Contributors1039488
+Node: Installation1044869
+Node: Gawk Distribution1045763
+Node: Getting1046247
+Node: Extracting1047073
+Node: Distribution contents1048765
+Node: Unix Installation1054486
+Node: Quick Installation1055103
+Node: Additional Configuration Options1057549
+Node: Configuration Philosophy1059285
+Node: Non-Unix Installation1061639
+Node: PC Installation1062097
+Node: PC Binary Installation1063396
+Node: PC Compiling1065244
+Node: PC Testing1068188
+Node: PC Using1069364
+Node: Cygwin1073532
+Node: MSYS1074341
+Node: VMS Installation1074855
+Node: VMS Compilation1075651
+Ref: VMS Compilation-Footnote-11076903
+Node: VMS Dynamic Extensions1076961
+Node: VMS Installation Details1078334
+Node: VMS Running1080585
+Node: VMS GNV1083419
+Node: VMS Old Gawk1084142
+Node: Bugs1084612
+Node: Other Versions1088530
+Node: Notes1094614
+Node: Compatibility Mode1095414
+Node: Additions1096197
+Node: Accessing The Source1097124
+Node: Adding Code1098564
+Node: New Ports1104609
+Node: Derived Files1108744
+Ref: Derived Files-Footnote-11114065
+Ref: Derived Files-Footnote-21114099
+Ref: Derived Files-Footnote-31114699
+Node: Future Extensions1114797
+Node: Implementation Limitations1115380
+Node: Extension Design1116628
+Node: Old Extension Problems1117782
+Ref: Old Extension Problems-Footnote-11119290
+Node: Extension New Mechanism Goals1119347
+Ref: Extension New Mechanism Goals-Footnote-11122712
+Node: Extension Other Design Decisions1122898
+Node: Extension Future Growth1125004
+Node: Old Extension Mechanism1125840
+Node: Basic Concepts1127580
+Node: Basic High Level1128261
+Ref: figure-general-flow1128533
+Ref: figure-process-flow1129132
+Ref: Basic High Level-Footnote-11132361
+Node: Basic Data Typing1132546
+Node: Glossary1135901
+Node: Copying1161132
+Node: GNU Free Documentation License1198688
+Node: Index1223824

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index f721b5f4..569c2f33 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -13657,9 +13657,9 @@ automatically by @command{awk}, so that they carry information from the
internal workings of @command{awk} to your program.
@cindex @command{gawk}, built-in variables and
-This @value{SECTION} documents all the built-in variables of
-@command{gawk}, most of which are also documented in the chapters
-describing their areas of activity.
+This @value{SECTION} documents all of @command{gawk}'s built-in variables,
+most of which are also documented in the @value{CHAPTER}s describing
+their areas of activity.
@menu
* User-modified:: Built-in variables that you change to control
@@ -13677,44 +13677,38 @@ describing their areas of activity.
@cindex user-modifiable variables
The following is an alphabetical list of variables that you can change to
-control how @command{awk} does certain things. The variables that are
-specific to @command{gawk} are marked with a pound sign@w{ (@samp{#}).}
+control how @command{awk} does certain things.
+
+The variables that are specific to @command{gawk} are marked with a pound
+sign (@samp{#}). These variables are @command{gawk} extensions. In other
+@command{awk} implementations or if @command{gawk} is in compatibility
+mode (@pxref{Options}), they are not special. (Any exceptions are noted
+in the description of each variable.)
@table @code
@cindex @code{BINMODE} variable
@cindex binary input/output
@cindex input/output, binary
-@item BINMODE #
-On non-POSIX systems, this variable specifies use of binary mode for all I/O.
-Numeric values of one, two, or three specify that input files, output files, or
-all files, respectively, should use binary I/O.
-A numeric value less than zero is treated as zero, and a numeric value greater than
-three is treated as three.
-Alternatively,
-string values of @code{"r"} or @code{"w"} specify that input files and
-output files, respectively, should use binary I/O.
-A string value of @code{"rw"} or @code{"wr"} indicates that all
-files should use binary I/O.
-Any other string value is treated the same as @code{"rw"},
-but causes @command{gawk}
-to generate a warning message.
-@code{BINMODE} is described in more detail in
-@ref{PC Using}.
-
@cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations
-(except @command{mawk},
-@pxref{Other Versions}),
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item BINMODE #
+On non-POSIX systems, this variable specifies use of binary mode
+for all I/O. Numeric values of one, two, or three specify that input
+files, output files, or all files, respectively, should use binary I/O.
+A numeric value less than zero is treated as zero, and a numeric value
+greater than three is treated as three. Alternatively, string values
+of @code{"r"} or @code{"w"} specify that input files and output files,
+respectively, should use binary I/O. A string value of @code{"rw"} or
+@code{"wr"} indicates that all files should use binary I/O. Any other
+string value is treated the same as @code{"rw"}, but causes @command{gawk}
+to generate a warning message. @code{BINMODE} is described in more
+detail in @ref{PC Using}. @command{mawk} @pxref{Other Versions}),
+also supports this variable, but only using numeric values.
@cindex @code{CONVFMT} variable
@cindex POSIX @command{awk}, @code{CONVFMT} variable and
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
-@item CONVFMT
+@item @code{CONVFMT}
This string controls conversion of numbers to
strings (@pxref{Conversion}).
It works by being passed, in effect, as the first argument to the
@@ -13729,40 +13723,29 @@ Its default value is @code{"%.6g"}.
@cindex field separators, @code{FIELDWIDTHS} variable and
@cindex separators, field, @code{FIELDWIDTHS} variable and
@item FIELDWIDTHS #
-This is a space-separated list of columns that tells @command{gawk}
+A space-separated list of columns that tells @command{gawk}
how to split input with fixed columnar boundaries.
Assigning a value to @code{FIELDWIDTHS}
overrides the use of @code{FS} and @code{FPAT} for field splitting.
@xref{Constant Size}, for more information.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}), then @code{FIELDWIDTHS}
-has no special meaning, and field-splitting operations occur based
-exclusively on the value of @code{FS}.
-
@cindex @command{gawk}, @code{FPAT} variable in
@cindex @code{FPAT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{FPAT} variable
@cindex field separators, @code{FPAT} variable and
@cindex separators, field, @code{FPAT} variable and
@item FPAT #
-This is a regular expression (as a string) that tells @command{gawk}
+A regular expression (as a string) that tells @command{gawk}
to create the fields based on text that matches the regular expression.
Assigning a value to @code{FPAT}
overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting.
@xref{Splitting By Content}, for more information.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}), then @code{FPAT}
-has no special meaning, and field-splitting operations occur based
-exclusively on the value of @code{FS}.
-
@cindex @code{FS} variable
@cindex separators, field
@cindex field separators
@item FS
-This is the input field separator
-(@pxref{Field Separators}).
+The input field separator (@pxref{Field Separators}).
The value is a single-character string or a multicharacter regular
expression that matches the separations between fields in an input
record. If the value is the null string (@code{""}), then each
@@ -13812,18 +13795,13 @@ and it does not affect field splitting when using a single-character
field separator.
@xref{Case-sensitivity}.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}),
-then @code{IGNORECASE} has no special meaning. Thus, string
-and regexp operations are always case-sensitive.
-
@cindex @command{gawk}, @code{LINT} variable in
@cindex @code{LINT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{LINT} variable
@cindex lint checking
@item LINT #
When this variable is true (nonzero or non-null), @command{gawk}
-behaves as if the @option{--lint} command-line option is in effect.
+behaves as if the @option{--lint} command-line option is in effect
(@pxref{Options}).
With a value of @code{"fatal"}, lint warnings become fatal errors.
With a value of @code{"invalid"}, only warnings about things that are
@@ -13844,7 +13822,7 @@ of @command{awk} being executed.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item OFMT
-This string controls conversion of numbers to
+Controls conversion of numbers to
strings (@pxref{Conversion}) for
printing with the @code{print} statement. It works by being passed
as the first argument to the @code{sprintf()} function
@@ -13865,7 +13843,7 @@ default value is @w{@code{" "}}, a string consisting of a single space.
@cindex @code{ORS} variable
@item ORS
-This is the output record separator. It is output at the end of every
+The output record separator. It is output at the end of every
@code{print} statement. Its default value is @code{"\n"}, the newline
character. (@xref{Output Separators}.)
@@ -13878,14 +13856,13 @@ The working precision of arbitrary precision floating-point numbers,
@item ROUNDMODE #
The rounding mode to use for arbitrary precision arithmetic on
numbers, by default @code{"N"} (@samp{roundTiesToEven} in
-the IEEE-754 standard)
-(@pxref{Setting Rounding Mode}).
+the IEEE-754 standard; @pxref{Setting Rounding Mode}).
@cindex @code{RS} variable
@cindex separators, for records
@cindex record separators
-@item RS
-This is @command{awk}'s input record separator. Its default value is a string
+@item @code{RS}
+The input record separator. Its default value is a string
containing a single newline character, which means that an input record
consists of a single line of text.
It can also be the null string, in which case records are separated by
@@ -13904,8 +13881,8 @@ just the first character of @code{RS}'s value is used.
@cindex @code{SUBSEP} variable
@cindex separators, subscript
@cindex subscript separators
-@item SUBSEP
-This is the subscript separator. It has the default value of
+@item @code{SUBSEP}
+The subscript separator. It has the default value of
@code{"\034"} and is used to separate the parts of the indices of a
multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}}
really accesses @code{foo["A\034B"]}
@@ -13916,18 +13893,12 @@ really accesses @code{foo["A\034B"]}
@cindex differences in @command{awk} and @command{gawk}, @code{TEXTDOMAIN} variable
@cindex internationalization, localization
@item TEXTDOMAIN #
-This variable is used for internationalization of programs at the
+Used for internationalization of programs at the
@command{awk} level. It sets the default text domain for specially
marked string constants in the source text, as well as for the
@code{dcgettext()}, @code{dcngettext()} and @code{bindtextdomain()} functions
(@pxref{Internationalization}).
The default value of @code{TEXTDOMAIN} is @code{"messages"}.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
@end table
@c ENDOFRANGE bvar
@c ENDOFRANGE varb
@@ -13943,8 +13914,12 @@ it is not special.
@cindex variables, built-in, conveying information
The following is an alphabetical list of variables that @command{awk}
sets automatically on certain occasions in order to provide
-information to your program. The variables that are specific to
-@command{gawk} are marked with a pound sign@w{ (@samp{#}).}
+information to your program.
+
+The variables that are specific to @command{gawk} are marked with a pound
+sign (@samp{#}). These variables are @command{gawk} extensions. In other
+@command{awk} implementations or if @command{gawk} is in compatibility
+mode (@pxref{Options}), they are not special.
@c @asis for docbook
@table @asis
@@ -13991,7 +13966,7 @@ about how @command{awk} uses these variables.
@cindex @code{ARGIND} variable
@cindex differences in @command{awk} and @command{gawk}, @code{ARGIND} variable
-@item @code{ARGIND} #
+@item @code{ARGIND #}
The index in @code{ARGV} of the current file being processed.
Every time @command{gawk} opens a new data file for processing, it sets
@code{ARGIND} to the index in @code{ARGV} of the file name.
@@ -14008,78 +13983,58 @@ While you can change the value of @code{ARGIND} within your @command{awk}
program, @command{gawk} automatically sets it to a new value when the
next file is opened.
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
-
@cindex @code{ENVIRON} array
@cindex environment variables, in @code{ENVIRON} array
@item @code{ENVIRON}
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
the particular environment variables. For example,
-@code{ENVIRON["HOME"]} might be @file{/home/arnold}. Changing this array
+@code{ENVIRON["HOME"]} might be @code{"/home/arnold"}. Changing this array
does not affect the environment passed on to any programs that
@command{awk} may spawn via redirection or the @code{system()} function.
-@c (In a future version of @command{gawk}, it may do so.)
+(In a future version of @command{gawk}, it may do so.)
Some operating systems may not have environment variables.
On such systems, the @code{ENVIRON} array is empty (except for
-@w{@code{ENVIRON["AWKPATH"]}},
-@pxref{AWKPATH Variable} and
-@w{@code{ENVIRON["AWKLIBPATH"]}},
+@w{@code{ENVIRON["AWKPATH"]}} and
+@w{@code{ENVIRON["AWKLIBPATH"]}};
+@pxref{AWKPATH Variable}, and
@pxref{AWKLIBPATH Variable}).
@cindex @command{gawk}, @code{ERRNO} variable in
@cindex @code{ERRNO} variable
@cindex differences in @command{awk} and @command{gawk}, @code{ERRNO} variable
@cindex error handling, @code{ERRNO} variable and
-@item @code{ERRNO} #
-If a system error occurs during a redirection for @code{getline},
-during a read for @code{getline}, or during a @code{close()} operation,
-then @code{ERRNO} contains a string describing the error.
-
-In addition, @command{gawk} clears @code{ERRNO}
-before opening each command-line input file. This enables checking if
-the file is readable inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}).
-
-Otherwise,
-@code{ERRNO} works similarly to the C variable @code{errno}.
-Except for the case just mentioned,
-@command{gawk} @emph{never} clears it (sets it
-to zero or @code{""}). Thus, you should only expect its value
-to be meaningful when an I/O operation returns a failure
-value, such as @code{getline} returning @minus{}1.
-You are, of course, free to clear it yourself before doing an
-I/O operation.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item @code{ERRNO #}
+If a system error occurs during a redirection for @code{getline}, during
+a read for @code{getline}, or during a @code{close()} operation, then
+@code{ERRNO} contains a string describing the error.
+
+In addition, @command{gawk} clears @code{ERRNO} before opening each
+command-line input file. This enables checking if the file is readable
+inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}).
+
+Otherwise, @code{ERRNO} works similarly to the C variable @code{errno}.
+Except for the case just mentioned, @command{gawk} @emph{never} clears
+it (sets it to zero or @code{""}). Thus, you should only expect its
+value to be meaningful when an I/O operation returns a failure value,
+such as @code{getline} returning @minus{}1. You are, of course, free
+to clear it yourself before doing an I/O operation.
@cindex @code{FILENAME} variable
@cindex dark corner, @code{FILENAME} variable
@item @code{FILENAME}
-The name of the file that @command{awk} is currently reading.
-When no data files are listed on the command line, @command{awk} reads
-from the standard input and @code{FILENAME} is set to @code{"-"}.
-@code{FILENAME} is changed each time a new file is read
-(@pxref{Reading Files}).
-Inside a @code{BEGIN} rule, the value of @code{FILENAME} is
-@code{""}, since there are no input files being processed
-yet.@footnote{Some early implementations of Unix @command{awk} initialized
-@code{FILENAME} to @code{"-"}, even if there were data files to be
-processed. This behavior was incorrect and should not be relied
-upon in your programs.}
-@value{DARKCORNER}
-Note, though, that using @code{getline}
-(@pxref{Getline})
-inside a @code{BEGIN} rule can give
-@code{FILENAME} a value.
+The name of the current input file. When no data files are listed
+on the command line, @command{awk} reads from the standard input and
+@code{FILENAME} is set to @code{"-"}. @code{FILENAME} changes each
+time a new file is read (@pxref{Reading Files}). Inside a @code{BEGIN}
+rule, the value of @code{FILENAME} is @code{""}, since there are no input
+files being processed yet.@footnote{Some early implementations of Unix
+@command{awk} initialized @code{FILENAME} to @code{"-"}, even if there
+were data files to be processed. This behavior was incorrect and should
+not be relied upon in your programs.} @value{DARKCORNER} Note, though,
+that using @code{getline} (@pxref{Getline}) inside a @code{BEGIN} rule
+can give @code{FILENAME} a value.
@cindex @code{FNR} variable
@item @code{FNR}
@@ -14103,14 +14058,14 @@ current record. @xref{Changing Fields}.
@cindex @code{FUNCTAB} array
@cindex @command{gawk}, @code{FUNCTAB} array in
@cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable
-@item @code{FUNCTAB} #
+@item @code{FUNCTAB #}
An array whose indices and corresponding values are the names of all
the user-defined or extension functions in the program.
@quotation NOTE
Attempting to use the @code{delete} statement with the @code{FUNCTAB}
-array will cause a fatal error. Any attempt to assign to an element of
-the @code{FUNCTAB} array will also cause a fatal error.
+array causes a fatal error. Any attempt to assign to an element of
+@code{FUNCTAB} also causes a fatal error.
@end quotation
@cindex @code{NR} variable
@@ -14123,7 +14078,7 @@ the beginning of the program's execution
@cindex @command{gawk}, @code{PROCINFO} array in
@cindex @code{PROCINFO} array
@cindex differences in @command{awk} and @command{gawk}, @code{PROCINFO} array
-@item @code{PROCINFO} #
+@item @code{PROCINFO #}
The elements of this array provide access to information about the
running @command{awk} program.
The following elements (listed alphabetically)
@@ -14192,7 +14147,7 @@ The parent process ID of the current process.
@item PROCINFO["sorted_in"]
If this element exists in @code{PROCINFO}, its value controls the
order in which array indices will be processed by
-@samp{for (index in array) @dots{}} loops.
+@samp{for (@var{index} in @var{array})} loops.
Since this is an advanced feature, we defer the
full description until later; see
@ref{Scanning an Array}.
@@ -14262,10 +14217,9 @@ The @code{PROCINFO} array has the following additional uses:
@itemize @bullet
@item
-It may be
-used to cause coprocesses
-to communicate over pseudo-ttys instead of through two-way pipes;
-this is discussed further in @ref{Two-way I/O}.
+It may be used to cause coprocesses to communicate over pseudo-ttys
+instead of through two-way pipes; this is discussed further in
+@ref{Two-way I/O}.
@item
It may be used to provide a timeout when reading from any
@@ -14273,12 +14227,6 @@ open input file, pipe, or coprocess.
@xref{Read Timeout}, for more information.
@end itemize
-This array is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
-
@cindex @code{RLENGTH} variable
@item @code{RLENGTH}
The length of the substring matched by the
@@ -14299,20 +14247,14 @@ if no match was found.
@cindex @command{gawk}, @code{RT} variable in
@cindex @code{RT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{RT} variable
-@item @code{RT} #
-This is set each time a record is read. It contains the input text
-that matched the text denoted by @code{RS}, the record separator.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item @code{RT #}
+The input text that matched the text denoted by @code{RS},
+the record separator. It is set every time a record is read.
@cindex @command{gawk}, @code{SYMTAB} array in
@cindex @code{SYMTAB} array
@cindex differences in @command{awk} and @command{gawk}, @code{SYMTAB} variable
-@item @code{SYMTAB} #
+@item @code{SYMTAB #}
An array whose indices are the names of all currently defined
global variables and arrays in the program. The array may be used
for indirect access to read or write the value of a variable:
@@ -14341,6 +14283,7 @@ This works as expected: in this case @code{SYMTAB} acts just like
a regular array. The only difference is that you can't then delete
@code{SYMTAB["xxx"]}.
+@cindex Schorr, Andrew
The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr
points out that it effectively gives @command{awk} data pointers. Consider his
example:
@@ -14355,8 +14298,8 @@ function multiply(variable, amount)
@end example
@quotation NOTE
-In order to avoid severe time-travel paradoxes@footnote{Not to mention difficult
-implementation issues.}, neither @code{FUNCTAB} nor @code{SYMTAB}
+In order to avoid severe time-travel paradoxes,@footnote{Not to mention difficult
+implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB}
are available as elements within the @code{SYMTAB} array.
@end quotation
@end table
@@ -14584,7 +14527,7 @@ It also describes how @command{awk} simulates multidimensional
arrays, as well as some of the less obvious points about array usage.
The @value{CHAPTER} moves on to discuss @command{gawk}'s facility
for sorting arrays, and ends with a brief description of @command{gawk}'s
-ability to support true multidimensional arrays.
+ability to support true arrays of arrays.
@cindex variables, names of
@cindex functions, names of
@@ -14668,35 +14611,32 @@ the array is declared.)
A contiguous array of four elements might look like the following example,
conceptually, if the element values are 8, @code{"foo"},
-@code{""}, and 30:
+@code{""}, and 30
+@ifnotdocbook
+as shown in @ref{figure-array-elements}:
+@end ifnotdocbook
+@ifdocbook
+as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
+@end ifdocbook
-@c @strong{FIXME: NEXT ED:} Use real images here, and an @float
-@iftex
-@c from Karl Berry, much thanks for the help.
-@tex
-\bigskip % space above the table (about 1 linespace)
-\offinterlineskip
-\newdimen\width \width = 1.5cm
-\newdimen\hwidth \hwidth = 4\width \advance\hwidth by 2pt % 5 * 0.4pt
-\centerline{\vbox{
-\halign{\strut\hfil\ignorespaces#&&\vrule#&\hbox to\width{\hfil#\unskip\hfil}\cr
-\noalign{\hrule width\hwidth}
- &&{\tt 8} &&{\tt "foo"} &&{\tt ""} &&{\tt 30} &&\quad Value\cr
-\noalign{\hrule width\hwidth}
-\noalign{\smallskip}
- &\omit&0&\omit &1 &\omit&2 &\omit&3 &\omit&\quad Index\cr
-}
-}}
-@end tex
-@end iftex
-@ifnottex
-@example
-+---------+---------+--------+---------+
-| 8 | "foo" | "" | 30 | @r{Value}
-+---------+---------+--------+---------+
- 0 1 2 3 @r{Index}
-@end example
-@end ifnottex
+@ifnotdocbook
+@float Figure,figure-array-elements
+@caption{A Contiguous Array}
+@ifinfo
+@center @image{array-elements, , , Basic Program Stages, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{array-elements, , , Basic Program Stages}
+@end ifnotinfo
+@end float
+@end ifnotdocbook
+
+@docbook
+<figure id="figure-array-elements">
+<title>A Contiguous Array</title>
+<graphic fileref="array-elements.eps"/>
+</figure>
+@end docbook
@noindent
Only the values are stored; the indices are implicit from the order of
@@ -14713,12 +14653,53 @@ Arrays in @command{awk} are different---they are @dfn{associative}. This means
that each array is a collection of pairs: an index and its corresponding
array element value:
+@ifnotdocbook
@example
@r{Index} 3 @r{Value} 30
@r{Index} 1 @r{Value} "foo"
@r{Index} 0 @r{Value} 8
@r{Index} 2 @r{Value} ""
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+
+<tbody>
+<row>
+<entry><literal>3</literal></entry>
+<entry><literal>30</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"foo"</literal></entry>
+</row>
+
+<row>
+<entry><literal>0</literal></entry>
+<entry><literal>8</literal></entry>
+</row>
+
+<row>
+<entry><literal>2</literal></entry>
+<entry><literal>""</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
The pairs are shown in jumbled order because their order is irrelevant.
@@ -14727,6 +14708,7 @@ One advantage of associative arrays is that new pairs can be added
at any time. For example, suppose a tenth element is added to the array
whose value is @w{@code{"number ten"}}. The result is:
+@ifnotdocbook
@example
@r{Index} 10 @r{Value} "number ten"
@r{Index} 3 @r{Value} 30
@@ -14734,6 +14716,51 @@ whose value is @w{@code{"number ten"}}. The result is:
@r{Index} 0 @r{Value} 8
@r{Index} 2 @r{Value} ""
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+<tbody>
+
+<row>
+<entry><literal>10</literal></entry>
+<entry><literal>"number ten"</literal></entry>
+</row>
+
+<row>
+<entry><literal>3</literal></entry>
+<entry><literal>30</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"foo"</literal></entry>
+</row>
+
+<row>
+<entry><literal>0</literal></entry>
+<entry><literal>8</literal></entry>
+</row>
+
+<row>
+<entry><literal>2</literal></entry>
+<entry><literal>""</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
@cindex sparse arrays
@@ -14746,20 +14773,60 @@ have to be positive integers. Any number, or even a string, can be
an index. For example, the following is an array that translates words from
English to French:
+@ifnotdocbook
@example
@r{Index} "dog" @r{Value} "chien"
@r{Index} "cat" @r{Value} "chat"
@r{Index} "one" @r{Value} "un"
@r{Index} 1 @r{Value} "un"
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry><literal>"dog"</literal></entry>
+<entry><literal>"chien"</literal></entry>
+</row>
+
+<row>
+<entry><literal>"cat"</literal></entry>
+<entry><literal>"chat"</literal></entry>
+</row>
+
+<row>
+<entry><literal>"one"</literal></entry>
+<entry><literal>"un"</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"un"</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
Here we decided to translate the number one in both spelled-out and
numeric form---thus illustrating that a single array can have both
numbers and strings as indices.
-In fact, array subscripts are always strings; this is discussed
+(In fact, array subscripts are always strings; this is discussed
in more detail in
-@ref{Numeric Array Subscripts}.
+@ref{Numeric Array Subscripts}.)
Here, the number @code{1} isn't double-quoted, since @command{awk}
automatically converts it to a string.
@@ -14835,14 +14902,14 @@ To determine whether an element exists in an array at a certain index, use
the following expression:
@example
-@var{ind} in @var{array}
+@var{indx} in @var{array}
@end example
@cindex side effects, array indexing
@noindent
-This expression tests whether the particular index @var{ind} exists,
+This expression tests whether the particular index @var{indx} exists,
without the side effect of creating that element if it is not present.
-The expression has the value one (true) if @code{@var{array}[@var{ind}]}
+The expression has the value one (true) if @code{@var{array}[@var{indx}]}
exists and zero (false) if it does not exist.
For example, this statement tests whether the array @code{frequencies}
contains the index @samp{2}:
@@ -15016,14 +15083,56 @@ for a more detailed example of this type.
@cindex @code{in} operator, order of array access
The order in which elements of the array are accessed by this statement
is determined by the internal arrangement of the array elements within
-@command{awk} and normally cannot be controlled or changed. This can lead to
-problems if new elements are added to @var{array} by statements in
-the loop body; it is not predictable whether the @code{for} loop will
-reach them. Similarly, changing @var{var} inside the loop may produce
-strange results. It is best to avoid such things.
+@command{awk} and in standard @command{awk} cannot be controlled
+or changed. This can lead to problems if new elements are added to
+@var{array} by statements in the loop body; it is not predictable whether
+the @code{for} loop will reach them. Similarly, changing @var{var} inside
+the loop may produce strange results. It is best to avoid such things.
+
+As a point of information, @command{gawk} sets up the list of elements
+to be iterated over before the loop starts, and does not change it.
+But not all @command{awk} versions do so. Consider this program, named
+@file{loopcheck.awk}:
+
+@example
+BEGIN @{
+ a["here"] = "here"
+ a["is"] = "is"
+ a["a"] = "a"
+ a["loop"] = "loop"
+ for (i in a) @{
+ j++
+ a[j] = j
+ print i
+ @}
+@}
+@end example
+
+Here is what happens when run with @command{gawk}:
+
+@example
+$ @kbd{gawk -f loopcheck.awk}
+@print{} here
+@print{} loop
+@print{} a
+@print{} is
+@end example
+
+Contrast this to Brian Kernighan's @command{awk}:
+
+@example
+$ @kbd{nawk -f loopcheck.awk}
+@print{} loop
+@print{} here
+@print{} is
+@print{} a
+@print{} 1
+@end example
@node Controlling Scanning
-@subsection Using Predefined Array Scanning Orders
+@subsection Using Predefined Array Scanning Orders With @command{gawk}
+
+This @value{SUBSECTION} describes a feature that is specific to @command{gawk}.
By default, when a @code{for} loop traverses an array, the order
is undefined, meaning that the @command{awk} implementation
@@ -15377,7 +15486,7 @@ $ @kbd{echo 'line 1}
@print{} line 2
@end example
-Unfortunately, the very first line of input data did not come out in the
+Unfortunately, the very first line of input data did not appear in the
output!
Upon first glance, we would think that this program should have worked.
@@ -15575,7 +15684,7 @@ separate indices is recovered.
array access and provides true arrays of
arrays. Elements of a subarray are referred to by their own indices
enclosed in square brackets, just like the elements of the main array.
-For example, the following creates a two-element subarray at index @samp{1}
+For example, the following creates a two-element subarray at index @code{1}
of the main array @code{a}:
@example
@@ -15599,7 +15708,7 @@ Each subarray and the main array can be of different length. In fact, the
elements of an array or its subarray do not all have to have the same
type. This means that the main array and any of its subarrays can be
non-rectangular, or jagged in structure. One can assign a scalar value to
-the index @samp{4} of the main array @code{a}:
+the index @code{4} of the main array @code{a}:
@example
a[4] = "An element in a jagged array"
@@ -15620,7 +15729,7 @@ a[4][5][6][7] = "An element in a four-dimensional array"
@end example
@noindent
-This removes the scalar value from index @samp{4} and then inserts a
+This removes the scalar value from index @code{4} and then inserts a
subarray of subarray of subarray containing a scalar. You can also
delete an entire subarray or subarray of subarrays:
@@ -37943,7 +38052,7 @@ of the following, very basic set of steps,
as shown in @ref{figure-process-flow}:
@end ifnotdocbook
@ifdocbook
-as shown in @inlineraw{docbook <xref linkend="figure-process-flow"/>}:
+as shown in @inlineraw{docbook, <xref linkend="figure-process-flow"/>}:
@end ifdocbook
@ifnotdocbook
@@ -40289,4 +40398,5 @@ which sorta sucks.
TODO:
-----
-2. Add back in docbook fixes for @r{}.
+3. Check all docbook figures, if they should include with a
+specific extension or not.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index d73697df..06206642 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -13037,9 +13037,9 @@ automatically by @command{awk}, so that they carry information from the
internal workings of @command{awk} to your program.
@cindex @command{gawk}, built-in variables and
-This @value{SECTION} documents all the built-in variables of
-@command{gawk}, most of which are also documented in the chapters
-describing their areas of activity.
+This @value{SECTION} documents all of @command{gawk}'s built-in variables,
+most of which are also documented in the @value{CHAPTER}s describing
+their areas of activity.
@menu
* User-modified:: Built-in variables that you change to control
@@ -13057,44 +13057,38 @@ describing their areas of activity.
@cindex user-modifiable variables
The following is an alphabetical list of variables that you can change to
-control how @command{awk} does certain things. The variables that are
-specific to @command{gawk} are marked with a pound sign@w{ (@samp{#}).}
+control how @command{awk} does certain things.
+
+The variables that are specific to @command{gawk} are marked with a pound
+sign (@samp{#}). These variables are @command{gawk} extensions. In other
+@command{awk} implementations or if @command{gawk} is in compatibility
+mode (@pxref{Options}), they are not special. (Any exceptions are noted
+in the description of each variable.)
@table @code
@cindex @code{BINMODE} variable
@cindex binary input/output
@cindex input/output, binary
-@item BINMODE #
-On non-POSIX systems, this variable specifies use of binary mode for all I/O.
-Numeric values of one, two, or three specify that input files, output files, or
-all files, respectively, should use binary I/O.
-A numeric value less than zero is treated as zero, and a numeric value greater than
-three is treated as three.
-Alternatively,
-string values of @code{"r"} or @code{"w"} specify that input files and
-output files, respectively, should use binary I/O.
-A string value of @code{"rw"} or @code{"wr"} indicates that all
-files should use binary I/O.
-Any other string value is treated the same as @code{"rw"},
-but causes @command{gawk}
-to generate a warning message.
-@code{BINMODE} is described in more detail in
-@ref{PC Using}.
-
@cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations
-(except @command{mawk},
-@pxref{Other Versions}),
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item BINMODE #
+On non-POSIX systems, this variable specifies use of binary mode
+for all I/O. Numeric values of one, two, or three specify that input
+files, output files, or all files, respectively, should use binary I/O.
+A numeric value less than zero is treated as zero, and a numeric value
+greater than three is treated as three. Alternatively, string values
+of @code{"r"} or @code{"w"} specify that input files and output files,
+respectively, should use binary I/O. A string value of @code{"rw"} or
+@code{"wr"} indicates that all files should use binary I/O. Any other
+string value is treated the same as @code{"rw"}, but causes @command{gawk}
+to generate a warning message. @code{BINMODE} is described in more
+detail in @ref{PC Using}. @command{mawk} @pxref{Other Versions}),
+also supports this variable, but only using numeric values.
@cindex @code{CONVFMT} variable
@cindex POSIX @command{awk}, @code{CONVFMT} variable and
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
-@item CONVFMT
+@item @code{CONVFMT}
This string controls conversion of numbers to
strings (@pxref{Conversion}).
It works by being passed, in effect, as the first argument to the
@@ -13109,40 +13103,29 @@ Its default value is @code{"%.6g"}.
@cindex field separators, @code{FIELDWIDTHS} variable and
@cindex separators, field, @code{FIELDWIDTHS} variable and
@item FIELDWIDTHS #
-This is a space-separated list of columns that tells @command{gawk}
+A space-separated list of columns that tells @command{gawk}
how to split input with fixed columnar boundaries.
Assigning a value to @code{FIELDWIDTHS}
overrides the use of @code{FS} and @code{FPAT} for field splitting.
@xref{Constant Size}, for more information.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}), then @code{FIELDWIDTHS}
-has no special meaning, and field-splitting operations occur based
-exclusively on the value of @code{FS}.
-
@cindex @command{gawk}, @code{FPAT} variable in
@cindex @code{FPAT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{FPAT} variable
@cindex field separators, @code{FPAT} variable and
@cindex separators, field, @code{FPAT} variable and
@item FPAT #
-This is a regular expression (as a string) that tells @command{gawk}
+A regular expression (as a string) that tells @command{gawk}
to create the fields based on text that matches the regular expression.
Assigning a value to @code{FPAT}
overrides the use of @code{FS} and @code{FIELDWIDTHS} for field splitting.
@xref{Splitting By Content}, for more information.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}), then @code{FPAT}
-has no special meaning, and field-splitting operations occur based
-exclusively on the value of @code{FS}.
-
@cindex @code{FS} variable
@cindex separators, field
@cindex field separators
@item FS
-This is the input field separator
-(@pxref{Field Separators}).
+The input field separator (@pxref{Field Separators}).
The value is a single-character string or a multicharacter regular
expression that matches the separations between fields in an input
record. If the value is the null string (@code{""}), then each
@@ -13192,18 +13175,13 @@ and it does not affect field splitting when using a single-character
field separator.
@xref{Case-sensitivity}.
-If @command{gawk} is in compatibility mode
-(@pxref{Options}),
-then @code{IGNORECASE} has no special meaning. Thus, string
-and regexp operations are always case-sensitive.
-
@cindex @command{gawk}, @code{LINT} variable in
@cindex @code{LINT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{LINT} variable
@cindex lint checking
@item LINT #
When this variable is true (nonzero or non-null), @command{gawk}
-behaves as if the @option{--lint} command-line option is in effect.
+behaves as if the @option{--lint} command-line option is in effect
(@pxref{Options}).
With a value of @code{"fatal"}, lint warnings become fatal errors.
With a value of @code{"invalid"}, only warnings about things that are
@@ -13224,7 +13202,7 @@ of @command{awk} being executed.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item OFMT
-This string controls conversion of numbers to
+Controls conversion of numbers to
strings (@pxref{Conversion}) for
printing with the @code{print} statement. It works by being passed
as the first argument to the @code{sprintf()} function
@@ -13245,7 +13223,7 @@ default value is @w{@code{" "}}, a string consisting of a single space.
@cindex @code{ORS} variable
@item ORS
-This is the output record separator. It is output at the end of every
+The output record separator. It is output at the end of every
@code{print} statement. Its default value is @code{"\n"}, the newline
character. (@xref{Output Separators}.)
@@ -13258,14 +13236,13 @@ The working precision of arbitrary precision floating-point numbers,
@item ROUNDMODE #
The rounding mode to use for arbitrary precision arithmetic on
numbers, by default @code{"N"} (@samp{roundTiesToEven} in
-the IEEE-754 standard)
-(@pxref{Setting Rounding Mode}).
+the IEEE-754 standard; @pxref{Setting Rounding Mode}).
@cindex @code{RS} variable
@cindex separators, for records
@cindex record separators
-@item RS
-This is @command{awk}'s input record separator. Its default value is a string
+@item @code{RS}
+The input record separator. Its default value is a string
containing a single newline character, which means that an input record
consists of a single line of text.
It can also be the null string, in which case records are separated by
@@ -13284,8 +13261,8 @@ just the first character of @code{RS}'s value is used.
@cindex @code{SUBSEP} variable
@cindex separators, subscript
@cindex subscript separators
-@item SUBSEP
-This is the subscript separator. It has the default value of
+@item @code{SUBSEP}
+The subscript separator. It has the default value of
@code{"\034"} and is used to separate the parts of the indices of a
multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}}
really accesses @code{foo["A\034B"]}
@@ -13296,18 +13273,12 @@ really accesses @code{foo["A\034B"]}
@cindex differences in @command{awk} and @command{gawk}, @code{TEXTDOMAIN} variable
@cindex internationalization, localization
@item TEXTDOMAIN #
-This variable is used for internationalization of programs at the
+Used for internationalization of programs at the
@command{awk} level. It sets the default text domain for specially
marked string constants in the source text, as well as for the
@code{dcgettext()}, @code{dcngettext()} and @code{bindtextdomain()} functions
(@pxref{Internationalization}).
The default value of @code{TEXTDOMAIN} is @code{"messages"}.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
@end table
@c ENDOFRANGE bvar
@c ENDOFRANGE varb
@@ -13323,8 +13294,12 @@ it is not special.
@cindex variables, built-in, conveying information
The following is an alphabetical list of variables that @command{awk}
sets automatically on certain occasions in order to provide
-information to your program. The variables that are specific to
-@command{gawk} are marked with a pound sign@w{ (@samp{#}).}
+information to your program.
+
+The variables that are specific to @command{gawk} are marked with a pound
+sign (@samp{#}). These variables are @command{gawk} extensions. In other
+@command{awk} implementations or if @command{gawk} is in compatibility
+mode (@pxref{Options}), they are not special.
@c @asis for docbook
@table @asis
@@ -13371,7 +13346,7 @@ about how @command{awk} uses these variables.
@cindex @code{ARGIND} variable
@cindex differences in @command{awk} and @command{gawk}, @code{ARGIND} variable
-@item @code{ARGIND} #
+@item @code{ARGIND #}
The index in @code{ARGV} of the current file being processed.
Every time @command{gawk} opens a new data file for processing, it sets
@code{ARGIND} to the index in @code{ARGV} of the file name.
@@ -13388,78 +13363,58 @@ While you can change the value of @code{ARGIND} within your @command{awk}
program, @command{gawk} automatically sets it to a new value when the
next file is opened.
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
-
@cindex @code{ENVIRON} array
@cindex environment variables, in @code{ENVIRON} array
@item @code{ENVIRON}
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
the particular environment variables. For example,
-@code{ENVIRON["HOME"]} might be @file{/home/arnold}. Changing this array
+@code{ENVIRON["HOME"]} might be @code{"/home/arnold"}. Changing this array
does not affect the environment passed on to any programs that
@command{awk} may spawn via redirection or the @code{system()} function.
-@c (In a future version of @command{gawk}, it may do so.)
+(In a future version of @command{gawk}, it may do so.)
Some operating systems may not have environment variables.
On such systems, the @code{ENVIRON} array is empty (except for
-@w{@code{ENVIRON["AWKPATH"]}},
-@pxref{AWKPATH Variable} and
-@w{@code{ENVIRON["AWKLIBPATH"]}},
+@w{@code{ENVIRON["AWKPATH"]}} and
+@w{@code{ENVIRON["AWKLIBPATH"]}};
+@pxref{AWKPATH Variable}, and
@pxref{AWKLIBPATH Variable}).
@cindex @command{gawk}, @code{ERRNO} variable in
@cindex @code{ERRNO} variable
@cindex differences in @command{awk} and @command{gawk}, @code{ERRNO} variable
@cindex error handling, @code{ERRNO} variable and
-@item @code{ERRNO} #
-If a system error occurs during a redirection for @code{getline},
-during a read for @code{getline}, or during a @code{close()} operation,
-then @code{ERRNO} contains a string describing the error.
-
-In addition, @command{gawk} clears @code{ERRNO}
-before opening each command-line input file. This enables checking if
-the file is readable inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}).
-
-Otherwise,
-@code{ERRNO} works similarly to the C variable @code{errno}.
-Except for the case just mentioned,
-@command{gawk} @emph{never} clears it (sets it
-to zero or @code{""}). Thus, you should only expect its value
-to be meaningful when an I/O operation returns a failure
-value, such as @code{getline} returning @minus{}1.
-You are, of course, free to clear it yourself before doing an
-I/O operation.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item @code{ERRNO #}
+If a system error occurs during a redirection for @code{getline}, during
+a read for @code{getline}, or during a @code{close()} operation, then
+@code{ERRNO} contains a string describing the error.
+
+In addition, @command{gawk} clears @code{ERRNO} before opening each
+command-line input file. This enables checking if the file is readable
+inside a @code{BEGINFILE} pattern (@pxref{BEGINFILE/ENDFILE}).
+
+Otherwise, @code{ERRNO} works similarly to the C variable @code{errno}.
+Except for the case just mentioned, @command{gawk} @emph{never} clears
+it (sets it to zero or @code{""}). Thus, you should only expect its
+value to be meaningful when an I/O operation returns a failure value,
+such as @code{getline} returning @minus{}1. You are, of course, free
+to clear it yourself before doing an I/O operation.
@cindex @code{FILENAME} variable
@cindex dark corner, @code{FILENAME} variable
@item @code{FILENAME}
-The name of the file that @command{awk} is currently reading.
-When no data files are listed on the command line, @command{awk} reads
-from the standard input and @code{FILENAME} is set to @code{"-"}.
-@code{FILENAME} is changed each time a new file is read
-(@pxref{Reading Files}).
-Inside a @code{BEGIN} rule, the value of @code{FILENAME} is
-@code{""}, since there are no input files being processed
-yet.@footnote{Some early implementations of Unix @command{awk} initialized
-@code{FILENAME} to @code{"-"}, even if there were data files to be
-processed. This behavior was incorrect and should not be relied
-upon in your programs.}
-@value{DARKCORNER}
-Note, though, that using @code{getline}
-(@pxref{Getline})
-inside a @code{BEGIN} rule can give
-@code{FILENAME} a value.
+The name of the current input file. When no data files are listed
+on the command line, @command{awk} reads from the standard input and
+@code{FILENAME} is set to @code{"-"}. @code{FILENAME} changes each
+time a new file is read (@pxref{Reading Files}). Inside a @code{BEGIN}
+rule, the value of @code{FILENAME} is @code{""}, since there are no input
+files being processed yet.@footnote{Some early implementations of Unix
+@command{awk} initialized @code{FILENAME} to @code{"-"}, even if there
+were data files to be processed. This behavior was incorrect and should
+not be relied upon in your programs.} @value{DARKCORNER} Note, though,
+that using @code{getline} (@pxref{Getline}) inside a @code{BEGIN} rule
+can give @code{FILENAME} a value.
@cindex @code{FNR} variable
@item @code{FNR}
@@ -13483,14 +13438,14 @@ current record. @xref{Changing Fields}.
@cindex @code{FUNCTAB} array
@cindex @command{gawk}, @code{FUNCTAB} array in
@cindex differences in @command{awk} and @command{gawk}, @code{FUNCTAB} variable
-@item @code{FUNCTAB} #
+@item @code{FUNCTAB #}
An array whose indices and corresponding values are the names of all
the user-defined or extension functions in the program.
@quotation NOTE
Attempting to use the @code{delete} statement with the @code{FUNCTAB}
-array will cause a fatal error. Any attempt to assign to an element of
-the @code{FUNCTAB} array will also cause a fatal error.
+array causes a fatal error. Any attempt to assign to an element of
+@code{FUNCTAB} also causes a fatal error.
@end quotation
@cindex @code{NR} variable
@@ -13503,7 +13458,7 @@ the beginning of the program's execution
@cindex @command{gawk}, @code{PROCINFO} array in
@cindex @code{PROCINFO} array
@cindex differences in @command{awk} and @command{gawk}, @code{PROCINFO} array
-@item @code{PROCINFO} #
+@item @code{PROCINFO #}
The elements of this array provide access to information about the
running @command{awk} program.
The following elements (listed alphabetically)
@@ -13572,7 +13527,7 @@ The parent process ID of the current process.
@item PROCINFO["sorted_in"]
If this element exists in @code{PROCINFO}, its value controls the
order in which array indices will be processed by
-@samp{for (index in array) @dots{}} loops.
+@samp{for (@var{index} in @var{array})} loops.
Since this is an advanced feature, we defer the
full description until later; see
@ref{Scanning an Array}.
@@ -13642,10 +13597,9 @@ The @code{PROCINFO} array has the following additional uses:
@itemize @bullet
@item
-It may be
-used to cause coprocesses
-to communicate over pseudo-ttys instead of through two-way pipes;
-this is discussed further in @ref{Two-way I/O}.
+It may be used to cause coprocesses to communicate over pseudo-ttys
+instead of through two-way pipes; this is discussed further in
+@ref{Two-way I/O}.
@item
It may be used to provide a timeout when reading from any
@@ -13653,12 +13607,6 @@ open input file, pipe, or coprocess.
@xref{Read Timeout}, for more information.
@end itemize
-This array is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
-
@cindex @code{RLENGTH} variable
@item @code{RLENGTH}
The length of the substring matched by the
@@ -13679,20 +13627,14 @@ if no match was found.
@cindex @command{gawk}, @code{RT} variable in
@cindex @code{RT} variable
@cindex differences in @command{awk} and @command{gawk}, @code{RT} variable
-@item @code{RT} #
-This is set each time a record is read. It contains the input text
-that matched the text denoted by @code{RS}, the record separator.
-
-This variable is a @command{gawk} extension.
-In other @command{awk} implementations,
-or if @command{gawk} is in compatibility mode
-(@pxref{Options}),
-it is not special.
+@item @code{RT #}
+The input text that matched the text denoted by @code{RS},
+the record separator. It is set every time a record is read.
@cindex @command{gawk}, @code{SYMTAB} array in
@cindex @code{SYMTAB} array
@cindex differences in @command{awk} and @command{gawk}, @code{SYMTAB} variable
-@item @code{SYMTAB} #
+@item @code{SYMTAB #}
An array whose indices are the names of all currently defined
global variables and arrays in the program. The array may be used
for indirect access to read or write the value of a variable:
@@ -13721,6 +13663,7 @@ This works as expected: in this case @code{SYMTAB} acts just like
a regular array. The only difference is that you can't then delete
@code{SYMTAB["xxx"]}.
+@cindex Schorr, Andrew
The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr
points out that it effectively gives @command{awk} data pointers. Consider his
example:
@@ -13735,8 +13678,8 @@ function multiply(variable, amount)
@end example
@quotation NOTE
-In order to avoid severe time-travel paradoxes@footnote{Not to mention difficult
-implementation issues.}, neither @code{FUNCTAB} nor @code{SYMTAB}
+In order to avoid severe time-travel paradoxes,@footnote{Not to mention difficult
+implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB}
are available as elements within the @code{SYMTAB} array.
@end quotation
@end table
@@ -13918,7 +13861,7 @@ It also describes how @command{awk} simulates multidimensional
arrays, as well as some of the less obvious points about array usage.
The @value{CHAPTER} moves on to discuss @command{gawk}'s facility
for sorting arrays, and ends with a brief description of @command{gawk}'s
-ability to support true multidimensional arrays.
+ability to support true arrays of arrays.
@cindex variables, names of
@cindex functions, names of
@@ -14002,35 +13945,32 @@ the array is declared.)
A contiguous array of four elements might look like the following example,
conceptually, if the element values are 8, @code{"foo"},
-@code{""}, and 30:
+@code{""}, and 30
+@ifnotdocbook
+as shown in @ref{figure-array-elements}:
+@end ifnotdocbook
+@ifdocbook
+as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
+@end ifdocbook
-@c @strong{FIXME: NEXT ED:} Use real images here, and an @float
-@iftex
-@c from Karl Berry, much thanks for the help.
-@tex
-\bigskip % space above the table (about 1 linespace)
-\offinterlineskip
-\newdimen\width \width = 1.5cm
-\newdimen\hwidth \hwidth = 4\width \advance\hwidth by 2pt % 5 * 0.4pt
-\centerline{\vbox{
-\halign{\strut\hfil\ignorespaces#&&\vrule#&\hbox to\width{\hfil#\unskip\hfil}\cr
-\noalign{\hrule width\hwidth}
- &&{\tt 8} &&{\tt "foo"} &&{\tt ""} &&{\tt 30} &&\quad Value\cr
-\noalign{\hrule width\hwidth}
-\noalign{\smallskip}
- &\omit&0&\omit &1 &\omit&2 &\omit&3 &\omit&\quad Index\cr
-}
-}}
-@end tex
-@end iftex
-@ifnottex
-@example
-+---------+---------+--------+---------+
-| 8 | "foo" | "" | 30 | @r{Value}
-+---------+---------+--------+---------+
- 0 1 2 3 @r{Index}
-@end example
-@end ifnottex
+@ifnotdocbook
+@float Figure,figure-array-elements
+@caption{A Contiguous Array}
+@ifinfo
+@center @image{array-elements, , , Basic Program Stages, txt}
+@end ifinfo
+@ifnotinfo
+@center @image{array-elements, , , Basic Program Stages}
+@end ifnotinfo
+@end float
+@end ifnotdocbook
+
+@docbook
+<figure id="figure-array-elements">
+<title>A Contiguous Array</title>
+<graphic fileref="array-elements.eps"/>
+</figure>
+@end docbook
@noindent
Only the values are stored; the indices are implicit from the order of
@@ -14047,12 +13987,53 @@ Arrays in @command{awk} are different---they are @dfn{associative}. This means
that each array is a collection of pairs: an index and its corresponding
array element value:
+@ifnotdocbook
@example
@r{Index} 3 @r{Value} 30
@r{Index} 1 @r{Value} "foo"
@r{Index} 0 @r{Value} 8
@r{Index} 2 @r{Value} ""
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+
+<tbody>
+<row>
+<entry><literal>3</literal></entry>
+<entry><literal>30</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"foo"</literal></entry>
+</row>
+
+<row>
+<entry><literal>0</literal></entry>
+<entry><literal>8</literal></entry>
+</row>
+
+<row>
+<entry><literal>2</literal></entry>
+<entry><literal>""</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
The pairs are shown in jumbled order because their order is irrelevant.
@@ -14061,6 +14042,7 @@ One advantage of associative arrays is that new pairs can be added
at any time. For example, suppose a tenth element is added to the array
whose value is @w{@code{"number ten"}}. The result is:
+@ifnotdocbook
@example
@r{Index} 10 @r{Value} "number ten"
@r{Index} 3 @r{Value} 30
@@ -14068,6 +14050,51 @@ whose value is @w{@code{"number ten"}}. The result is:
@r{Index} 0 @r{Value} 8
@r{Index} 2 @r{Value} ""
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+<tbody>
+
+<row>
+<entry><literal>10</literal></entry>
+<entry><literal>"number ten"</literal></entry>
+</row>
+
+<row>
+<entry><literal>3</literal></entry>
+<entry><literal>30</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"foo"</literal></entry>
+</row>
+
+<row>
+<entry><literal>0</literal></entry>
+<entry><literal>8</literal></entry>
+</row>
+
+<row>
+<entry><literal>2</literal></entry>
+<entry><literal>""</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
@cindex sparse arrays
@@ -14080,20 +14107,60 @@ have to be positive integers. Any number, or even a string, can be
an index. For example, the following is an array that translates words from
English to French:
+@ifnotdocbook
@example
@r{Index} "dog" @r{Value} "chien"
@r{Index} "cat" @r{Value} "chat"
@r{Index} "one" @r{Value} "un"
@r{Index} 1 @r{Value} "un"
@end example
+@end ifnotdocbook
+
+@docbook
+<informaltable>
+<tgroup cols="2">
+<colspec colname="1" align="center"/>
+<colspec colname="2" align="center"/>
+<thead>
+<row>
+<entry>Index</entry>
+<entry>Value</entry>
+</row>
+</thead>
+<tbody>
+<row>
+<entry><literal>"dog"</literal></entry>
+<entry><literal>"chien"</literal></entry>
+</row>
+
+<row>
+<entry><literal>"cat"</literal></entry>
+<entry><literal>"chat"</literal></entry>
+</row>
+
+<row>
+<entry><literal>"one"</literal></entry>
+<entry><literal>"un"</literal></entry>
+</row>
+
+<row>
+<entry><literal>1</literal></entry>
+<entry><literal>"un"</literal></entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+@end docbook
@noindent
Here we decided to translate the number one in both spelled-out and
numeric form---thus illustrating that a single array can have both
numbers and strings as indices.
-In fact, array subscripts are always strings; this is discussed
+(In fact, array subscripts are always strings; this is discussed
in more detail in
-@ref{Numeric Array Subscripts}.
+@ref{Numeric Array Subscripts}.)
Here, the number @code{1} isn't double-quoted, since @command{awk}
automatically converts it to a string.
@@ -14169,14 +14236,14 @@ To determine whether an element exists in an array at a certain index, use
the following expression:
@example
-@var{ind} in @var{array}
+@var{indx} in @var{array}
@end example
@cindex side effects, array indexing
@noindent
-This expression tests whether the particular index @var{ind} exists,
+This expression tests whether the particular index @var{indx} exists,
without the side effect of creating that element if it is not present.
-The expression has the value one (true) if @code{@var{array}[@var{ind}]}
+The expression has the value one (true) if @code{@var{array}[@var{indx}]}
exists and zero (false) if it does not exist.
For example, this statement tests whether the array @code{frequencies}
contains the index @samp{2}:
@@ -14350,14 +14417,56 @@ for a more detailed example of this type.
@cindex @code{in} operator, order of array access
The order in which elements of the array are accessed by this statement
is determined by the internal arrangement of the array elements within
-@command{awk} and normally cannot be controlled or changed. This can lead to
-problems if new elements are added to @var{array} by statements in
-the loop body; it is not predictable whether the @code{for} loop will
-reach them. Similarly, changing @var{var} inside the loop may produce
-strange results. It is best to avoid such things.
+@command{awk} and in standard @command{awk} cannot be controlled
+or changed. This can lead to problems if new elements are added to
+@var{array} by statements in the loop body; it is not predictable whether
+the @code{for} loop will reach them. Similarly, changing @var{var} inside
+the loop may produce strange results. It is best to avoid such things.
+
+As a point of information, @command{gawk} sets up the list of elements
+to be iterated over before the loop starts, and does not change it.
+But not all @command{awk} versions do so. Consider this program, named
+@file{loopcheck.awk}:
+
+@example
+BEGIN @{
+ a["here"] = "here"
+ a["is"] = "is"
+ a["a"] = "a"
+ a["loop"] = "loop"
+ for (i in a) @{
+ j++
+ a[j] = j
+ print i
+ @}
+@}
+@end example
+
+Here is what happens when run with @command{gawk}:
+
+@example
+$ @kbd{gawk -f loopcheck.awk}
+@print{} here
+@print{} loop
+@print{} a
+@print{} is
+@end example
+
+Contrast this to Brian Kernighan's @command{awk}:
+
+@example
+$ @kbd{nawk -f loopcheck.awk}
+@print{} loop
+@print{} here
+@print{} is
+@print{} a
+@print{} 1
+@end example
@node Controlling Scanning
-@subsection Using Predefined Array Scanning Orders
+@subsection Using Predefined Array Scanning Orders With @command{gawk}
+
+This @value{SUBSECTION} describes a feature that is specific to @command{gawk}.
By default, when a @code{for} loop traverses an array, the order
is undefined, meaning that the @command{awk} implementation
@@ -14711,7 +14820,7 @@ $ @kbd{echo 'line 1}
@print{} line 2
@end example
-Unfortunately, the very first line of input data did not come out in the
+Unfortunately, the very first line of input data did not appear in the
output!
Upon first glance, we would think that this program should have worked.
@@ -14909,7 +15018,7 @@ separate indices is recovered.
array access and provides true arrays of
arrays. Elements of a subarray are referred to by their own indices
enclosed in square brackets, just like the elements of the main array.
-For example, the following creates a two-element subarray at index @samp{1}
+For example, the following creates a two-element subarray at index @code{1}
of the main array @code{a}:
@example
@@ -14933,7 +15042,7 @@ Each subarray and the main array can be of different length. In fact, the
elements of an array or its subarray do not all have to have the same
type. This means that the main array and any of its subarrays can be
non-rectangular, or jagged in structure. One can assign a scalar value to
-the index @samp{4} of the main array @code{a}:
+the index @code{4} of the main array @code{a}:
@example
a[4] = "An element in a jagged array"
@@ -14954,7 +15063,7 @@ a[4][5][6][7] = "An element in a four-dimensional array"
@end example
@noindent
-This removes the scalar value from index @samp{4} and then inserts a
+This removes the scalar value from index @code{4} and then inserts a
subarray of subarray of subarray containing a scalar. You can also
delete an entire subarray or subarray of subarrays:
@@ -37087,7 +37196,7 @@ of the following, very basic set of steps,
as shown in @ref{figure-process-flow}:
@end ifnotdocbook
@ifdocbook
-as shown in @inlineraw{docbook <xref linkend="figure-process-flow"/>}:
+as shown in @inlineraw{docbook, <xref linkend="figure-process-flow"/>}:
@end ifdocbook
@ifnotdocbook
@@ -39433,4 +39542,5 @@ which sorta sucks.
TODO:
-----
-2. Add back in docbook fixes for @r{}.
+3. Check all docbook figures, if they should include with a
+specific extension or not.