aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.info')
-rw-r--r--doc/gawk.info3489
1 files changed, 2328 insertions, 1161 deletions
diff --git a/doc/gawk.info b/doc/gawk.info
index 188f22ca..2988fe4a 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -196,7 +196,13 @@ in (a) below. A copy of the license is included in the section entitled
field.
* Field Splitting Summary:: Some final points and a summary table.
* Constant Size:: Reading constant width data.
+* Fixed width data:: Processing fixed-width data.
+* Skipping intervening:: Skipping intervening fields.
+* Allowing trailing data:: Capturing optional trailing data.
+* Fields with fixed data:: Field values with fixed-width data.
* Splitting By Content:: Defining Fields By Content
+* Testing field creation:: Checking how 'gawk' is
+ splitting records.
* Multiple Line:: Reading multiline records.
* Getline:: Reading files under explicit program
control using the 'getline'
@@ -217,6 +223,7 @@ in (a) below. A copy of the license is included in the section entitled
'getline'.
* Getline Summary:: Summary of 'getline' Variants.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -246,6 +253,7 @@ in (a) below. A copy of the license is included in the section entitled
* Special Caveats:: Things to watch out for.
* Close Files And Pipes:: Closing Input and Output Files and
Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
* Values:: Constants, Variables, and Regular
@@ -255,6 +263,9 @@ in (a) below. A copy of the license is included in the section entitled
* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.
* Using Constant Regexps:: When and how to use a regexp constant.
+* Standard Regexp Constants:: Regexp constants in standard
+ 'awk'.
+* Strong Regexp Constants:: Strongly typed regexp constants.
* Variables:: Variables give names to values for
later use.
* Using Variables:: Using variables in your programs.
@@ -525,6 +536,7 @@ in (a) below. A copy of the license is included in the section entitled
* Setting the rounding mode:: How to set the rounding mode.
* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic
with 'gawk'.
+* Checking for MPFR:: How to check if MPFR is available.
* POSIX Floating Point Problems:: Standards Versus Existing Practice.
* Floating point summary:: Summary of floating point discussion.
* Extension Intro:: What is an extension.
@@ -557,11 +569,14 @@ in (a) below. A copy of the license is included in the section entitled
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
'gawk''s invocation.
* Extension API Boilerplate:: Boilerplate code for using the API.
+* Changes from API V1:: Changes from V1 of the API.
* Finding Extensions:: How 'gawk' finds compiled
extensions.
* Extension Example:: Example C code for an extension.
@@ -615,14 +630,16 @@ in (a) below. A copy of the license is included in the section entitled
* Unix Installation:: Installing 'gawk' under
various versions of Unix.
* Quick Installation:: Compiling 'gawk' under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling 'gawk' on
- Microsoft Windows.
+* PC Installation:: Installing and Compiling
+ 'gawk' on Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling 'gawk' for Windows32.
+* PC Compiling:: Compiling 'gawk' for
+ Windows32.
* PC Using:: Running 'gawk' on Windows32.
* Cygwin:: Building and running 'gawk'
for Cygwin.
@@ -1849,11 +1866,45 @@ that it is worth addressing.
The "shells" on Microsoft Windows systems use the double-quote
character for quoting, and make it difficult or impossible to include an
escaped double-quote character in a command-line script. The following
-example, courtesy of Jeroen Brink, shows how to print all lines in a
-file surrounded by double quotes:
+example, courtesy of Jeroen Brink, shows how to escape the double quotes
+from this one liner script that prints all lines in a file surrounded by
+double quotes:
+
+ { print "\"" $0 "\"" }
+
+In an MS-Windows command-line the one-liner script above may be passed
+as follows:
gawk "{ print \"\042\" $0 \"\042\" }" FILE
+ In this example the '\042' is the octal code for a double-quote;
+'gawk' converts it into a real double-quote for output by the 'print'
+statement.
+
+ In MS-Windows escaping double-quotes is a little tricky because you
+use backslashes to escape double-quotes, but backslashes themselves are
+not escaped in the usual way; indeed they are either duplicated or not,
+depending upon whether there is a subsequent double-quote. The
+MS-Windows rule for double-quoting a string is the following:
+
+ 1. For each double quote in the orginal string, let N be the number of
+ backslash(es) before it, N might be zero. Replace these N
+ backslash(es) by 2*N+1 backslash(es)
+
+ 2. Let N be the number of backslash(es) tailing the original string, N
+ might be zero. Replace these N backslash(es) by 2*N backslash(es)
+
+ 3. Surround the resulting string by double-quotes.
+
+ So to double-quote the one-liner script '{ print "\"" $0 "\"" }' from
+the previous example you would do it this way:
+
+ gawk "{ print \"\\\"\" $0 \"\\\"\" }" FILE
+
+However, the use of '\042' instead of '\\\"' is also possible and easier
+to read, because backslashes that are not followed by a double-quote
+don't need duplication.
+

File: gawk.info, Node: Sample Data Files, Next: Very Simple, Prev: Running gawk, Up: Getting Started
@@ -2513,6 +2564,20 @@ The following list describes options mandated by the POSIX standard:
have library functions that you want to use from your command-line
programs (*note AWKPATH Variable::).
+ Note that 'gawk' treats each string as if it ended with a newline
+ character (even if it doesn't). This makes building the total
+ program easier.
+
+ CAUTION: At the moment, there is no requirement that each
+ PROGRAM-TEXT be a full syntactic unit. I.e., the following
+ currently works:
+
+ $ gawk -e 'BEGIN { a = 5 ;' -e 'print a }'
+ -| 5
+
+ However, this could change in the future, so it's not a good
+ idea to rely upon this feature.
+
'-E' FILE
'--exec' FILE
Similar to '-f', read 'awk' program text from FILE. There are two
@@ -2613,30 +2678,33 @@ The following list describes options mandated by the POSIX standard:
'-o'[FILE]
'--pretty-print'['='FILE]
- Enable pretty-printing of 'awk' programs. By default, the output
- program is created in a file named 'awkprof.out' (*note
- Profiling::). The optional FILE argument allows you to specify a
- different file name for the output. No space is allowed between
- the '-o' and FILE, if FILE is supplied.
+ Enable pretty-printing of 'awk' programs. Implies '--no-optimize'.
+ By default, the output program is created in a file named
+ 'awkprof.out' (*note Profiling::). The optional FILE argument
+ allows you to specify a different file name for the output. No
+ space is allowed between the '-o' and FILE, if FILE is supplied.
- NOTE: Due to the way 'gawk' has evolved, with this option your
- program still executes. This will change in the next major
- release, such that 'gawk' will only pretty-print the program
- and not run it.
+ NOTE: In the past, this option would also execute your
+ program. This is no longer the case.
'-O'
'--optimize'
- Enable some optimizations on the internal representation of the
- program. At the moment, this includes just simple constant
- folding.
+ Enable 'gawk''s default optimizations on the internal
+ representation of the program. At the moment, this includes simple
+ constant folding and tail recursion elimination in function calls.
+
+ These optimizations are enabled by default. This option remains
+ primarily for backwards compatibility. However, it may be used to
+ cancel the effect of an earlier '-s' option (see later in this
+ list).
'-p'[FILE]
'--profile'['='FILE]
- Enable profiling of 'awk' programs (*note Profiling::). By
- default, profiles are created in a file named 'awkprof.out'. The
- optional FILE argument allows you to specify a different file name
- for the profile file. No space is allowed between the '-p' and
- FILE, if FILE is supplied.
+ Enable profiling of 'awk' programs (*note Profiling::). Implies
+ '--no-optimize'. By default, profiles are created in a file named
+ 'awkprof.out'. The optional FILE argument allows you to specify a
+ different file name for the profile file. No space is allowed
+ between the '-p' and FILE, if FILE is supplied.
The profile contains execution counts for each statement in the
program in the left margin, and function call counts for each
@@ -2650,9 +2718,6 @@ The following list describes options mandated by the POSIX standard:
in 'gawk' that are disabled by this option. Also, the following
additional restrictions apply:
- * Newlines do not act as whitespace to separate fields when 'FS'
- is equal to a single space (*note Fields::).
-
* Newlines are not allowed after '?' or ':' (*note Conditional
Exp::).
@@ -2673,6 +2738,11 @@ The following list describes options mandated by the POSIX standard:
remains (both for backward compatibility and for use in combination
with '--traditional').
+'-s'
+'--no-optimize'
+ Disable 'gawk''s default optimizations on the internal
+ representation of the program.
+
'-S'
'--sandbox'
Disable the 'system()' function, input redirections with 'getline',
@@ -2921,6 +2991,9 @@ Since '.' is included at the beginning, 'gawk' searches first in the
current directory and then in '/usr/local/share/awk'. In practice, this
means that you will rarely need to change the value of 'AWKPATH'.
+ *Note Shell Startup Files::, for information on functions that help
+to manipulate the 'AWKPATH' variable.
+
'gawk' places the value of the search path that it used into
'ENVIRON["AWKPATH"]'. This provides access to the actual search path
value from within an 'awk' program.
@@ -2960,6 +3033,9 @@ empty value, 'gawk' uses a default path; this is typically
'/usr/local/lib/gawk', although it can vary depending upon how 'gawk'
was built.
+ *Note Shell Startup Files::, for information on functions that help
+to manipulate the 'AWKLIBPATH' variable.
+
'gawk' places the value of the search path that it used into
'ENVIRON["AWKLIBPATH"]'. This provides access to the actual search path
value from within an 'awk' program.
@@ -2986,7 +3062,8 @@ used by regular users:
'GAWK_SOCK_RETRIES'
Controls the number of times 'gawk' attempts to retry a two-way
TCP/IP (socket) connection before giving up. *Note TCP/IP
- Networking::.
+ Networking::. Note that when nonfatal I/O is enabled (*note
+ Nonfatal::), 'gawk' only tries to open a TCP/IP socket once.
'POSIXLY_CORRECT'
Causes 'gawk' to switch to POSIX-compatibility mode, disabling all
@@ -3036,13 +3113,6 @@ change. The variables are:
supposed to be differences, but occasionally theory and practice
don't coordinate with each other.)
-'GAWK_NO_PP_RUN'
- When 'gawk' is invoked with the '--pretty-print' option, it will
- not run the program if this environment variable exists.
-
- CAUTION: This variable will not survive into the next major
- release.
-
'GAWK_STACKSIZE'
This specifies the amount by which 'gawk' should grow its internal
evaluation stack, when needed.
@@ -3433,15 +3503,18 @@ sequences apply to both string constants and regexp constants:
'\xHH...'
The hexadecimal value HH, where HH stands for a sequence of
- hexadecimal digits ('0'-'9', and either 'A'-'F' or 'a'-'f'). Like
- the same construct in ISO C, the escape sequence continues until
- the first nonhexadecimal digit is seen. (c.e.) However, using
- more than two hexadecimal digits produces undefined results. (The
- '\x' escape sequence is not allowed in POSIX 'awk'.)
-
- CAUTION: The next major release of 'gawk' will change, such
- that a maximum of two hexadecimal digits following the '\x'
- will be used.
+ hexadecimal digits ('0'-'9', and either 'A'-'F' or 'a'-'f'). A
+ maximum of two digts are allowed after the '\x'. Any further
+ hexadecimal digits are treated as simple letters or numbers.
+ (c.e.) (The '\x' escape sequence is not allowed in POSIX awk.)
+
+ CAUTION: In ISO C, the escape sequence continues until the
+ first nonhexadecimal digit is seen. For many years, 'gawk'
+ would continue incorporating hexadecimal digits into the value
+ until a non-hexadecimal digit or the end of the string was
+ encountered. However, using more than two hexadecimal digits
+ produced undefined results. As of version 4.2, only two
+ digits are processed.
'\/'
A literal slash (necessary for regexp constants only). This
@@ -4162,10 +4235,13 @@ be named on the 'awk' command line (*note Getline::).
* Field Separators:: The field separator and how to change it.
* Constant Size:: Reading constant width data.
* Splitting By Content:: Defining Fields By Content
+* Testing field creation:: Checking how 'gawk' is splitting
+ records.
* Multiple Line:: Reading multiline records.
* Getline:: Reading files under explicit program control
using the 'getline' function.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -4427,7 +4503,7 @@ When 'awk' reads an input record, the record is automatically "parsed"
or separated by the 'awk' utility into chunks called "fields". By
default, fields are separated by "whitespace", like words in a line.
Whitespace in 'awk' means any string of one or more spaces, TABs, or
-newlines;(1) other characters that are considered whitespace by other
+newlines; other characters that are considered whitespace by other
languages (such as formfeed, vertical tab, etc.) are _not_ considered
whitespace by 'awk'.
@@ -4479,11 +4555,6 @@ record:
-| Julie F
-| Samuel A
- ---------- Footnotes ----------
-
- (1) In POSIX 'awk', newlines are not considered whitespace for
-separating fields.
-

File: gawk.info, Node: Nonconstant Fields, Next: Changing Fields, Prev: Fields, Up: Reading Files
@@ -5062,10 +5133,25 @@ This minor node discusses an advanced feature of 'gawk'. If you are a
novice 'awk' user, you might want to skip it on the first reading.
'gawk' provides a facility for dealing with fixed-width fields with
-no distinctive field separator. For example, data of this nature arises
-in the input for old Fortran programs where numbers are run together, or
-in the output of programs that did not anticipate the use of their
-output as input for other programs.
+no distinctive field separator. We discuss this feature in the
+following nodes.
+
+* Menu:
+
+* Fixed width data:: Processing fixed-width data.
+* Skipping intervening:: Skipping intervening fields.
+* Allowing trailing data:: Capturing optional trailing data.
+* Fields with fixed data:: Field values with fixed-width data.
+
+
+File: gawk.info, Node: Fixed width data, Next: Skipping intervening, Up: Constant Size
+
+4.6.1 Processing Fixed-Width Data
+---------------------------------
+
+An example of fixed-width data would be the input for old Fortran
+programs where numbers are run together, or the output of programs that
+did not anticipate the use of their output as input for other programs.
An example of the latter is a table where all the columns are lined
up by the use of a variable number of spaces and _empty fields are just
@@ -5080,8 +5166,10 @@ variable 'FIELDWIDTHS'. Each number specifies the width of the field,
_including_ columns between fields. If you want to ignore the columns
between fields, you can specify the width as a separate field that is
subsequently ignored. It is a fatal error to supply a field width that
-has a negative value. The following data is the output of the Unix 'w'
-utility. It is useful to illustrate the use of 'FIELDWIDTHS':
+has a negative value.
+
+ The following data is the output of the Unix 'w' utility. It is
+useful to illustrate the use of 'FIELDWIDTHS':
10:06pm up 21 days, 14:04, 23 users
User tty login idle JCPU PCPU what
@@ -5104,7 +5192,7 @@ calculated idle time:
sub(/^ +/, "", idle) # strip leading spaces
if (idle == "")
idle = 0
- if (idle ~ /:/) {
+ if (idle ~ /:/) { # hh:mm
split(idle, t, ":")
idle = t[1] * 60 + t[2]
}
@@ -5138,27 +5226,92 @@ An 'awk' program for processing such data could use the 'FIELDWIDTHS'
feature to simplify reading the data. (Of course, getting 'gawk' to run
on a system with card readers is another story!)
- Assigning a value to 'FS' causes 'gawk' to use 'FS' for field
-splitting again. Use 'FS = FS' to make this happen, without having to
-know the current value of 'FS'. In order to tell which kind of field
-splitting is in effect, use 'PROCINFO["FS"]' (*note Auto-set::). The
-value is '"FS"' if regular field splitting is being used, or
-'"FIELDWIDTHS"' if fixed-width field splitting is being used:
+
+File: gawk.info, Node: Skipping intervening, Next: Allowing trailing data, Prev: Fixed width data, Up: Constant Size
- if (PROCINFO["FS"] == "FS")
- REGULAR FIELD SPLITTING ...
- else if (PROCINFO["FS"] == "FIELDWIDTHS")
- FIXED-WIDTH FIELD SPLITTING ...
- else
- CONTENT-BASED FIELD SPLITTING ... (see next minor node)
+4.6.2 Skipping Intervening Fields
+---------------------------------
- This information is useful when writing a function that needs to
-temporarily change 'FS' or 'FIELDWIDTHS', read some records, and then
-restore the original settings (*note Passwd Functions:: for an example
-of such a function).
+Starting in version 4.2, each field width may optionally be preceded by
+a colon-separated value specifying the number of characters to skip
+before the field starts. Thus, the preceding program could be rewritten
+to specify 'FIELDWIDTHS' like so:
+
+ BEGIN { FIELDWIDTHS = "8 1:5 4:7 6 1:6 1:6 2:33" }
+
+ This strips away some of the white space separating the fields. With
+such a change, the program produces the following results:
+
+ hzang ttyV3 50
+ eklye ttyV5 0
+ dportein ttyV6 107
+ gierd ttyD3 1
+ dave ttyD4 0
+ brent ttyp0 286
+ dave ttyq4 1296000

-File: gawk.info, Node: Splitting By Content, Next: Multiple Line, Prev: Constant Size, Up: Reading Files
+File: gawk.info, Node: Allowing trailing data, Next: Fields with fixed data, Prev: Skipping intervening, Up: Constant Size
+
+4.6.3 Capturing Optional Trailing Data
+--------------------------------------
+
+There are times when fixed-width data may be followed by additional data
+that has no fixed length. Such data may or may not be present, but if
+it is, it should be possible to get at it from an 'awk' program.
+
+ Starting with version 4.2, in order to provide a way to say "anything
+else in the record after the defined fields," 'gawk' allows you to add a
+final '*' character to the value of 'FIELDWIDTHS'. There can only be
+one such character, and it must be the final non-whitespace character in
+'FIELDWIDTHS'. For example:
+
+ $ cat fw.awk Show the program
+ -| BEGIN { FIELDWIDTHS = "2 2 *" }
+ -| { print NF, $1, $2, $3 }
+ $ cat fw.in Show sample input
+ -| 1234abcdefghi
+ $ gawk -f fw.awk fw.in Run the program
+ -| 3 12 34 abcdefghi
+
+
+File: gawk.info, Node: Fields with fixed data, Prev: Allowing trailing data, Up: Constant Size
+
+4.6.4 Field Values With Fixed-Width Data
+----------------------------------------
+
+So far, so good. But what happens if there isn't as much data as there
+should be based on the contents of 'FIELDWIDTHS'? Or, what happens if
+there is more data than expected?
+
+ For many years, what happens in these cases was not well defined.
+Starting with version 4.2, the rules are as follows:
+
+Enough data for some fields
+ For example, if 'FIELDWIDTHS' is set to '"2 3 4"' and the input
+ record is 'aabbb'. In this case, 'NF' is set to two.
+
+Not enough data for a field
+ For example, if 'FIELDWIDTHS' is set to '"2 3 4"' and the input
+ record is 'aab'. In this case, 'NF' is set to two and '$2' has the
+ value '"b"'. The idea is that even though there aren't as many
+ characters as were expected, there are some, so the data should be
+ made available to the program.
+
+Too much data
+ For example, if 'FIELDWIDTHS' is set to '"2 3 4"' and the input
+ record is 'aabbbccccddd'. In this case, 'NF' is set to three and
+ the extra characters ('ddd') are ignored. If you want 'gawk' to
+ capture the extra characters, supply a final '*' in the value of
+ 'FIELDWIDTHS'.
+
+Too much data, but with '*' supplied
+ For example, if 'FIELDWIDTHS' is set to '"2 3 4 *"' and the input
+ record is 'aabbbccccddd'. In this case, 'NF' is set to four, and
+ '$4' has the value '"ddd"'.
+
+
+File: gawk.info, Node: Splitting By Content, Next: Testing field creation, Prev: Constant Size, Up: Reading Files
4.7 Defining Fields by Content
==============================
@@ -5234,9 +5387,7 @@ would be to remove the quotes when they occur, with something like this:
affects field splitting with 'FPAT'.
Assigning a value to 'FPAT' overrides field splitting with 'FS' and
-with 'FIELDWIDTHS'. Similar to 'FIELDWIDTHS', the value of
-'PROCINFO["FS"]' will be '"FPAT"' if content-based field splitting is
-being used.
+with 'FIELDWIDTHS'.
NOTE: Some programs export CSV data that contains embedded newlines
between the double quotes. 'gawk' provides no way to deal with
@@ -5254,10 +5405,6 @@ contain at least one character. A straightforward modification
Finally, the 'patsplit()' function makes the same functionality
available for splitting regular strings (*note String Functions::).
- To recap, 'gawk' provides three independent methods to split input
-records into fields. The mechanism used is based on which of the three
-variables--'FS', 'FIELDWIDTHS', or 'FPAT'--was last assigned to.
-
---------- Footnotes ----------
(1) The CSV format lacked a formal standard definition for many
@@ -5265,9 +5412,46 @@ years. RFC 4180 (http://www.ietf.org/rfc/rfc4180.txt) standardizes the
most common practices.

-File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Splitting By Content, Up: Reading Files
+File: gawk.info, Node: Testing field creation, Next: Multiple Line, Prev: Splitting By Content, Up: Reading Files
-4.8 Multiple-Line Records
+4.8 Checking How 'gawk' Is Splitting Records
+============================================
+
+As we've seen, 'gawk' provides three independent methods to split input
+records into fields. The mechanism used is based on which of the three
+variables--'FS', 'FIELDWIDTHS', or 'FPAT'--was last assigned to. In
+addition, an API input parser may choose to override the record parsing
+mechanism; please refer to *note Input Parsers:: for further information
+about this feature.
+
+ To restore normal field splitting after using 'FIELDWIDTHS' and/or
+'FPAT', simply assign a value to 'FS'. You can use 'FS = FS' to do
+this, without having to know the current value of 'FS'.
+
+ In order to tell which kind of field splitting is in effect, use
+'PROCINFO["FS"]' (*note Auto-set::). The value is '"FS"' if regular
+field splitting is being used, '"FIELDWIDTHS"' if fixed-width field
+splitting is being used, or '"FPAT"' if content-based field splitting is
+being used:
+
+ if (PROCINFO["FS"] == "FS")
+ REGULAR FIELD SPLITTING ...
+ else if (PROCINFO["FS"] == "FIELDWIDTHS")
+ FIXED-WIDTH FIELD SPLITTING ...
+ else if (PROCINFO["FS"] == "FPAT")
+ CONTENT-BASED FIELD SPLITTING
+ else
+ API INPUT PARSER FIELD SPLITTING ... (advanced feature)
+
+ This information is useful when writing a function that needs to
+temporarily change 'FS' or 'FIELDWIDTHS', read some records, and then
+restore the original settings (*note Passwd Functions:: for an example
+of such a function).
+
+
+File: gawk.info, Node: Multiple Line, Next: Getline, Prev: Testing field creation, Up: Reading Files
+
+4.9 Multiple-Line Records
=========================
In some databases, a single line cannot conveniently hold all the
@@ -5407,8 +5591,8 @@ separator of a single space: 'FS = " "'.

File: gawk.info, Node: Getline, Next: Read Timeout, Prev: Multiple Line, Up: Reading Files
-4.9 Explicit Input with 'getline'
-=================================
+4.10 Explicit Input with 'getline'
+==================================
So far we have been getting our input data from 'awk''s main input
stream--either the standard input (usually your keyboard, sometimes the
@@ -5429,6 +5613,11 @@ record, such as a file that cannot be opened, then 'getline' returns -1.
In this case, 'gawk' sets the variable 'ERRNO' to a string describing
the error that occurred.
+ If 'ERRNO' indicates that the I/O operation may be retried, and
+'PROCINFO["INPUT", "RETRY"]' is set, then 'getline' returns -2 instead
+of -1, and further calls to 'getline' may be attempted. *Note Retrying
+Input:: for further information about this feature.
+
In the following examples, COMMAND stands for a string value that
represents a shell command.
@@ -5454,8 +5643,8 @@ represents a shell command.

File: gawk.info, Node: Plain Getline, Next: Getline/Variable, Up: Getline
-4.9.1 Using 'getline' with No Arguments
----------------------------------------
+4.10.1 Using 'getline' with No Arguments
+----------------------------------------
The 'getline' command can be used without arguments to read input from
the current input file. All it does in this case is read the next input
@@ -5515,8 +5704,8 @@ the value of '$0'.

File: gawk.info, Node: Getline/Variable, Next: Getline/File, Prev: Plain Getline, Up: Getline
-4.9.2 Using 'getline' into a Variable
--------------------------------------
+4.10.2 Using 'getline' into a Variable
+--------------------------------------
You can use 'getline VAR' to read the next record from 'awk''s input
into the variable VAR. No other processing is done. For example,
@@ -5556,8 +5745,8 @@ fields, so the values of the fields (including '$0') and the value of

File: gawk.info, Node: Getline/File, Next: Getline/Variable/File, Prev: Getline/Variable, Up: Getline
-4.9.3 Using 'getline' from a File
----------------------------------
+4.10.3 Using 'getline' from a File
+----------------------------------
Use 'getline < FILE' to read the next record from FILE. Here, FILE is a
string-valued expression that specifies the file name. '< FILE' is
@@ -5589,8 +5778,8 @@ portable to all 'awk' implementations.

File: gawk.info, Node: Getline/Variable/File, Next: Getline/Pipe, Prev: Getline/File, Up: Getline
-4.9.4 Using 'getline' into a Variable from a File
--------------------------------------------------
+4.10.4 Using 'getline' into a Variable from a File
+--------------------------------------------------
Use 'getline VAR < FILE' to read input from the file FILE, and put it in
the variable VAR. As earlier, FILE is a string-valued expression that
@@ -5633,8 +5822,8 @@ regular expression.

File: gawk.info, Node: Getline/Pipe, Next: Getline/Variable/Pipe, Prev: Getline/Variable/File, Up: Getline
-4.9.5 Using 'getline' from a Pipe
----------------------------------
+4.10.5 Using 'getline' from a Pipe
+----------------------------------
Omniscience has much to recommend it. Failing that, attention to
details would be useful.
@@ -5703,8 +5892,8 @@ you want your program to be portable to all 'awk' implementations.

File: gawk.info, Node: Getline/Variable/Pipe, Next: Getline/Coprocess, Prev: Getline/Pipe, Up: Getline
-4.9.6 Using 'getline' into a Variable from a Pipe
--------------------------------------------------
+4.10.6 Using 'getline' into a Variable from a Pipe
+--------------------------------------------------
When you use 'COMMAND | getline VAR', the output of COMMAND is sent
through a pipe to 'getline' and into the variable VAR. For example, the
@@ -5730,8 +5919,8 @@ to other 'awk' implementations.

File: gawk.info, Node: Getline/Coprocess, Next: Getline/Variable/Coprocess, Prev: Getline/Variable/Pipe, Up: Getline
-4.9.7 Using 'getline' from a Coprocess
---------------------------------------
+4.10.7 Using 'getline' from a Coprocess
+---------------------------------------
Reading input into 'getline' from a pipe is a one-way operation. The
command that is started with 'COMMAND | getline' only sends data _to_
@@ -5760,8 +5949,8 @@ coprocesses are discussed in more detail.

File: gawk.info, Node: Getline/Variable/Coprocess, Next: Getline Notes, Prev: Getline/Coprocess, Up: Getline
-4.9.8 Using 'getline' into a Variable from a Coprocess
-------------------------------------------------------
+4.10.8 Using 'getline' into a Variable from a Coprocess
+-------------------------------------------------------
When you use 'COMMAND |& getline VAR', the output from the coprocess
COMMAND is sent through a two-way pipe to 'getline' and into the
@@ -5778,8 +5967,8 @@ coprocesses are discussed in more detail.

File: gawk.info, Node: Getline Notes, Next: Getline Summary, Prev: Getline/Variable/Coprocess, Up: Getline
-4.9.9 Points to Remember About 'getline'
-----------------------------------------
+4.10.9 Points to Remember About 'getline'
+-----------------------------------------
Here are some miscellaneous points about 'getline' that you should bear
in mind:
@@ -5838,8 +6027,8 @@ in mind:

File: gawk.info, Node: Getline Summary, Prev: Getline Notes, Up: Getline
-4.9.10 Summary of 'getline' Variants
-------------------------------------
+4.10.10 Summary of 'getline' Variants
+-------------------------------------
*note Table 4.1: table-getline-variants. summarizes the eight variants
of 'getline', listing which predefined variables are set by each one,
@@ -5864,9 +6053,9 @@ VAR
Table 4.1: 'getline' variants and what they set

-File: gawk.info, Node: Read Timeout, Next: Command-line directories, Prev: Getline, Up: Reading Files
+File: gawk.info, Node: Read Timeout, Next: Retrying Input, Prev: Getline, Up: Reading Files
-4.10 Reading Input with a Timeout
+4.11 Reading Input with a Timeout
=================================
This minor node describes a feature that is specific to 'gawk'.
@@ -5943,7 +6132,8 @@ per-command or per-connection basis.
'gawk' considers a timeout event to be an error even though the
attempt to read from the underlying device may succeed in a later
attempt. This is a limitation, and it also means that you cannot use
-this to multiplex input from two or more sources.
+this to multiplex input from two or more sources. *Note Retrying
+Input:: for a way to enable later I/O attempts to succeed.
Assigning a timeout value prevents read operations from blocking
indefinitely. But bear in mind that there are other ways 'gawk' can
@@ -5957,9 +6147,36 @@ can block indefinitely until some other process opens it for writing.
(1) This assumes that standard input is the keyboard.

-File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Read Timeout, Up: Reading Files
+File: gawk.info, Node: Retrying Input, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files
+
+4.12 Retrying Reads After Certain Input Errors
+==============================================
+
+This minor node describes a feature that is specific to 'gawk'.
+
+ When 'gawk' encounters an error while reading input, by default
+'getline' returns -1, and subsequent attempts to read from that file
+result in an end-of-file indication. However, you may optionally
+instruct 'gawk' to allow I/O to be retried when certain errors are
+encountered by setting a special element in the 'PROCINFO' array (*note
+Auto-set::):
+
+ PROCINFO["INPUT_NAME", "RETRY"] = 1
+
+ When this element exists, 'gawk' checks the value of the system (C
+language) 'errno' variable when an I/O error occurs. If 'errno'
+indicates a subsequent I/O attempt may succeed, 'getline' instead
+returns -2 and further calls to 'getline' may succeed. This applies to
+the 'errno' values 'EAGAIN', 'EWOULDBLOCK', 'EINTR', or 'ETIMEDOUT'.
+
+ This feature is useful in conjunction with 'PROCINFO["INPUT_NAME",
+"READ_TIMEOUT"]' or situations where a file descriptor has been
+configured to behave in a non-blocking fashion.
+
+
+File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Retrying Input, Up: Reading Files
-4.11 Directories on the Command Line
+4.13 Directories on the Command Line
====================================
According to the POSIX standard, files named on the 'awk' command line
@@ -5982,7 +6199,7 @@ usable data from an 'awk' program.

File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-line directories, Up: Reading Files
-4.12 Summary
+4.14 Summary
============
* Input is split into records based on the value of 'RS'. The
@@ -6054,7 +6271,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li

File: gawk.info, Node: Input Exercises, Prev: Input Summary, Up: Reading Files
-4.13 Exercises
+4.15 Exercises
==============
1. Using the 'FIELDWIDTHS' variable (*note Constant Size::), write a
@@ -6104,6 +6321,7 @@ function.
'gawk' allows access to inherited file
descriptors.
* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
@@ -7011,7 +7229,7 @@ that 'gawk' provides:
behavior.

-File: gawk.info, Node: Close Files And Pipes, Next: Output Summary, Prev: Special Files, Up: Printing
+File: gawk.info, Node: Close Files And Pipes, Next: Nonfatal, Prev: Special Files, Up: Printing
5.9 Closing Input and Output Redirections
=========================================
@@ -7156,11 +7374,23 @@ there is a system problem closing the file or process. In these cases,
'gawk' sets the predefined variable 'ERRNO' to a string describing the
problem.
- In 'gawk', when closing a pipe or coprocess (input or output), the
-return value is the exit status of the command.(2) Otherwise, it is the
-return value from the system's 'close()' or 'fclose()' C functions when
-closing input or output files, respectively. This value is zero if the
-close succeeds, or -1 if it fails.
+ In 'gawk', starting with version 4.2, when closing a pipe or
+coprocess (input or output), the return value is the exit status of the
+command, as described in *note Table 5.1:
+table-close-pipe-return-values.(2) Otherwise, it is the return value
+from the system's 'close()' or 'fclose()' C functions when closing input
+or output files, respectively. This value is zero if the close
+succeeds, or -1 if it fails.
+
+Situation Return value from 'close()'
+--------------------------------------------------------------------------
+Normal exit of command Command's exit status
+Death by signal of command 256 + number of murderous signal
+Death by signal of command 512 + number of murderous signal
+with core dump
+Some kind of error -1
+
+Table 5.1: Return values from 'close()' of a pipe
The POSIX standard is very vague; it says that 'close()' returns zero
on success and a nonzero value otherwise. In general, different
@@ -7174,14 +7404,73 @@ Options::), 'gawk' just returns zero when closing a pipe.
is called a "zombie," and cleaning up after it is referred to as
"reaping."
- (2) This is a full 16-bit value as returned by the 'wait()' system
-call. See the system manual pages for information on how to decode this
-value.
+ (2) Prior to version 4.2, the return value from closing a pipe or
+co-process was the full 16-bit exit value as defined by the 'wait()'
+system call.

-File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Files And Pipes, Up: Printing
+File: gawk.info, Node: Nonfatal, Next: Output Summary, Prev: Close Files And Pipes, Up: Printing
+
+5.10 Enabling Nonfatal Output
+=============================
+
+This minor node describes a 'gawk'-specific feature.
-5.10 Summary
+ In standard 'awk', output with 'print' or 'printf' to a nonexistent
+file, or some other I/O error (such as filling up the disk) is a fatal
+error.
+
+ $ gawk 'BEGIN { print "hi" > "/no/such/file" }'
+ error-> gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory)
+
+ 'gawk' makes it possible to detect that an error has occurred,
+allowing you to possibly recover from the error, or at least print an
+error message of your choosing before exiting. You can do this in one
+of two ways:
+
+ * For all output files, by assigning any value to
+ 'PROCINFO["NONFATAL"]'.
+
+ * On a per-file basis, by assigning any value to 'PROCINFO[FILENAME,
+ "NONFATAL"]'. Here, FILENAME is the name of the file to which you
+ wish output to be nonfatal.
+
+ Once you have enabled nonfatal output, you must check 'ERRNO' after
+every relevant 'print' or 'printf' statement to see if something went
+wrong. It is also a good idea to initialize 'ERRNO' to zero before
+attempting the output. For example:
+
+ $ gawk '
+ > BEGIN {
+ > PROCINFO["NONFATAL"] = 1
+ > ERRNO = 0
+ > print "hi" > "/no/such/file"
+ > if (ERRNO) {
+ > print("Output failed:", ERRNO) > "/dev/stderr"
+ > exit 1
+ > }
+ > }'
+ error-> Output failed: No such file or directory
+
+ Here, 'gawk' did not produce a fatal error; instead it let the 'awk'
+program code detect the problem and handle it.
+
+ This mechanism works also for standard output and standard error.
+For standard output, you may use 'PROCINFO["-", "NONFATAL"]' or
+'PROCINFO["/dev/stdout", "NONFATAL"]'. For standard error, use
+'PROCINFO["/dev/stderr", "NONFATAL"]'.
+
+ When attempting to open a TCP/IP socket (*note TCP/IP Networking::),
+'gawk' tries multiple times. The 'GAWK_SOCK_RETRIES' environment
+variable (*note Other Environment Variables::) allows you to override
+'gawk''s builtin default number of attempts. However, once nonfatal I/O
+is enabled for a given socket, 'gawk' only retries once, relying on
+'awk'-level code to notice that there was a problem.
+
+
+File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing
+
+5.11 Summary
============
* The 'print' statement prints comma-separated expressions. Each
@@ -7203,10 +7492,15 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi
For coprocesses, it is possible to close only one direction of the
communications.
+ * Normally errors with 'print' or 'printf' are fatal. 'gawk' lets
+ you make output errors be nonfatal either for all files or on a
+ per-file basis. You must then check for errors after every
+ relevant output statement.
+

File: gawk.info, Node: Output Exercises, Prev: Output Summary, Up: Printing
-5.11 Exercises
+5.12 Exercises
==============
1. Rewrite the program:
@@ -7337,9 +7631,9 @@ octal (base 8) and hexadecimal (base 16). In octal, the numbers go 0,
1 times 10 plus 1, so '11' in octal is 1 times 8 plus 1. This equals 9
in decimal. In hexadecimal, there are 16 digits. Because the everyday
decimal number system only has ten digits ('0'-'9'), the letters 'a'
-through 'f' are used to represent the rest. (Case in the letters is
-usually irrelevant; hexadecimal 'a' and 'A' have the same value.) Thus,
-'11' in hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
+through 'f' represent the rest. (Case in the letters is usually
+irrelevant; hexadecimal 'a' and 'A' have the same value.) Thus, '11' in
+hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
Just by looking at plain '11', you can't tell what base it's in. So,
in C, C++, and other languages derived from C, there is a special
@@ -7416,6 +7710,23 @@ File: gawk.info, Node: Using Constant Regexps, Next: Variables, Prev: Constan
6.1.2 Using Regular Expression Constants
----------------------------------------
+Regular expression constants consist of text describing a regular
+expression enclosed in slashes (such as '/the +answer/'). This minor
+node describes how such constants work in POSIX 'awk' and 'gawk', and
+then goes on to describe "strongly typed regexp constants", which are a
+'gawk' extension.
+
+* Menu:
+
+* Standard Regexp Constants:: Regexp constants in standard 'awk'.
+* Strong Regexp Constants:: Strongly typed regexp constants.
+
+
+File: gawk.info, Node: Standard Regexp Constants, Next: Strong Regexp Constants, Up: Using Constant Regexps
+
+6.1.2.1 Standard Regular Expression Constants
+.............................................
+
When used on the righthand side of the '~' or '!~' operators, a regexp
constant merely stands for the regexp that is to be matched. However,
regexp constants (such as '/foo/') may be used like simple expressions.
@@ -7490,6 +7801,73 @@ function, because passing a truth value in this way is probably not what
was intended.

+File: gawk.info, Node: Strong Regexp Constants, Prev: Standard Regexp Constants, Up: Using Constant Regexps
+
+6.1.2.2 Strongly Typed Regexp Constants
+.......................................
+
+This minor node describes a 'gawk'-specific feature.
+
+ As we saw in the previous minor node, regexp constants ('/.../') hold
+a strange position in the 'awk' language. In most contexts, they act
+like an expression: '$0 ~ /.../'. In other contexts, they denote only a
+regexp to be matched. In no case are they really a "first class
+citizen" of the language. That is, you cannot define a scalar variable
+whose type is "regexp" in the same sense that you can define a variable
+to be a number or a string:
+
+ num = 42 Numeric variable
+ str = "hi" String variable
+ re = /foo/ Wrong! re is the result of $0 ~ /foo/
+
+ For a number of more advanced use cases, it would be nice to have
+regexp constants that are "strongly typed"; in other words, that denote
+a regexp useful for matching, and not an expression.
+
+ 'gawk' provides this feature. A strongly typed regexp constant looks
+almost like a regular regexp constant, except that it is preceded by an
+'@' sign:
+
+ re = @/foo/ Regexp variable
+
+ Strongly typed regexp constants _cannot_ be used everywhere that a
+regular regexp constant can, because this would make the language even
+more confusing. Instead, you may use them only in certain contexts:
+
+ * On the righthand side of the '~' and '!~' operators: 'some_var ~
+ @/foo/' (*note Regexp Usage::).
+
+ * In the 'case' part of a 'switch' statement (*note Switch
+ Statement::).
+
+ * As an argument to one of the built-in functions that accept regexp
+ constants: 'gensub()', 'gsub()', 'match()', 'patsplit()',
+ 'split()', and 'sub()' (*note String Functions::).
+
+ * As a parameter in a call to a user-defined function (*note
+ User-defined::).
+
+ * On the righthand side of an assignment to a variable: 'some_var =
+ @/foo/'. In this case, the type of 'some_var' is regexp.
+ Additionally, 'some_var' can be used with '~' and '!~', passed to
+ one of the built-in functions listed above, or passed as a
+ parameter to a user-defined function.
+
+ You may use the 'typeof()' built-in function (*note Type Functions::)
+to determine if a variable or function parameter is a regexp variable.
+
+ The true power of this feature comes from the ability to create
+variables that have regexp type. Such variables can be passed on to
+user-defined functions, without the confusing aspects of computed
+regular expressions created from strings or string constants. They may
+also be passed through indirect function calls (*note Indirect Calls::)
+and on to the built-in functions that accept regexp constants.
+
+ When used in numeric conversions, strongly typed regexp variables
+convert to zero. When used in string conversions, they convert to the
+string value of the original regexp text.
+
+
File: gawk.info, Node: Variables, Next: Conversion, Prev: Using Constant Regexps, Up: Values
6.1.3 Variables
@@ -8265,11 +8643,74 @@ File: gawk.info, Node: Variable Typing, Next: Comparison Operators, Up: Typin
6.3.2.1 String Type versus Numeric Type
.......................................
-The POSIX standard introduced the concept of a "numeric string", which
-is simply a string that looks like a number--for example, '" +2"'. This
-concept is used for determining the type of a variable. The type of the
-variable is important because the types of two variables determine how
-they are compared. Variable typing follows these rules:
+Scalar objects in 'awk' (variables, array elements, and fields) are
+_dynamically_ typed. This means their type can change as the program
+runs, from "untyped" before any use,(1) to string or number, and then
+from string to number or number to string, as the program progresses.
+('gawk' also provides regexp-typed scalars, but let's ignore that for
+now; *note Strong Regexp Constants::.)
+
+ You can't do much with untyped variables, other than tell that they
+are untyped. The following program tests 'a' against '""' and '0'; the
+test succeeds when 'a' has never been assigned a value. It also uses
+the built-in 'typeof()' function (not presented yet; *note Type
+Functions::) to show 'a''s type:
+
+ $ gawk 'BEGIN { print (a == "" && a == 0 ?
+ > "a is untyped" : "a has a type!") ; print typeof(a) }'
+ -| a is untyped
+ -| unassigned
+
+ A scalar has numeric type when assigned a numeric value, such as from
+a numeric constant, or from another scalar with numeric type:
+
+ $ gawk 'BEGIN { a = 42 ; print typeof(a)
+ > b = a ; print typeof(b) }'
+ number
+ number
+
+ Similarly, a scalar has string type when assigned a string value,
+such as from a string constant, or from another scalar with string type:
+
+ $ gawk 'BEGIN { a = "forty two" ; print typeof(a)
+ > b = a ; print typeof(b) }'
+ string
+ string
+
+ So far, this is all simple and straightforward. What happens,
+though, when 'awk' has to process data from a user? Let's start with
+field data. What should the following command produce as output?
+
+ echo hello | awk '{ printf("%s %s < 42\n", $1,
+ ($1 < 42 ? "is" : "is not")) }'
+
+Since 'hello' is alphabetic data, 'awk' can only do a string comparison.
+Internally, it converts '42' into '"42"' and compares the two string
+values '"hello"' and '"42"'. Here's the result:
+
+ $ echo hello | awk '{ printf("%s %s < 42\n", $1,
+ > ($1 < 42 ? "is" : "is not")) }'
+ -| hello is not < 42
+
+ However, what happens when data from a user _looks like_ a number?
+On the one hand, in reality, the input data consists of characters, not
+binary numeric values. But, on the other hand, the data looks numeric,
+and 'awk' really ought to treat it as such. And indeed, it does:
+
+ $ echo 37 | awk '{ printf("%s %s < 42\n", $1,
+ > ($1 < 42 ? "is" : "is not")) }'
+ -| 37 is < 42
+
+ Here are the rules for when 'awk' treats data as a number, and for
+when it treats data as a string.
+
+ The POSIX standard uses the term "numeric string" for input data that
+looks numeric. The '37' in the previous example is a numeric string.
+So what is the type of a numeric string? Answer: numeric.
+
+ The type of a variable is important because the types of two
+variables determine how they are compared. Variable typing follows
+these definitions and rules:
* A numeric constant or the result of a numeric operation has the
"numeric" attribute.
@@ -8280,8 +8721,9 @@ they are compared. Variable typing follows these rules:
* Fields, 'getline' input, 'FILENAME', 'ARGV' elements, 'ENVIRON'
elements, and the elements of an array created by 'match()',
'split()', and 'patsplit()' that are numeric strings have the
- "strnum" attribute. Otherwise, they have the "string" attribute.
- Uninitialized variables also have the "strnum" attribute.
+ "strnum" attribute.(2) Otherwise, they have the "string"
+ attribute. Uninitialized variables also have the "strnum"
+ attribute.
* Attributes propagate across assignments but are not changed by any
use.
@@ -8300,16 +8742,16 @@ operation:
comparison may be used. This depends upon the attributes of the
operands, according to the following symmetric matrix:
- +-------------------------------
- | STRING NUMERIC STRNUM
- -----+-------------------------------
- |
- STRING | string string string
- |
- NUMERIC | string numeric numeric
- |
- STRNUM | string numeric numeric
- -----+-------------------------------
+ +----------------------------------------------
+ | STRING NUMERIC STRNUM
+--------+----------------------------------------------
+ |
+STRING | string string string
+ |
+NUMERIC | string numeric numeric
+ |
+STRNUM | string numeric numeric
+--------+----------------------------------------------
The basic idea is that user input that looks numeric--and _only_ user
input--should be treated as numeric, even though it is actually made of
@@ -8320,16 +8762,18 @@ for comparison purposes.
In short, when one operand is a "pure" string, such as a string
constant, then a string comparison is performed. Otherwise, a numeric
-comparison is performed.
+comparison is performed. (The primary difference between a number and a
+strnum is that for strnums 'gawk' preserves the original string value
+that the scalar had when it came in.)
+
+ This point bears additional emphasis: Input that looks numeric _is_
+numeric. All other input is treated as strings.
- This point bears additional emphasis: All user input is made of
-characters, and so is first and foremost of string type; input strings
-that look numeric are additionally given the strnum attribute. Thus,
-the six-character input string ' +3.14' receives the strnum attribute.
-In contrast, the eight characters '" +3.14"' appearing in program text
-comprise a string constant. The following examples print '1' when the
-comparison between the two different constants is true, and '0'
-otherwise:
+ Thus, the six-character input string ' +3.14' receives the strnum
+attribute. In contrast, the eight characters '" +3.14"' appearing in
+program text comprise a string constant. The following examples print
+'1' when the comparison between the two different constants is true, and
+'0' otherwise:
$ echo ' +3.14' | awk '{ print($0 == " +3.14") }' True
-| 1
@@ -8348,6 +8792,19 @@ otherwise:
$ echo ' +3.14' | awk '{ print($1 == 3.14) }' True
-| 1
+ You can see the type of an input field (or other user input) using
+'typeof()':
+
+ $ echo hello 37 | gawk '{ print typeof($1), typeof($2) }'
+ -| string strnum
+
+ ---------- Footnotes ----------
+
+ (1) 'gawk' calls this "unassigned", as the following example shows.
+
+ (2) Thus, a POSIX numeric string and 'gawk''s strnum are the same
+thing.
+

File: gawk.info, Node: Comparison Operators, Next: POSIX String Comparison, Prev: Variable Typing, Up: Typing and Comparison
@@ -8464,18 +8921,18 @@ Constant Regexps::, where this is discussed in more detail.

File: gawk.info, Node: POSIX String Comparison, Prev: Comparison Operators, Up: Typing and Comparison
-6.3.2.3 String Comparison with POSIX Rules
-..........................................
+6.3.2.3 String Comparison Based on Locale Collating Order
+.........................................................
-The POSIX standard says that string comparison is performed based on the
-locale's "collating order". This is the order in which characters sort,
-as defined by the locale (for more discussion, *note Locales::). This
-order is usually very different from the results obtained when doing
-straight character-by-character comparison.(1)
+The POSIX standard used to say that all string comparisons are performed
+based on the locale's "collating order". This is the order in which
+characters sort, as defined by the locale (for more discussion, *note
+Locales::). This order is usually very different from the results
+obtained when doing straight byte-by-byte comparison.(1)
Because this behavior differs considerably from existing practice,
-'gawk' only implements it when in POSIX mode (*note Options::). Here is
-an example to illustrate the difference, in an 'en_US.UTF-8' locale:
+'gawk' only implemented it when in POSIX mode (*note Options::). Here
+is an example to illustrate the difference, in an 'en_US.UTF-8' locale:
$ gawk 'BEGIN { printf("ABC < abc = %s\n",
> ("ABC" < "abc" ? "TRUE" : "FALSE")) }'
@@ -8484,11 +8941,28 @@ an example to illustrate the difference, in an 'en_US.UTF-8' locale:
> ("ABC" < "abc" ? "TRUE" : "FALSE")) }'
-| ABC < abc = FALSE
+ Fortunately, as of August 2016, comparison based on locale collating
+order is no longer required for the '==' and '!=' operators.(2)
+However, comparison based on locales is still required for '<', '<=',
+'>', and '>='. POSIX thus recommends as follows:
+
+ Since the '==' operator checks whether strings are identical, not
+ whether they collate equally, applications needing to check whether
+ strings collate equally can use:
+
+ a <= b && a >= b
+
+ As of version 4.2, 'gawk' continues to use locale collating order for
+'<', '<=', '>', and '>=' only in POSIX mode.
+
---------- Footnotes ----------
(1) Technically, string comparison is supposed to behave the same way
as if the strings were compared with the C 'strcoll()' function.
+ (2) See the Austin Group website
+(http://austingroupbugs.net/view.php?id=1070).
+

File: gawk.info, Node: Boolean Ops, Next: Conditional Exp, Prev: Typing and Comparison, Up: Truth Values and Conditions
@@ -10103,9 +10577,12 @@ each variable.)
'FIELDWIDTHS #'
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.
+ input with fixed columnar boundaries. Starting in version 4.2,
+ each field width may optionally be preceded by a colon-separated
+ value specifying the number of characters to skip before the field
+ starts. Assigning a value to 'FIELDWIDTHS' overrides the use of
+ 'FS' and 'FPAT' for field splitting. *Note Constant Size:: for
+ more information.
'FPAT #'
A regular expression (as a string) that tells 'gawk' to create the
@@ -10126,7 +10603,7 @@ each variable.)
The default value is '" "', a string consisting of a single space.
As a special exception, this value means that any sequence of
- spaces, TABs, and/or newlines is a single separator.(1) It also
+ spaces, TABs, and/or newlines is a single separator. It also
causes spaces, TABs, and newlines at the beginning and end of a
record to be ignored.
@@ -10223,10 +10700,6 @@ each variable.)
Internationalization::). The default value of 'TEXTDOMAIN' is
'"messages"'.
- ---------- Footnotes ----------
-
- (1) In POSIX 'awk', newline does not count as whitespace.
-

File: gawk.info, Node: Auto-set, Next: ARGC and ARGV, Prev: User-modified, Up: Built-in Variables
@@ -10290,10 +10763,24 @@ they are not special:
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. (In a
- future version of 'gawk', it may do so.)
+ 'ENVIRON["HOME"]' might be '/home/arnold'.
+
+ For POSIX 'awk', changing this array does not affect the
+ environment passed on to any programs that 'awk' may spawn via
+ redirection or the 'system()' function.
+
+ However, beginning with version 4.2, if not in POSIX compatibility
+ mode, 'gawk' does update its own environment when 'ENVIRON' is
+ changed, thus changing the environment seen by programs that it
+ creates. You should therefore be especially careful if you modify
+ 'ENVIRON["PATH"]', which is the search path for finding executable
+ programs.
+
+ This can also affect the running 'gawk' program, since some of the
+ built-in functions may pay attention to certain environment
+ variables. The most notable instance of this is 'mktime()' (*note
+ Time Functions::), which pays attention the value of the 'TZ'
+ environment variable on many systems.
Some operating systems may not have environment variables. On such
systems, the 'ENVIRON' array is empty (except for
@@ -10316,6 +10803,11 @@ they are not special:
'getline' returning -1. You are, of course, free to clear it
yourself before doing an I/O operation.
+ If the value of 'ERRNO' corresponds to a system error in the C
+ 'errno' variable, then 'PROCINFO["errno"]' will be set to the value
+ of 'errno'. For non-system errors, 'PROCINFO["errno"]' will be
+ zero.
+
'FILENAME'
The name of the current input file. When no data files are listed
on the command line, 'awk' reads from the standard input and
@@ -10361,17 +10853,41 @@ they are not special:
running 'awk' program. The following elements (listed
alphabetically) are guaranteed to be available:
+ 'PROCINFO["argv"]'
+ The 'PROCINFO["argv"]' array contains all of the command-line
+ arguments (after glob expansion and redirection processing on
+ platforms where that must be done manually by the program)
+ with subscripts ranging from 0 through 'argc' - 1. For
+ example, 'PROCINFO["argv"][0]' will contain the name by which
+ 'gawk' was invoked. Here is an example of how this feature
+ may be used:
+
+ gawk '
+ BEGIN {
+ for (i = 0; i < length(PROCINFO["argv"]); i++)
+ print i, PROCINFO["argv"][i]
+ }'
+
+ Please note that this differs from the standard 'ARGV' array
+ which does not include command-line arguments that have
+ already been processed by 'gawk' (*note ARGC and ARGV::).
+
'PROCINFO["egid"]'
The value of the 'getegid()' system call.
+ 'PROCINFO["errno"]'
+ The value of the C 'errno' variable when 'ERRNO' is set to the
+ associated error message.
+
'PROCINFO["euid"]'
The value of the 'geteuid()' system call.
'PROCINFO["FS"]'
This is '"FS"' if field splitting with 'FS' is in effect,
'"FIELDWIDTHS"' if field splitting with 'FIELDWIDTHS' is in
- effect, or '"FPAT"' if field matching with 'FPAT' is in
- effect.
+ effect, '"FPAT"' if field matching with 'FPAT' is in effect,
+ or '"API"' if field splitting is controlled by an API input
+ parser.
'PROCINFO["gid"]'
The value of the 'getgid()' system call.
@@ -10462,6 +10978,14 @@ they are not special:
The following elements allow you to change 'gawk''s behavior:
+ 'PROCINFO["NONFATAL"]'
+ If this element exists, then I/O errors for all output
+ redirections become nonfatal. *Note Nonfatal::.
+
+ 'PROCINFO["OUTPUT_NAME", "NONFATAL"]'
+ Make output errors for OUTPUT_NAME be nonfatal. *Note
+ Nonfatal::.
+
'PROCINFO["COMMAND", "pty"]'
For two-way communication to COMMAND, use a pseudo-tty instead
of setting up a two-way pipe. *Note Two-way I/O:: for more
@@ -11876,6 +12400,24 @@ brackets ([ ]):
truncated toward zero. For example, 'int(3)' is 3, 'int(3.9)' is
3, 'int(-3.9)' is -3, and 'int(-3)' is -3 as well.
+'intdiv(NUMERATOR, DENOMINATOR, RESULT)'
+ Perform integer division, similar to the standard C 'div()'
+ function. First, truncate 'numerator' and 'denominator' towards
+ zero, creating integer values. Clear the 'result' array, and then
+ set 'result["quotient"]' to the result of 'numerator /
+ denominator', truncated towards zero to an integer, and set
+ 'result["remainder"]' to the result of 'numerator % denominator',
+ truncated towards zero to an integer. Attempting division by zero
+ causes a fatal error. The function returns zero upon success, and
+ -1 upon error.
+
+ This function is primarily intended for use with arbitrary length
+ integers; it avoids creating MPFR arbitrary precision
+ floating-point values (*note Arbitrary Precision Integers::).
+
+ This function is a 'gawk' extension. It is not available in
+ compatibility mode (*note Options::).
+
'log(X)'
Return the natural logarithm of X, if X is positive; otherwise,
return 'NaN' ("not a number") on IEEE 754 systems. Additionally,
@@ -12264,16 +12806,18 @@ Options::):
fatal error.
'patsplit(STRING, ARRAY' [', FIELDPAT' [', SEPS' ] ]') #'
- Divide STRING into pieces defined by FIELDPAT and store the pieces
- in ARRAY and the separator strings in the SEPS array. The first
- piece is stored in 'ARRAY[1]', the second piece in 'ARRAY[2]', and
- so forth. The third argument, FIELDPAT, is a regexp describing the
- fields in STRING (just as 'FPAT' is a regexp describing the fields
- in input records). It may be either a regexp constant or a string.
- If FIELDPAT is omitted, the value of 'FPAT' is used. 'patsplit()'
- returns the number of elements created. 'SEPS[I]' is the separator
- string between 'ARRAY[I]' and 'ARRAY[I+1]'. Any leading separator
- will be in 'SEPS[0]'.
+ Divide STRING into pieces (or "fields") defined by FIELDPAT and
+ store the pieces in ARRAY and the separator strings in the SEPS
+ array. The first piece is stored in 'ARRAY[1]', the second piece
+ in 'ARRAY[2]', and so forth. The third argument, FIELDPAT, is a
+ regexp describing the fields in STRING (just as 'FPAT' is a regexp
+ describing the fields in input records). It may be either a regexp
+ constant or a string. If FIELDPAT is omitted, the value of 'FPAT'
+ is used. 'patsplit()' returns the number of elements created.
+ 'SEPS[I]' is the possibly null separator string after 'ARRAY[I]'.
+ The possibly null leading separator will be in 'SEPS[0]'. So a
+ non-null STRING with N fields will have N+1 separators. A null
+ STRING will not have neither fields nor separators.
The 'patsplit()' function splits strings into pieces in a manner
similar to the way input lines are split into fields using 'FPAT'
@@ -12911,7 +13455,7 @@ POSIX standard.(2) However, recent versions of 'mawk' (*note Other
Versions::) also support these functions. Optional parameters are
enclosed in square brackets ([ ]):
-'mktime(DATESPEC)'
+'mktime(DATESPEC' [', UTC-FLAG' ]')'
Turn DATESPEC into a timestamp in the same form as is returned by
'systime()'. It is similar to the function of the same name in ISO
C. The argument, DATESPEC, is a string of the form
@@ -12924,12 +13468,14 @@ enclosed in square brackets ([ ]):
The values of these numbers need not be within the ranges
specified; for example, an hour of -1 means 1 hour before midnight.
The origin-zero Gregorian calendar is assumed, with year 0
- preceding year 1 and year -1 preceding year 0. The time is assumed
- to be in the local time zone. If the daylight-savings flag is
- positive, the time is assumed to be daylight savings time; if zero,
- the time is assumed to be standard time; and if negative (the
- default), 'mktime()' attempts to determine whether daylight savings
- time is in effect for the specified time.
+ preceding year 1 and year -1 preceding year 0. If UTC-FLAG is
+ present and is either nonzero or non-null, the time is assumed to
+ be in the UTC time zone; otherwise, the time is assumed to be in
+ the local time zone. If the daylight-savings flag is positive, the
+ time is assumed to be daylight savings time; if zero, the time is
+ assumed to be standard time; and if negative (the default),
+ 'mktime()' attempts to determine whether daylight savings time is
+ in effect for the specified time.
If DATESPEC does not contain enough elements or if the resulting
time is out of range, 'mktime()' returns -1.
@@ -13263,13 +13809,10 @@ are enclosed in square brackets ([ ]):
Return the bitwise XOR of the arguments. There must be at least
two.
- For all of these functions, first the double-precision floating-point
-value is converted to the widest C unsigned integer type, then the
-bitwise operation is performed. If the result cannot be represented
-exactly as a C 'double', leading nonzero bits are removed one by one
-until it can be represented exactly. The result is then converted back
-into a C 'double'. (If you don't understand this paragraph, don't worry
-about it.)
+ CAUTION: Beginning with 'gawk' version 4.2, negative operands are
+ not allowed for any of these functions. A negative operand
+ produces a fatal error. See the sidebar "Beware The Smoke and
+ Mirrors!" for more information as to why.
Here is a user-defined function (*note User-defined::) that
illustrates the use of these functions:
@@ -13331,26 +13874,118 @@ decimal and octal values for the same numbers (*note
Nondecimal-numbers::), and then demonstrates the results of the
'compl()', 'lshift()', and 'rshift()' functions.
+ Beware The Smoke and Mirrors!
+
+ It other languages, bitwise operations are performed on integer
+values, not floating-point values. As a general statement, such
+operations work best when performed on unsigned integers.
+
+ 'gawk' attempts to treat the arguments to the bitwise functions as
+unsigned integers. For this reason, negative arguments produce a fatal
+error.
+
+ In normal operation, for all of these functions, first the
+double-precision floating-point value is converted to the widest C
+unsigned integer type, then the bitwise operation is performed. If the
+result cannot be represented exactly as a C 'double', leading nonzero
+bits are removed one by one until it can be represented exactly. The
+result is then converted back into a C 'double'.(2)
+
+ However, when using arbitrary precision arithmetic with the '-M'
+option (*note Arbitrary Precision Arithmetic::), the results may differ.
+This is particularly noticeable with the 'compl()' function:
+
+ $ gawk 'BEGIN { print compl(42) }'
+ -| 9007199254740949
+ $ gawk -M 'BEGIN { print compl(42) }'
+ -| -43
+
+ What's going on becomes clear when printing the results in
+hexadecimal:
+
+ $ gawk 'BEGIN { printf "%#x\n", compl(42) }'
+ -| 0x1fffffffffffd5
+ $ gawk -M 'BEGIN { printf "%#x\n", compl(42) }'
+ -| 0xffffffffffffffd5
+
+ When using the '-M' option, under the hood, 'gawk' uses GNU MP
+arbitrary precision integers which have at least 64 bits of precision.
+When not using '-M', 'gawk' stores integral values in regular
+double-precision floating point, which only maintain 53 bits of
+precision. Furthermore, the GNU MP library treats (or at least seems to
+treat) the leading bit as a sign bit; thus the result with '-M' in this
+case is a negative number.
+
+ In short, using 'gawk' for any but the simplest kind of bitwise
+operations is probably a bad idea; caveat emptor!
+
---------- Footnotes ----------
(1) This example shows that zeros come in on the left side. For
'gawk', this is always true, but in some languages, it's possible to
have the left side fill with ones.
+ (2) If you don't understand this paragraph, the upshot is that 'gawk'
+can only store a particular range of integer values; numbers outside
+that range are reduced to fit within the range.
+

File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise Functions, Up: Built-in
9.1.7 Getting Type Information
------------------------------
-'gawk' provides a single function that lets you distinguish an array
-from a scalar variable. This is necessary for writing code that
-traverses every element of an array of arrays (*note Arrays of
-Arrays::).
+'gawk' provides two functions that let you distinguish the type of a
+variable. This is necessary for writing code that traverses every
+element of an array of arrays (*note Arrays of Arrays::), and in other
+contexts.
'isarray(X)'
Return a true value if X is an array. Otherwise, return false.
+'typeof(X)'
+ Return one of the following strings, depending upon the type of X:
+
+ '"array"'
+ X is an array.
+
+ '"regexp"'
+ X is a strongly typed regexp (*note Strong Regexp
+ Constants::).
+
+ '"number"'
+ X is a number.
+
+ '"string"'
+ X is a string.
+
+ '"strnum"'
+ X is a number that started life as user input, such as a field
+ or the result of calling 'split()'. (I.e., X has the strnum
+ attribute; *note Variable Typing::.)
+
+ '"unassigned"'
+ X is a scalar variable that has not been assigned a value yet.
+ For example:
+
+ BEGIN {
+ # creates a[1] but it has no assigned value
+ a[1]
+ print typeof(a[1]) # unassigned
+ }
+
+ '"untyped"'
+ X has not yet been used yet at all; it can become a scalar or
+ an array. For example:
+
+ BEGIN {
+ print typeof(x) # x never used --> untyped
+ mk_arr(x)
+ print typeof(x) # x now an array --> array
+ }
+
+ function mk_arr(a) { a[1] = 1 }
+
'isarray()' is meant for use in two circumstances. The first is when
traversing a multidimensional array: you can test if an element is
itself an array or not. The second is inside the body of a user-defined
@@ -13364,6 +13999,14 @@ parameter is an array or not.
that has not been previously used to 'isarray()', 'gawk' ends up
turning it into a scalar.
+ The 'typeof()' function is general; it allows you to determine if a
+variable or function parameter is a scalar, an array, or a strongly
+typed regexp.
+
+ 'isarray()' is deprecated; you should use 'typeof()' instead. You
+should replace any existing uses of 'isarray(var)' in your code with
+'typeof(var) == "array"'.
+

File: gawk.info, Node: I18N Functions, Prev: Type Functions, Up: Built-in
@@ -19679,9 +20322,15 @@ case 'gawk' waits for the child process to exit, which may cause your
program to hang. (Thus, this particular feature is of much less use in
practice than being able to close the '"to"' end.)
- CAUTION: It is a fatal error to write to the '"to"' end of a
- two-way pipe which has been closed. It is also a fatal error to
- read from the '"from"' end of a two-way pipe that has been closed.
+ CAUTION: Normally, it is a fatal error to write to the '"to"' end
+ of a two-way pipe which has been closed, and it is also a fatal
+ error to read from the '"from"' end of a two-way pipe that has been
+ closed.
+
+ You may set 'PROCINFO["COMMAND", "NONFATAL"]' to make such
+ operations become nonfatal. If you do so, you then need to check
+ 'ERRNO' after each 'print', 'printf', or 'getline'. *Note
+ Nonfatal::, for more information.
You may also use pseudo-ttys (ptys) for two-way communication instead
of pipes, if your system supports them. This is done on a per-command
@@ -19969,8 +20618,7 @@ output. They are as follows:
you typed when you wrote it. This is because 'gawk' creates the
profiled version by "pretty-printing" its internal representation of the
program. The advantage to this is that 'gawk' can produce a standard
-representation. The disadvantage is that all source code comments are
-lost. Also, things such as:
+representation. Also, things such as:
/foo/
@@ -20029,8 +20677,40 @@ the 'Ctrl-\' key.
called this way, 'gawk' "pretty-prints" the program into 'awkprof.out',
without any execution counts.
- NOTE: The '--pretty-print' option still runs your program. This
- will change in the next major release.
+ NOTE: Once upon a time, the '--pretty-print' option would also run
+ your program. This is is no longer the case.
+
+ There is a significant difference between the output created when
+profiling, and that created when pretty-printing. Pretty-printed output
+preserves the original comments that were in the program, although their
+placement may not correspond exactly to their original locations in the
+source code.(1)
+
+ However, as a deliberate design decision, profiling output _omits_
+the original program's comments. This allows you to focus on the
+execution count data and helps you avoid the temptation to use the
+profiler for pretty-printing.
+
+ Additionally, pretty-printed output does not have the leading
+indentation that the profiling output does. This makes it easy to
+pretty-print your code once development is completed, and then use the
+result as the final version of your program.
+
+ Because the internal representation of your program is formatted to
+recreate an 'awk' program, profiling and pretty-printing automatically
+disable 'gawk''s default optimizations.
+
+ Pretty printing also preserves the original format of numeric
+constants; if you used an octal or hexadecimal value in your source
+code, it will appear that way in the output.
+
+ ---------- Footnotes ----------
+
+ (1) 'gawk' does the best it can to preserve the distinction between
+comments at the end of a statement and comments on lines by themselves.
+Due to implementation constraints, it does not always do so correctly,
+particularly for 'switch' statements. The 'gawk' maintainers hope to
+improve this in a subsequent release.

File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanced Features
@@ -20071,8 +20751,7 @@ File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanc
'USR1' signal while profiling causes 'gawk' to dump the profile and
keep going, including a function call stack.
- * You can also just "pretty-print" the program. This currently also
- runs the program, but that will change in the next major release.
+ * You can also just "pretty-print" the program.

File: gawk.info, Node: Internationalization, Next: Debugger, Prev: Advanced Features, Up: Top
@@ -21797,6 +22476,9 @@ File: gawk.info, Node: Debugging Summary, Prev: Limitations, Up: Debugger
it is used by the debugger to provide command-line history and
editing.
+ * Usually, the debugger does not not affect the program being
+ debugged, but occasionally it can.
+

File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Dynamic Extensions, Prev: Debugger, Up: Top
@@ -21824,6 +22506,7 @@ are not quite in agreement.
* FP Math Caution:: Things to know.
* Arbitrary Precision Integers:: Arbitrary Precision Integer Arithmetic with
'gawk'.
+* Checking for MPFR:: How to check if MPFR is available.
* POSIX Floating Point Problems:: Standards Versus Existing Practice.
* Floating point summary:: Summary of floating point discussion.
@@ -22463,7 +23146,7 @@ library in your system does not use the IEEE 754 even-rounding rule to
round halfway cases for 'printf'.

-File: gawk.info, Node: Arbitrary Precision Integers, Next: POSIX Floating Point Problems, Prev: FP Math Caution, Up: Arbitrary Precision Arithmetic
+File: gawk.info, Node: Arbitrary Precision Integers, Next: Checking for MPFR, Prev: FP Math Caution, Up: Arbitrary Precision Arithmetic
15.5 Arbitrary-Precision Integer Arithmetic with 'gawk'
=======================================================
@@ -22530,6 +23213,62 @@ the following:
gawk -M 'BEGIN { n = 13; print n % 2 }'
+ When dividing two arbitrary precision integers with either '/' or
+'%', the result is typically an arbitrary precision floating point value
+(unless the denominator evenly divides into the numerator). In order to
+do integer division or remainder with arbitrary precision integers, use
+the built-in 'intdiv()' function (*note Numeric Functions::).
+
+ You can simulate the 'intdiv()' function in standard 'awk' using this
+user-defined function:
+
+ # intdiv --- do integer division
+
+ function intdiv(numerator, denominator, result)
+ {
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+ }
+
+ The following example program, contributed by Katie Wasserman, uses
+'intdiv()' to compute the digits of pi to as many places as you choose
+to set:
+
+ # pi.awk --- compute the digits of pi
+
+ BEGIN {
+ digits = 100000
+ two = 2 * 10 ^ digits
+ pi = two
+ for (m = digits * 4; m > 0; --m) {
+ d = m * 2 + 1
+ x = pi * m
+ intdiv(x, d, result)
+ pi = result["quotient"]
+ pi = pi + two
+ }
+ print pi
+ }
+
+ When asked about the algorithm used, Katie replied:
+
+ It's not that well known but it's not that obscure either. It's
+ Euler's modification to Newton's method for calculating pi. Take a
+ look at lines (23) - (25) here:
+ <http://mathworld.wolfram.com/PiFormulas.html>.
+
+ The algorithm I wrote simply expands the multiply by 2 and works
+ from the innermost expression outwards. I used this to program HP
+ calculators because it's quite easy to modify for tiny memory
+ devices with smallish word sizes. See
+ <http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899>.
+
---------- Footnotes ----------
(1) Weisstein, Eric W. 'Sylvester's Sequence'. From MathWorld--A
@@ -22537,9 +23276,46 @@ Wolfram Web Resource
(<http://mathworld.wolfram.com/SylvestersSequence.html>).

-File: gawk.info, Node: POSIX Floating Point Problems, Next: Floating point summary, Prev: Arbitrary Precision Integers, Up: Arbitrary Precision Arithmetic
+File: gawk.info, Node: Checking for MPFR, Next: POSIX Floating Point Problems, Prev: Arbitrary Precision Integers, Up: Arbitrary Precision Arithmetic
+
+15.6 How To Check If MPFR Is Available
+======================================
+
+Occasionally, you might like to be able to check if 'gawk' was invoked
+with the '-M' option, enabling arbitrary-precision arithmetic. You can
+do so with the following function, contributed by Andrew Schorr:
+
+ # adequate_math_precision --- return true if we have enough bits
+
+ function adequate_math_precision(n)
+ {
+ return (1 != (1+(1/(2^(n-1)))))
+ }
+
+ Here is code that invokes the function in order to check if
+arbitrary-precision arithmetic is available:
+
+ BEGIN {
+ # How many bits of mantissa precision are required
+ # for this program to function properly?
+ fpbits = 123
+
+ # We hope that we were invoked with MPFR enabled. If so, the
+ # following statement should configure calculations to our desired
+ # precision.
+ PREC = fpbits
+
+ if (! adequate_math_precision(fpbits)) {
+ print("Error: insufficient computation precision available.\n" \
+ "Try again with the -M argument?") > "/dev/stderr"
+ exit 1
+ }
+ }
+
+
+File: gawk.info, Node: POSIX Floating Point Problems, Next: Floating point summary, Prev: Checking for MPFR, Up: Arbitrary Precision Arithmetic
-15.6 Standards Versus Existing Practice
+15.7 Standards Versus Existing Practice
=======================================
Historically, 'awk' has converted any nonnumeric-looking string to the
@@ -22626,7 +23402,7 @@ and infinity values. The solution implemented in 'gawk' is as follows:

File: gawk.info, Node: Floating point summary, Prev: POSIX Floating Point Problems, Up: Arbitrary Precision Arithmetic
-15.7 Summary
+15.8 Summary
============
* Most computer arithmetic is done using either integers or
@@ -22892,8 +23668,11 @@ API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
+* Changes from API V1:: Changes from V1 of the API.

File: gawk.info, Node: Extension API Functions Introduction, Next: General Data Types, Up: Extension API Description
@@ -22947,6 +23726,8 @@ operations:
- Flattening an array for easy C-style looping over all its
indices and elements
+ * Accessing and manipulating redirections.
+
Some points about using the API:
* The following types, macros, and/or functions are referenced in
@@ -22987,16 +23768,25 @@ operations:
* The API defines several simple 'struct's that map values as seen
from 'awk'. A value can be a 'double', a string, or an array (as
- in multidimensional arrays, or when creating a new array). String
- values maintain both pointer and length, because embedded NUL
- characters are allowed.
+ in multidimensional arrays, or when creating a new array).
+
+ String values maintain both pointer and length, because embedded
+ NUL characters are allowed.
- NOTE: By intent, strings are maintained using the current
+ NOTE: By intent, 'gawk' maintains strings using the current
multibyte encoding (as defined by 'LC_XXX' environment
variables) and not using wide characters. This matches how
'gawk' stores strings internally and also how characters are
likely to be input into and output from files.
+ NOTE: String values passed to an extension by 'gawk' are
+ always NUL-terminated. Thus it is safe to pass such string
+ values to standard library and system routines. However,
+ because 'gawk' allows embedded NUL characters in string data,
+ before using the data as a regular C string, you should check
+ that the length for that string passed to the extension
+ matches the return value of 'strlen()' for it.
+
* When retrieving a value (such as a parameter or that of a global
variable or array element), the extension requests a specific type
(number, string, scalar, value cookie, array, or "undefined").
@@ -23067,6 +23857,8 @@ use them.
' AWK_UNDEFINED,'
' AWK_NUMBER,'
' AWK_STRING,'
+' AWK_REGEX,'
+' AWK_STRNUM,'
' AWK_ARRAY,'
' AWK_SCALAR, /* opaque access to a variable */'
' AWK_VALUE_COOKIE /* for updating a previously created value */'
@@ -23089,6 +23881,8 @@ use them.
type.
'#define str_value u.s'
+'#define strnum_value str_value'
+'#define regex_value str_value'
'#define num_value u.d'
'#define array_cookie u.a'
'#define scalar_cookie u.scl'
@@ -23107,15 +23901,35 @@ use them.
This is also discussed in a general fashion in the text following
this list, and in more detail in *note Cached values::.
- Scalar values in 'awk' are either numbers or strings. The
-'awk_value_t' struct represents values. The 'val_type' member indicates
-what is in the 'union'.
+ Scalar values in 'awk' are numbers, strings, strnums, or typed
+regexps. The 'awk_value_t' struct represents values. The 'val_type'
+member indicates what is in the 'union'.
Representing numbers is easy--the API uses a C 'double'. Strings
require more work. Because 'gawk' allows embedded NUL bytes in string
values, a string must be represented as a pair containing a data pointer
and length. This is the 'awk_string_t' type.
+ A strnum (numeric string) value is represented as a string and
+consists of user input data that appears to be numeric. When an
+extension creates a strnum value, the result is a string flagged as user
+input. Subsequent parsing by 'gawk' then determines whether it looks
+like a number and should be treated as a strnum, or as a regular string.
+
+ This is useful in cases where an extension function would like to do
+something comparable to the 'split()' function which sets the strnum
+attribute on the array elements it creates. For example, an extension
+that implements CSV splitting would want to use this feature. This is
+also useful for a function that retrieves a data item from a database.
+The PostgreSQL 'PQgetvalue()' function, for example, returns a string
+that may be numeric or textual depending on the contents.
+
+ Typed regexp values (*note Strong Regexp Constants::) are not of much
+use to extension functions. Extension functions can tell that they've
+received them, and create them for scalar values. Otherwise, they can
+examine the text of the regexp through 'regex_value.str' and
+'regex_value.len'.
+
Identifiers (i.e., the names of global variables) can be associated
with either scalar values or with arrays. In addition, 'gawk' provides
true arrays of arrays, where any given array element can itself be an
@@ -23275,6 +24089,31 @@ code would use them:
This function simply creates a numeric value in the 'awk_value_t'
variable pointed to by 'result'.
+'static inline awk_value_t *'
+'make_const_user_input(const char *string, size_t length, awk_value_t *result);'
+ This function is identical to 'make_const_string()', but the string
+ is flagged as user input that should be treated as a strnum value
+ if the contents of the string are numeric.
+
+'static inline awk_value_t *'
+'make_malloced_user_input(const char *string, size_t length, awk_value_t *result);'
+ This function is identical to 'make_malloced_string()', but the
+ string is flagged as user input that should be treated as a strnum
+ value if the contents of the string are numeric.
+
+'static inline awk_value_t *'
+'make_const_regex(const char *string, size_t length, awk_value_t *result);'
+ This function creates a strongly typed regexp value by allocating a
+ copy of the string. 'string' is the regular expression of length
+ 'len'.
+
+'static inline awk_value_t *'
+'make_malloced_regex(const char *string, size_t length, awk_value_t *result);'
+ This function creates a strongly typed regexp value. 'string' is
+ the regular expression of length 'len'. It expects 'string' to be
+ a 'char *' value pointing to data previously obtained from
+ 'gawk_malloc()', 'gawk_calloc()', or 'gawk_realloc()'.
+

File: gawk.info, Node: Registration Functions, Next: Printing Messages, Prev: Constructor Functions, Up: Extension API Description
@@ -23303,8 +24142,13 @@ Extension functions are described by the following record:
typedef struct awk_ext_func {
const char *name;
- awk_value_t *(*function)(int num_actual_args, awk_value_t *result);
- size_t num_expected_args;
+ awk_value_t *(*const function)(int num_actual_args,
+ awk_value_t *result,
+ struct awk_ext_func *finfo);
+ const size_t max_expected_args;
+ const size_t min_required_args;
+ awk_bool_t suppress_lint;
+ void *data; /* opaque pointer to any extra state */
} awk_ext_func_t;
The fields are:
@@ -23318,34 +24162,89 @@ Extension functions are described by the following record:
which may be followed by any number of letters, digits, and
underscores. Letter case in function names is significant.
-'awk_value_t *(*function)(int num_actual_args, awk_value_t *result);'
+'awk_value_t *(*const function)(int num_actual_args,'
+' awk_value_t *result,'
+' struct awk_ext_func *finfo);'
This is a pointer to the C function that provides the extension's
functionality. The function must fill in '*result' with either a
- number or a string. 'gawk' takes ownership of any string memory.
- As mentioned earlier, string memory _must_ come from one of
- 'gawk_malloc()', 'gawk_calloc()', or 'gawk_realloc()'.
+ number, a string, or a regexp. 'gawk' takes ownership of any
+ string memory. As mentioned earlier, string memory _must_ come
+ from one of 'gawk_malloc()', 'gawk_calloc()', or 'gawk_realloc()'.
The 'num_actual_args' argument tells the C function how many actual
parameters were passed from the calling 'awk' code.
+ The 'finfo' parameter is a pointer to the 'awk_ext_func_t' for this
+ function. The called function may access data within it as
+ desired, or not.
+
The function must return the value of 'result'. This is for the
convenience of the calling code inside 'gawk'.
-'size_t num_expected_args;'
- This is the number of arguments the function expects to receive.
- Each extension function may decide what to do if the number of
- arguments isn't what it expected. As with real 'awk' functions, it
- is likely OK to ignore extra arguments.
+'const size_t max_expected_args;'
+ This is the maximum number of arguments the function expects to
+ receive. If called with more arguments than this, and if lint
+ checking has been enabled, then 'gawk' prints a warning message.
+ For more information, see the entry for 'suppress_lint', later in
+ this list.
+
+'const size_t min_required_args;'
+ This is the minimum number of arguments the function expects to
+ receive. If called with fewer arguments, 'gawk' prints a fatal
+ error message and exits.
+
+'awk_bool_t suppress_lint;'
+ This flag tells 'gawk' not to print a lint message if lint checking
+ has been enabled and if more arguments were supplied in the call
+ than expected. An extension function can tell if 'gawk' already
+ printed at least one such message by checking if 'num_actual_args >
+ finfo->max_expected_args'. If so, and the function does not want
+ more lint messages to be printed, it should set
+ 'finfo->suppress_lint' to 'awk_true'.
+
+'void *data;'
+ This is an opaque pointer to any data that an extension function
+ may wish to have available when called. Passing the
+ 'awk_ext_func_t' structure to the extension function, and having
+ this pointer available in it enable writing a single C or C++
+ function that implements multiple 'awk'-level extension functions.
Once you have a record representing your extension function, you
register it with 'gawk' using this API function:
-'awk_bool_t add_ext_func(const char *namespace, const awk_ext_func_t *func);'
+'awk_bool_t add_ext_func(const char *namespace, awk_ext_func_t *func);'
This function returns true upon success, false otherwise. The
'namespace' parameter is currently not used; you should pass in an
empty string ('""'). The 'func' pointer is the address of a
'struct' representing your function, as just described.
+ 'gawk' does not modify what 'func' points to, but the extension
+ function itself receives this pointer and can modify what it points
+ to, thus it is purposely not declared to be 'const'.
+
+ The combination of 'min_required_args', 'max_expected_args', and
+'suppress_lint' may be confusing. Here is how you should set things up.
+
+Any number of arguments is valid
+ Set 'min_required_args' and 'max_expected_args' to zero and set
+ 'suppress_lint' to 'awk_true'.
+
+A minimum number of arguments is required, no limit on maximum number of arguments
+ Set 'min_required_args' to the minimum required. Set
+ 'max_expected_args' to zero and set 'suppress_lint' to 'awk_true'.
+
+A minimum number of arguments is required, a maximum number is expected
+ Set 'min_required_args' to the minimum required. Set
+ 'max_expected_args' to the maximum expected. Set 'suppress_lint'
+ to 'awk_false'.
+
+A minimum number of arguments is required, and no more than a maximum is allowed
+ Set 'min_required_args' to the minimum required. Set
+ 'max_expected_args' to the maximum expected. Set 'suppress_lint'
+ to 'awk_false'. In your extension function, check that
+ 'num_actual_args' does not exceed 'f->max_expected_args'. If it
+ does, issue a fatal error message.
+

File: gawk.info, Node: Exit Callback Functions, Next: Extension Version String, Prev: Extension Functions, Up: Registration Functions
@@ -23470,7 +24369,8 @@ for 'RT', if any.
#define INVALID_HANDLE (-1)
void *opaque; /* private data for input parsers */
int (*get_record)(char **out, struct awk_input *iobuf,
- int *errcode, char **rt_start, size_t *rt_len);
+ int *errcode, char **rt_start, size_t *rt_len,
+ const awk_fieldwidth_info_t **field_width);
ssize_t (*read_func)();
void (*close_func)(struct awk_input *iobuf);
struct stat sbuf; /* stat buf */
@@ -23516,7 +24416,8 @@ may be filled by 'XXX_take_control_of()':
' struct awk_input *iobuf,'
' int *errcode,'
' char **rt_start,'
-' size_t *rt_len);'
+' size_t *rt_len,'
+' const awk_fieldwidth_info_t **field_width);'
This function pointer should point to a function that creates the
input records. Said function is the core of the input parser. Its
behavior is described in the text following this list.
@@ -23566,6 +24467,20 @@ records. The parameters are as follows:
'*rt_len' should be set to zero. 'gawk' makes its own copy of this
data, so the extension must manage this storage.
+'const awk_fieldwidth_info_t **field_width'
+ If 'field_width' is not 'NULL', then '*field_width' will be
+ initialized to 'NULL', and the function may set it to point to a
+ structure supplying field width information to override the default
+ field parsing mechanism. Note that this structure will not be
+ copied by 'gawk'; it must persist at least until the next call to
+ 'get_record' or 'close_func'. Note also that 'field_width' is
+ 'NULL' when 'getline' is assigning the results to a variable, thus
+ field parsing is not needed. If the parser does set
+ '*field_width', then 'gawk' uses this layout to parse the input
+ record, and the 'PROCINFO["FS"]' value will be '"API"' while this
+ record is active in '$0'. The 'awk_fieldwidth_info_t' data
+ structure is described below.
+
The return value is the length of the buffer pointed to by '*out', or
'EOF' if end-of-file was reached or an error occurred.
@@ -23615,6 +24530,46 @@ activate an input parser (*note BEGINFILE/ENDFILE::).
'void register_input_parser(awk_input_parser_t *input_parser);'
Register the input parser pointed to by 'input_parser' with 'gawk'.
+ If you would like to override the default field parsing mechanism for
+a given record, then you must populate an 'awk_fieldwidth_info_t'
+structure, which looks like this:
+
+ typedef struct {
+ awk_bool_t use_chars; /* false ==> use bytes */
+ size_t nf; /* number of fields in record (NF) */
+ struct awk_field_info {
+ size_t skip; /* amount to skip before field starts */
+ size_t len; /* length of field */
+ } fields[1]; /* actual dimension should be nf */
+ } awk_fieldwidth_info_t;
+
+ The fields are:
+
+'awk_bool_t use_chars;'
+ Set this to 'awk_true' if the field lengths are specified in terms
+ of potentially multi-byte characters, and set it to 'awk_false' if
+ the lengths are in terms of bytes. Performance will be better if
+ the values are supplied in terms of bytes.
+
+'size_t nf;'
+ Set this to the number of fields in the input record, i.e. 'NF'.
+
+'struct awk_field_info fields[nf];'
+ This is a variable-length array whose actual dimension should be
+ 'nf'. For each field, the 'skip' element should be set to the
+ number of characters or bytes, as controlled by the 'use_chars'
+ flag, to skip before the start of this field. The 'len' element
+ provides the length of the field. The values in 'fields[0]'
+ provide the information for '$1', and so on through the
+ 'fields[nf-1]' element containing the information for '$NF'.
+
+ A convenience macro 'awk_fieldwidth_info_size(NF)' is provided to
+calculate the appropriate size of a variable-length
+'awk_fieldwidth_info_t' structure containing 'NF' fields. This can be
+used as an argument to 'malloc()' or in a union to allocate space
+statically. Please refer to the 'readdir_test' sample extension for an
+example.
+

File: gawk.info, Node: Output Wrappers, Next: Two-way processors, Prev: Input Parsers, Up: Registration Functions
@@ -23788,6 +24743,9 @@ extension ID received from 'gawk' when the extension was loaded:(1)
'void fatal(awk_ext_id_t id, const char *format, ...);'
Print a message and then cause 'gawk' to exit immediately.
+'void nonfatal(awk_ext_id_t id, const char *format, ...);'
+ Print a nonfatal error message.
+
'void warning(awk_ext_id_t id, const char *format, ...);'
Print a warning message.
@@ -23844,18 +24802,17 @@ summarized in *note Table 16.1: table-value-types-returned.
Type of Actual Value
--------------------------------------------------------------------------
- String Number Array Undefined
-------------------------------------------------------------------------------
- String String String False False
- Number Number if Number False False
- can be
- converted,
- else false
-Type Array False False Array False
-Requested Scalar Scalar Scalar False False
- Undefined String Number Array Undefined
- Value False False False False
- cookie
+ String Strnum Number Regex Array Undefined
+-------------------------------------------------------------------------------
+ String String String String String false false
+ Strnum false Strnum Strnum false false false
+ Number Number Number Number false false false
+Type Regex false false false Regex false false
+Requested Array false false false false Array false
+ Scalar Scalar Scalar Scalar Scalar false false
+ Undefined String Strnum Number Regex Array Undefined
+ Value false false false false false false
+ cookie
Table 16.1: API value types returned
@@ -23936,11 +24893,6 @@ termed a "symbol table". The functions are as follows:
However, with the exception of the 'PROCINFO' array, an extension cannot
change any of those variables.
- CAUTION: It is possible for the lookup of 'PROCINFO' to fail. This
- happens if the 'awk' program being run does not reference
- 'PROCINFO'; in this case, 'gawk' doesn't bother to create the array
- and populate it.
-

File: gawk.info, Node: Symbol table by cookie, Next: Cached values, Prev: Symbol table by name, Up: Symbol Table Access
@@ -23964,8 +24916,9 @@ was discussed earlier, in *note General Data Types::.
'awk_bool_t sym_update_scalar(awk_scalar_t cookie, awk_value_t *value);'
Update the value associated with a scalar cookie. Return false if
- the new value is not of type 'AWK_STRING' or 'AWK_NUMBER'. Here
- too, the predefined variables may not be updated.
+ the new value is not of type 'AWK_STRING', 'AWK_STRNUM',
+ 'AWK_REGEX', or 'AWK_NUMBER'. Here too, the predefined variables
+ may not be updated.
It is not obvious at first glance how to work with scalar cookies or
what their raison d'e^tre really is. In theory, the 'sym_lookup()' and
@@ -24079,10 +25032,10 @@ follows:
'awk_bool_t create_value(awk_value_t *value, awk_value_cookie_t *result);'
Create a cached string or numeric value from 'value' for efficient
- later assignment. Only values of type 'AWK_NUMBER' and
- 'AWK_STRING' are allowed. Any other type is rejected.
- 'AWK_UNDEFINED' could be allowed, but doing so would result in
- inferior performance.
+ later assignment. Only values of type 'AWK_NUMBER', 'AWK_REGEX',
+ 'AWK_STRNUM', and 'AWK_STRING' are allowed. Any other type is
+ rejected. 'AWK_UNDEFINED' could be allowed, but doing so would
+ result in inferior performance.
'awk_bool_t release_value(awk_value_cookie_t vc);'
Release the memory associated with a value cookie obtained from
@@ -24152,7 +25105,7 @@ using 'release_value()'.
'double' to store.

-File: gawk.info, Node: Array Manipulation, Next: Extension API Variables, Prev: Symbol Table Access, Up: Extension API Description
+File: gawk.info, Node: Array Manipulation, Next: Redirection API, Prev: Symbol Table Access, Up: Extension API Description
16.4.11 Array Manipulation
--------------------------
@@ -24309,12 +25262,21 @@ The following functions relate to individual array elements:
array, but after calling this function, it has no elements. This
is equivalent to using the 'delete' statement (*note Delete::).
+'awk_bool_t flatten_array_typed(awk_array_t a_cookie, awk_flat_array_t **data, awk_valtype_t index_type, awk_valtype_t value_type);'
+ For the array represented by 'a_cookie', create an
+ 'awk_flat_array_t' structure and fill it in with indices and values
+ of the requested types. Set the pointer whose address is passed as
+ 'data' to point to this structure. Return true upon success, or
+ false otherwise. *Note Flattening Arrays::, for a discussion of
+ how to flatten an array and work with it.
+
'awk_bool_t flatten_array(awk_array_t a_cookie, awk_flat_array_t **data);'
For the array represented by 'a_cookie', create an
- 'awk_flat_array_t' structure and fill it in. Set the pointer whose
- address is passed as 'data' to point to this structure. Return
- true upon success, or false otherwise. *Note Flattening Arrays::,
- for a discussion of how to flatten an array and work with it.
+ 'awk_flat_array_t' structure and fill it in with 'AWK_STRING'
+ indices and 'AWK_UNDEFINED' values. This is superseded by
+ 'flatten_array_typed()'. It is provided as a macro, and remains
+ for convenience and for source code compatibility with the previous
+ version of the API.
'awk_bool_t release_flattened_array(awk_array_t a_cookie,'
' awk_flat_array_t *data);'
@@ -24416,7 +25378,7 @@ count of elements in the array and print it:
double-check that the count in the 'awk_flat_array_t' is the same as the
count just retrieved:
- if (! flatten_array(value2.array_cookie, & flat_array)) {
+ if (! flatten_array_typed(value2.array_cookie, & flat_array, AWK_STRING, AWK_UNDEFINED)) {
printf("dump_array_and_delete: could not flatten array\n");
goto out;
}
@@ -24636,9 +25598,78 @@ array:
environment variable.)

-File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Array Manipulation, Up: Extension API Description
+File: gawk.info, Node: Redirection API, Next: Extension API Variables, Prev: Array Manipulation, Up: Extension API Description
+
+16.4.12 Accessing and Manipulating Redirections
+-----------------------------------------------
+
+The following function allows extensions to access and manipulate
+redirections.
+
+'awk_bool_t get_file(const char *name,'
+' size_t name_len,'
+' const char *filetype,'
+' int fd,'
+' const awk_input_buf_t **ibufp,'
+' const awk_output_buf_t **obufp);'
+ Look up file 'name' in 'gawk''s internal redirection table. If
+ 'name' is 'NULL' or 'name_len' is zero, return data for the
+ currently open input file corresponding to 'FILENAME'. (This does
+ not access the 'filetype' argument, so that may be undefined). If
+ the file is not already open, attempt to open it. The 'filetype'
+ argument must be zero-terminated and should be one of:
+
+ '">"'
+ A file opened for output.
+
+ '">>"'
+ A file opened for append.
+
+ '"<"'
+ A file opened for input.
+
+ '"|>"'
+ A pipe opened for output.
+
+ '"|<"'
+ A pipe opened for input.
+
+ '"|&"'
+ A two-way coprocess.
+
+ On error, return an 'awk_false' value. Otherwise, return
+ 'awk_true', and return additional information about the redirection
+ in the 'ibufp' and 'obufp' pointers. For input redirections, the
+ '*ibufp' value should be non-'NULL', and '*obufp' should be 'NULL'.
+ For output redirections, the '*obufp' value should be non-'NULL',
+ and '*ibufp' should be 'NULL'. For two-way coprocesses, both
+ values should be non-'NULL'.
+
+ In the usual case, the extension is interested in '(*ibufp)->fd'
+ and/or 'fileno((*obufp)->fp)'. If the file is not already open,
+ and the 'fd' argument is nonnegative, 'gawk' will use that file
+ descriptor instead of opening the file in the usual way. If 'fd'
+ is nonnegative, but the file exists already, 'gawk' ignores 'fd'
+ and returns the existing file. It is the caller's responsibility
+ to notice that neither the 'fd' in the returned 'awk_input_buf_t'
+ nor the 'fd' in the returned 'awk_output_buf_t' matches the
+ requested value.
+
+ Note that supplying a file descriptor is currently _not_ supported
+ for pipes. However, supplying a file descriptor should work for
+ input, output, append, and two-way (coprocess) sockets. If
+ 'filetype' is two-way, 'gawk' assumes that it is a socket! Note
+ that in the two-way case, the input and output file descriptors may
+ differ. To check for success, you must check whether either
+ matches.
+
+ It is anticipated that this API function will be used to implement
+I/O multiplexing and a socket library.
+
+
+File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Redirection API, Up: Extension API Description
-16.4.12 API Variables
+16.4.13 API Variables
---------------------
The API provides two sets of variables. The first provides information
@@ -24655,7 +25686,7 @@ information about how 'gawk' was invoked.

File: gawk.info, Node: Extension Versioning, Next: Extension API Informational Variables, Up: Extension API Variables
-16.4.12.1 API Version Constants and Variables
+16.4.13.1 API Version Constants and Variables
.............................................
The API provides both a "major" and a "minor" version number. The API
@@ -24663,10 +25694,10 @@ versions are available at compile time as C preprocessor defines to
support conditional compilation, and as enum constants to facilitate
debugging:
-API Version C preprocessor define enum constant
----------------------------------------------------------------------------
-Major gawk_api_major_version GAWK_API_MAJOR_VERSION
-Minor gawk_api_minor_version GAWK_API_MINOR_VERSION
+API Version C Preprocessor Define enum constant
+--------------------------------------------------------------------
+Major 'gawk_api_major_version' 'GAWK_API_MAJOR_VERSION'
+Minor 'gawk_api_minor_version' 'GAWK_API_MINOR_VERSION'
Table 16.2: gawk API version constants
@@ -24683,10 +25714,10 @@ For this reason, the major and minor API versions of the running 'gawk'
are included in the API 'struct' as read-only constant integers:
'api->major_version'
- The major version of the running 'gawk'
+ The major version of the running 'gawk'.
'api->minor_version'
- The minor version of the running 'gawk'
+ The minor version of the running 'gawk'.
It is up to the extension to decide if there are API
incompatibilities. Typically, a check like this is enough:
@@ -24707,7 +25738,7 @@ Boilerplate::).

File: gawk.info, Node: Extension API Informational Variables, Prev: Extension Versioning, Up: Extension API Variables
-16.4.12.2 Informational Variables
+16.4.13.2 Informational Variables
.................................
The API provides access to several variables that describe whether the
@@ -24740,9 +25771,9 @@ predefined variable (*note Built-in Variables::). The others should not
change during execution.

-File: gawk.info, Node: Extension API Boilerplate, Prev: Extension API Variables, Up: Extension API Description
+File: gawk.info, Node: Extension API Boilerplate, Next: Changes from API V1, Prev: Extension API Variables, Up: Extension API Description
-16.4.13 Boilerplate Code
+16.4.14 Boilerplate Code
------------------------
As mentioned earlier (*note Extension Mechanism Outline::), the function
@@ -24760,7 +25791,7 @@ the 'gawkapi.h' header file:
static const char *ext_version = NULL; /* or ... = "some string" */
static awk_ext_func_t func_table[] = {
- { "name", do_name, 1 },
+ { "name", do_name, 1, 0, awk_false, NULL },
/* ... */
};
@@ -24841,6 +25872,22 @@ does the following:
'gawk'.

+File: gawk.info, Node: Changes from API V1, Prev: Extension API Boilerplate, Up: Extension API Description
+
+16.4.15 Changes From Version 1 of the API
+-----------------------------------------
+
+The current API is _not_ binary compatible with version 1 of the API.
+You will have to recompile your extensions in order to use them with the
+current version of 'gawk'.
+
+ Fortunately, at the possible expense of some compile-time warnings,
+the API remains source-code-compatible with the previous API. The major
+differences are the additional members in the 'awk_ext_func_t'
+structure, and the addition of the third argument to the C
+implementation function.
+
+
File: gawk.info, Node: Finding Extensions, Next: Extension Example, Prev: Extension API Description, Up: Dynamic Extensions
16.5 How 'gawk' Finds Extensions
@@ -25057,24 +26104,20 @@ is a pointer to an 'awk_value_t' structure, usually named 'result':
/* do_chdir --- provide dynamically loaded chdir() function for gawk */
static awk_value_t *
- do_chdir(int nargs, awk_value_t *result)
+ do_chdir(int nargs, awk_value_t *result, struct awk_ext_func *unused)
{
awk_value_t newdir;
int ret = -1;
assert(result != NULL);
- if (do_lint && nargs != 1)
- lintwarn(ext_id,
- _("chdir: called with incorrect number of arguments, "
- "expecting 1"));
-
The 'newdir' variable represents the new directory to change to,
which is retrieved with 'get_argument()'. Note that the first argument
is numbered zero.
If the argument is retrieved successfully, the function calls the
-'chdir()' system call. If the 'chdir()' fails, 'ERRNO' is updated:
+'chdir()' system call. Otherwise, if the 'chdir()' fails, it updates
+'ERRNO':
if (get_argument(0, AWK_STRING, & newdir)) {
ret = chdir(newdir.str_value.str);
@@ -25261,7 +26304,7 @@ declarations and argument checking:
/* do_stat --- provide a stat() function for gawk */
static awk_value_t *
- do_stat(int nargs, awk_value_t *result)
+ do_stat(int nargs, awk_value_t *result, struct awk_ext_func *unused)
{
awk_value_t file_param, array_param;
char *name;
@@ -25273,13 +26316,6 @@ declarations and argument checking:
assert(result != NULL);
- if (nargs != 2 && nargs != 3) {
- if (do_lint)
- lintwarn(ext_id,
- _("stat: called with wrong number of arguments"));
- return make_number(-1, result);
- }
-
Then comes the actual work. First, the function gets the arguments.
Next, it gets the information for the file. If the called function
('lstat()' or 'stat()') returns an error, the code sets 'ERRNO' and
@@ -25336,11 +26372,9 @@ there is an initialization function:
for loading each function into 'gawk':
static awk_ext_func_t func_table[] = {
- { "chdir", do_chdir, 1 },
- { "stat", do_stat, 2 },
- #ifndef __MINGW32__
- { "fts", do_fts, 3 },
- #endif
+ { "chdir", do_chdir, 1, 1, awk_false, NULL },
+ { "stat", do_stat, 3, 2, awk_false, NULL },
+ ...
};
Each extension must have a routine named 'dl_load()' to load
@@ -26070,15 +27104,17 @@ project.
* GD graphics library extension
+ * MPFR library extension (this provides access to a number of MPFR
+ functions that 'gawk''s native MPFR support does not)
+
* PDF extension
* PostgreSQL extension
- * MPFR library extension (this provides access to a number of MPFR
- functions that 'gawk''s native MPFR support does not)
-
* Redis extension
+ * Select extension
+
* XML parser extension, using the Expat
(http://expat.sourceforge.net) XML parsing library
@@ -26156,7 +27192,7 @@ File: gawk.info, Node: Extension summary, Next: Extension Exercises, Prev: ga
exit callbacks, a version string, input parsers, output
wrappers, and two-way processors)
- * Printing fatal, warning, and "lint" warning messages
+ * Printing fatal, nonfatal, warning, and "lint" warning messages
* Updating 'ERRNO', or unsetting it
@@ -26491,6 +27527,9 @@ current version of 'gawk'.
- Directories on the command line produce a warning and are
skipped (*note Command-line directories::)
+ - Output with 'print' and 'printf' need not be fatal (*note
+ Nonfatal::)
+
* New keywords:
- The 'BEGINFILE' and 'ENDFILE' special patterns (*note
@@ -26540,6 +27579,9 @@ current version of 'gawk'.
- The 'bindtextdomain()', 'dcgettext()', and 'dcngettext()'
functions for internationalization (*note Programmer i18n::)
+ - The 'intdiv()' function for doing integer division and
+ remainder (*note Numeric Functions::)
+
* Changes and/or additions in the command-line options:
- The 'AWKPATH' environment variable for specifying a path
@@ -26550,16 +27592,16 @@ current version of 'gawk'.
- The '-b', '-c', '-C', '-d', '-D', '-e', '-E', '-g', '-h',
'-i', '-l', '-L', '-M', '-n', '-N', '-o', '-O', '-p', '-P',
- '-r', '-S', '-t', and '-V' short options. Also, the ability
- to use GNU-style long-named options that start with '--', and
- the '--assign', '--bignum', '--characters-as-bytes',
+ '-r', '-s', '-S', '-t', and '-V' short options. Also, the
+ ability to use GNU-style long-named options that start with
+ '--', and the '--assign', '--bignum', '--characters-as-bytes',
'--copyright', '--debug', '--dump-variables', '--exec',
'--field-separator', '--file', '--gen-pot', '--help',
'--include', '--lint', '--lint-old', '--load',
- '--non-decimal-data', '--optimize', '--posix',
- '--pretty-print', '--profile', '--re-interval', '--sandbox',
- '--source', '--traditional', '--use-lc-numeric', and
- '--version' long options (*note Options::).
+ '--non-decimal-data', '--optimize', '--no-optimize',
+ '--posix', '--pretty-print', '--profile', '--re-interval',
+ '--sandbox', '--source', '--traditional', '--use-lc-numeric',
+ and '--version' long options (*note Options::).
* Support for the following obsolete systems was removed from the
code and the documentation for 'gawk' version 4.0:
@@ -26593,6 +27635,13 @@ current version of 'gawk'.
- Ultrix
+ * Support for the following systems was removed from the code for
+ 'gawk' version 4.2:
+
+ - MirBSD
+
+ - GNU/Linux on Alpha
+

File: gawk.info, Node: Feature History, Next: Common Extensions, Prev: POSIX/GNU, Up: Language History
@@ -26984,6 +28033,36 @@ POSIX 'awk', in the order they were added to 'gawk'.
* Support for Ultrix was removed.
+ Version 4.2 introduced the following changes:
+
+ * Changes to 'ENVIRON' are reflected into 'gawk''s environment and
+ that of programs that it runs. *Note Auto-set::.
+
+ * The 'PROCINFO["argv"' array. *Note Auto-set::.
+
+ * The '--pretty-print' option no longer runs the 'awk' program too.
+ *Note Options::.
+
+ * The 'igawk' program and its manual page are no longer installed
+ when 'gawk' is built. *Note Igawk Program::.
+
+ * The 'intdiv()' function. *Note Numeric Functions::.
+
+ * The maximum number of hexadecimal digits in '\x' escapes is now
+ two. *Note Escape Sequences::.
+
+ * Nonfatal output with 'print' and 'printf'. *Note Nonfatal::.
+
+ * For many years, POSIX specified that default field splitting only
+ allowed spaces and tabs to separate fields, and this was how 'gawk'
+ behaved with '--posix'. As of 2013, the standard restored
+ historical behavior, and now default field splitting with '--posix'
+ also allows newlines to separate fields.
+
+ * Support for MirBSD was removed.
+
+ * Support for GNU/Linux on Alpha was removed.
+

File: gawk.info, Node: Common Extensions, Next: Ranges and Locales, Prev: Feature History, Up: Language History
@@ -27098,7 +28177,7 @@ ranges, such that outside the '"C"' and '"POSIX"' locales, the meaning
of range expressions was _undefined_.(3)
By using this lovely technical term, the standard gives license to
-implementors to implement ranges in whatever way they choose. The
+implementers to implement ranges in whatever way they choose. The
'gawk' maintainer chose to apply the pre-POSIX meaning both with the
default regexp matching and when '--traditional' or '--posix' are used.
In all cases 'gawk' remains POSIX-compliant.
@@ -27412,6 +28491,12 @@ to different non-Unix operating systems:
Various '.c', '.y', and '.h' files
These files contain the actual 'gawk' source code.
+'support/*'
+ C header and source files for routines that 'gawk' uses, but that
+ are not part of its core functionality. For example, argument
+ parsing, regular expression matching, and random number generating
+ routines are all kept here.
+
'ABOUT-NLS'
A file containing information about GNU 'gettext' and translations.
@@ -27502,7 +28587,9 @@ Various '.c', '.y', and '.h' files
'doc/igawk.1'
The 'troff' source for a manual page describing the 'igawk' program
- presented in *note Igawk Program::.
+ presented in *note Igawk Program::. (Since 'gawk' can do its own
+ '@include' processing, neither 'igawk' nor 'igawk.1' are
+ installed.)
'doc/Makefile.in'
The input file used during the configuration process to generate
@@ -27544,17 +28631,22 @@ Various '.c', '.y', and '.h' files
contains a 'Makefile.in' file, which 'configure' uses to generate a
'Makefile'. 'Makefile.am' is used by GNU Automake to create
'Makefile.in'. The library functions from *note Library
- Functions::, and the 'igawk' program from *note Igawk Program:: are
- included as ready-to-use files in the 'gawk' distribution. They
- are installed as part of the installation process. The rest of the
- programs in this Info file are available in appropriate
- subdirectories of 'awklib/eg'.
+ Functions::, are included as ready-to-use files in the 'gawk'
+ distribution. They are installed as part of the installation
+ process. The rest of the programs in this Info file are available
+ in appropriate subdirectories of 'awklib/eg'.
'extension/*'
The source code, manual pages, and infrastructure files for the
sample extensions included with 'gawk'. *Note Dynamic
Extensions::, for more information.
+'extras/*'
+ Additional non-essential files. Currently, this directory contains
+ some shell startup files to be installed in '/etc/profile.d' to aid
+ in manipulating the 'AWKPATH' and 'AWKLIBPATH' environment
+ variables. *Note Shell Startup Files::, for more information.
+
'posix/*'
Files needed for building 'gawk' on POSIX-compliant systems.
@@ -27585,11 +28677,12 @@ for your system yourself.
* Menu:
* Quick Installation:: Compiling 'gawk' under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.

-File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation
+File: gawk.info, Node: Quick Installation, Next: Shell Startup Files, Up: Unix Installation
B.2.1 Compiling 'gawk' for Unix-Like Systems
--------------------------------------------
@@ -27644,9 +28737,42 @@ will be asked for your password, and you will have to have been set up
previously as a user who is allowed to run the 'sudo' command.

-File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Quick Installation, Up: Unix Installation
+File: gawk.info, Node: Shell Startup Files, Next: Additional Configuration Options, Prev: Quick Installation, Up: Unix Installation
+
+B.2.2 Shell Startup Files
+-------------------------
+
+The distribution contains shell startup files 'gawk.sh' and 'gawk.csh',
+containing functions to aid in manipulating the 'AWKPATH' and
+'AWKLIBPATH' environment variables. On a Fedora GNU/Linux system, these
+files should be installed in '/etc/profile.d'; on other platforms, the
+appropriate location may be different.
-B.2.2 Additional Configuration Options
+'gawkpath_default'
+ Reset the 'AWKPATH' environment variable to its default value.
+
+'gawkpath_prepend'
+ Add the argument to the front of the 'AWKPATH' environment
+ variable.
+
+'gawkpath_append'
+ Add the argument to the end of the 'AWKPATH' environment variable.
+
+'gawklibpath_default'
+ Reset the 'AWKLIBPATH' environment variable to its default value.
+
+'gawklibpath_prepend'
+ Add the argument to the front of the 'AWKLIBPATH' environment
+ variable.
+
+'gawklibpath_append'
+ Add the argument to the end of the 'AWKLIBPATH' environment
+ variable.
+
+
+File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Shell Startup Files, Up: Unix Installation
+
+B.2.3 Additional Configuration Options
--------------------------------------
There are several additional options you may use on the 'configure'
@@ -27675,6 +28801,11 @@ command line when compiling 'gawk' from scratch, including:
test suite to fail. This option may be removed at a later
date.
+'--disable-mpfr'
+ Skip checking for the MPFR and GMP libraries. This is useful
+ mainly for the developers, to make sure nothing breaks if MPFR
+ support is not available.
+
'--disable-nls'
Disable all message-translation facilities. This is usually not
desirable, but it may bring you some slight performance
@@ -27690,7 +28821,7 @@ supplied by 'configure'.

File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation
-B.2.3 The Configuration Process
+B.2.4 The Configuration Process
-------------------------------
This minor node is of interest only if you know something about using
@@ -31529,7 +32660,7 @@ Index
* * (asterisk), * operator, as regexp operator: Regexp Operators.
(line 89)
* * (asterisk), * operator, null strings, matching: String Functions.
- (line 537)
+ (line 539)
* * (asterisk), ** operator: Arithmetic Ops. (line 81)
* * (asterisk), ** operator <1>: Precedence. (line 48)
* * (asterisk), **= operator: Assignment Ops. (line 129)
@@ -31554,7 +32685,7 @@ Index
* - (hyphen), filenames beginning with: Options. (line 60)
* - (hyphen), in bracket expressions: Bracket Expressions. (line 25)
* --assign option: Options. (line 32)
-* --bignum option: Options. (line 203)
+* --bignum option: Options. (line 217)
* --characters-as-bytes option: Options. (line 69)
* --copyright option: Options. (line 89)
* --debug option: Options. (line 108)
@@ -31562,35 +32693,38 @@ Index
(line 9)
* --disable-lint configuration option: Additional Configuration Options.
(line 15)
-* --disable-nls configuration option: Additional Configuration Options.
+* --disable-mpfr configuration option: Additional Configuration Options.
(line 32)
+* --disable-nls configuration option: Additional Configuration Options.
+ (line 37)
* --dump-variables option: Options. (line 94)
* --dump-variables option, using for library functions: Library Names.
(line 45)
-* --exec option: Options. (line 125)
+* --exec option: Options. (line 139)
* --field-separator option: Options. (line 21)
* --file option: Options. (line 25)
-* --gen-pot option: Options. (line 147)
+* --gen-pot option: Options. (line 161)
* --gen-pot option <1>: String Extraction. (line 6)
* --gen-pot option <2>: String Extraction. (line 6)
-* --help option: Options. (line 154)
-* --include option: Options. (line 159)
+* --help option: Options. (line 168)
+* --include option: Options. (line 173)
* --lint option: Command Line. (line 20)
-* --lint option <1>: Options. (line 184)
-* --lint-old option: Options. (line 294)
-* --load option: Options. (line 172)
-* --non-decimal-data option: Options. (line 209)
+* --lint option <1>: Options. (line 198)
+* --lint-old option: Options. (line 313)
+* --load option: Options. (line 186)
+* --no-optimize option: Options. (line 299)
+* --non-decimal-data option: Options. (line 223)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 35)
-* --optimize option: Options. (line 236)
-* --posix option: Options. (line 254)
-* --posix option, --traditional option and: Options. (line 272)
-* --pretty-print option: Options. (line 223)
-* --profile option: Options. (line 242)
+* --optimize option: Options. (line 248)
+* --posix option: Options. (line 271)
+* --posix option, --traditional option and: Options. (line 286)
+* --pretty-print option: Options. (line 237)
+* --profile option: Options. (line 259)
* --profile option <1>: Profiling. (line 12)
-* --re-interval option: Options. (line 278)
-* --sandbox option: Options. (line 285)
+* --re-interval option: Options. (line 292)
+* --sandbox option: Options. (line 304)
* --sandbox option, disabling system() function: I/O Functions.
(line 129)
* --sandbox option, input redirection with getline: Getline. (line 19)
@@ -31598,43 +32732,44 @@ Index
(line 6)
* --source option: Options. (line 117)
* --traditional option: Options. (line 82)
-* --traditional option, --posix option and: Options. (line 272)
-* --use-lc-numeric option: Options. (line 218)
-* --version option: Options. (line 299)
+* --traditional option, --posix option and: Options. (line 286)
+* --use-lc-numeric option: Options. (line 232)
+* --version option: Options. (line 318)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
- (line 37)
+ (line 42)
* -b option: Options. (line 69)
* -c option: Options. (line 82)
* -C option: Options. (line 89)
* -d option: Options. (line 94)
* -D option: Options. (line 108)
* -e option: Options. (line 117)
-* -E option: Options. (line 125)
-* -e option <1>: Options. (line 335)
+* -E option: Options. (line 139)
+* -e option <1>: Options. (line 354)
* -f option: Long. (line 12)
* -F option: Options. (line 21)
* -f option <1>: Options. (line 25)
-* -F option, -Ft sets FS to TAB: Options. (line 307)
+* -F option, -Ft sets FS to TAB: Options. (line 326)
* -F option, command-line: Command Line Field Separator.
(line 6)
-* -f option, multiple uses: Options. (line 312)
-* -g option: Options. (line 147)
-* -h option: Options. (line 154)
-* -i option: Options. (line 159)
-* -l option: Options. (line 172)
-* -l option <1>: Options. (line 184)
-* -L option: Options. (line 294)
-* -M option: Options. (line 203)
-* -n option: Options. (line 209)
-* -N option: Options. (line 218)
-* -o option: Options. (line 223)
-* -O option: Options. (line 236)
-* -p option: Options. (line 242)
-* -P option: Options. (line 254)
-* -r option: Options. (line 278)
-* -S option: Options. (line 285)
+* -f option, multiple uses: Options. (line 331)
+* -g option: Options. (line 161)
+* -h option: Options. (line 168)
+* -i option: Options. (line 173)
+* -l option: Options. (line 186)
+* -l option <1>: Options. (line 198)
+* -L option: Options. (line 313)
+* -M option: Options. (line 217)
+* -n option: Options. (line 223)
+* -N option: Options. (line 232)
+* -o option: Options. (line 237)
+* -O option: Options. (line 248)
+* -p option: Options. (line 259)
+* -P option: Options. (line 271)
+* -r option: Options. (line 292)
+* -s option: Options. (line 299)
+* -S option: Options. (line 304)
* -v option: Options. (line 32)
-* -V option: Options. (line 299)
+* -V option: Options. (line 318)
* -v option <1>: Assignment Options. (line 12)
* -W option: Options. (line 47)
* . (period), regexp operator: Regexp Operators. (line 44)
@@ -31707,16 +32842,16 @@ Index
(line 6)
* \ (backslash), in bracket expressions: Bracket Expressions. (line 25)
* \ (backslash), in escape sequences: Escape Sequences. (line 6)
-* \ (backslash), in escape sequences <1>: Escape Sequences. (line 100)
+* \ (backslash), in escape sequences <1>: Escape Sequences. (line 103)
* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
- (line 105)
+ (line 108)
* \ (backslash), in regexp constants: Computed Regexps. (line 30)
* \ (backslash), in shell commands: Quoting. (line 48)
* \ (backslash), regexp operator: Regexp Operators. (line 18)
-* \ (backslash), \" escape sequence: Escape Sequences. (line 82)
+* \ (backslash), \" escape sequence: Escape Sequences. (line 85)
* \ (backslash), \' operator (gawk): GNU Regexp Operators.
(line 59)
-* \ (backslash), \/ escape sequence: Escape Sequences. (line 73)
+* \ (backslash), \/ escape sequence: Escape Sequences. (line 76)
* \ (backslash), \< operator (gawk): GNU Regexp Operators.
(line 33)
* \ (backslash), \> operator (gawk): GNU Regexp Operators.
@@ -31893,7 +33028,7 @@ Index
* arrays, unassigned elements: Reference to Elements.
(line 18)
* artificial intelligence, gawk and: Distribution contents.
- (line 52)
+ (line 58)
* ASCII: Ordinal Functions. (line 45)
* ASCII <1>: Glossary. (line 196)
* asort: String Functions. (line 42)
@@ -31921,7 +33056,7 @@ Index
* asterisk (*), * operator, as regexp operator: Regexp Operators.
(line 89)
* asterisk (*), * operator, null strings, matching: String Functions.
- (line 537)
+ (line 539)
* asterisk (*), ** operator: Arithmetic Ops. (line 81)
* asterisk (*), ** operator <1>: Precedence. (line 48)
* asterisk (*), **= operator: Assignment Ops. (line 129)
@@ -31933,7 +33068,7 @@ Index
* awf (amazingly workable formatter) program: Glossary. (line 24)
* awk debugging, enabling: Options. (line 108)
* awk language, POSIX version: Assignment Ops. (line 138)
-* awk profiling, enabling: Options. (line 242)
+* awk profiling, enabling: Options. (line 259)
* awk programs: Getting Started. (line 12)
* awk programs <1>: Executable Scripts. (line 6)
* awk programs <2>: Two Rules. (line 6)
@@ -31947,8 +33082,8 @@ Index
* awk programs, lengthy: Long. (line 6)
* awk programs, lengthy, assertions: Assert Function. (line 6)
* awk programs, location of: Options. (line 25)
-* awk programs, location of <1>: Options. (line 125)
-* awk programs, location of <2>: Options. (line 159)
+* awk programs, location of <1>: Options. (line 139)
+* awk programs, location of <2>: Options. (line 173)
* awk programs, one-line examples: Very Simple. (line 46)
* awk programs, profiling: Profiling. (line 6)
* awk programs, running: Running gawk. (line 6)
@@ -32004,16 +33139,16 @@ Index
(line 6)
* backslash (\), in bracket expressions: Bracket Expressions. (line 25)
* backslash (\), in escape sequences: Escape Sequences. (line 6)
-* backslash (\), in escape sequences <1>: Escape Sequences. (line 100)
+* backslash (\), in escape sequences <1>: Escape Sequences. (line 103)
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
- (line 105)
+ (line 108)
* backslash (\), in regexp constants: Computed Regexps. (line 30)
* backslash (\), in shell commands: Quoting. (line 48)
* backslash (\), regexp operator: Regexp Operators. (line 18)
-* backslash (\), \" escape sequence: Escape Sequences. (line 82)
+* backslash (\), \" escape sequence: Escape Sequences. (line 85)
* backslash (\), \' operator (gawk): GNU Regexp Operators.
(line 59)
-* backslash (\), \/ escape sequence: Escape Sequences. (line 73)
+* backslash (\), \/ escape sequence: Escape Sequences. (line 76)
* backslash (\), \< operator (gawk): GNU Regexp Operators.
(line 33)
* backslash (\), \> operator (gawk): GNU Regexp Operators.
@@ -32083,7 +33218,7 @@ Index
* BINMODE variable: User-modified. (line 15)
* BINMODE variable <1>: PC Using. (line 16)
* bit-manipulation functions: Bitwise Functions. (line 6)
-* bits2str() user-defined function: Bitwise Functions. (line 72)
+* bits2str() user-defined function: Bitwise Functions. (line 69)
* bitwise AND: Bitwise Functions. (line 40)
* bitwise complement: Bitwise Functions. (line 44)
* bitwise OR: Bitwise Functions. (line 50)
@@ -32132,7 +33267,7 @@ Index
* Brennan, Michael <5>: Other Versions. (line 6)
* Brennan, Michael <6>: Other Versions. (line 48)
* Brian Kernighan's awk: When. (line 21)
-* Brian Kernighan's awk <1>: Escape Sequences. (line 109)
+* Brian Kernighan's awk <1>: Escape Sequences. (line 112)
* Brian Kernighan's awk <2>: GNU Regexp Operators.
(line 85)
* Brian Kernighan's awk <3>: Regexp Field Splitting.
@@ -32144,7 +33279,7 @@ Index
* Brian Kernighan's awk <8>: Continue Statement. (line 44)
* Brian Kernighan's awk <9>: Nextfile Statement. (line 47)
* Brian Kernighan's awk <10>: Delete. (line 51)
-* Brian Kernighan's awk <11>: String Functions. (line 493)
+* Brian Kernighan's awk <11>: String Functions. (line 495)
* Brian Kernighan's awk <12>: Gory Details. (line 19)
* Brian Kernighan's awk <13>: I/O Functions. (line 43)
* Brian Kernighan's awk, extensions: BTL. (line 6)
@@ -32184,14 +33319,14 @@ Index
* caret (^), ^= operator: Assignment Ops. (line 129)
* caret (^), ^= operator <1>: Precedence. (line 94)
* case keyword: Switch Statement. (line 6)
-* case sensitivity, and regexps: User-modified. (line 76)
-* case sensitivity, and string comparisons: User-modified. (line 76)
+* case sensitivity, and regexps: User-modified. (line 79)
+* case sensitivity, and string comparisons: User-modified. (line 79)
* case sensitivity, array indices and: Array Intro. (line 100)
-* case sensitivity, converting case: String Functions. (line 523)
+* case sensitivity, converting case: String Functions. (line 525)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
-* CGI, awk scripts for: Options. (line 125)
+* CGI, awk scripts for: Options. (line 139)
* character classes, See bracket expressions: Regexp Operators.
(line 56)
* character lists in regular expression: Bracket Expressions. (line 6)
@@ -32207,6 +33342,7 @@ Index
* Chassell, Robert J.: Acknowledgments. (line 33)
* chdir() extension function: Extension Sample File Functions.
(line 12)
+* checking for MPFR: Checking for MPFR. (line 6)
* chem utility: Glossary. (line 206)
* chr() extension function: Extension Sample Ord.
(line 15)
@@ -32236,6 +33372,7 @@ Index
* columns, cutting: Cut Program. (line 6)
* comma (,), in range patterns: Ranges. (line 6)
* command completion, in debugger: Readline Support. (line 6)
+* command line arguments, PROCINFO["argv": Auto-set. (line 154)
* command line, arguments: Other Arguments. (line 6)
* command line, arguments <1>: Auto-set. (line 15)
* command line, arguments <2>: ARGC and ARGV. (line 6)
@@ -32299,10 +33436,12 @@ Index
(line 9)
* configuration option, --disable-lint: Additional Configuration Options.
(line 15)
-* configuration option, --disable-nls: Additional Configuration Options.
+* configuration option, --disable-mpfr: Additional Configuration Options.
(line 32)
-* configuration option, --with-whiny-user-strftime: Additional Configuration Options.
+* configuration option, --disable-nls: Additional Configuration Options.
(line 37)
+* configuration option, --with-whiny-user-strftime: Additional Configuration Options.
+ (line 42)
* configuration options, gawk: Additional Configuration Options.
(line 6)
* constant regexps: Regexp Usage. (line 57)
@@ -32315,16 +33454,16 @@ Index
* control statements: Statements. (line 6)
* controlling array scanning order: Controlling Scanning.
(line 14)
-* convert string to lower case: String Functions. (line 524)
-* convert string to number: String Functions. (line 391)
-* convert string to upper case: String Functions. (line 530)
+* convert string to lower case: String Functions. (line 526)
+* convert string to number: String Functions. (line 393)
+* convert string to upper case: String Functions. (line 532)
* converting integer array subscripts: Numeric Array Subscripts.
(line 31)
-* converting, dates to timestamps: Time Functions. (line 76)
+* converting, dates to timestamps: Time Functions. (line 78)
* converting, numbers to strings: Strings And Numbers. (line 6)
-* converting, numbers to strings <1>: Bitwise Functions. (line 111)
+* converting, numbers to strings <1>: Bitwise Functions. (line 108)
* converting, strings to numbers: Strings And Numbers. (line 6)
-* converting, strings to numbers <1>: Bitwise Functions. (line 111)
+* converting, strings to numbers <1>: Bitwise Functions. (line 108)
* CONVFMT variable: Strings And Numbers. (line 29)
* CONVFMT variable <1>: User-modified. (line 30)
* CONVFMT variable, and array subscripts: Numeric Array Subscripts.
@@ -32339,11 +33478,11 @@ Index
* cosine: Numeric Functions. (line 16)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 43)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 353)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 372)
* csh utility, |& operator, comparison with: Two-way I/O. (line 27)
* ctime() user-defined function: Function Example. (line 74)
* currency symbols, localization: Explaining gettext. (line 104)
-* current system time: Time Functions. (line 66)
+* current system time: Time Functions. (line 68)
* custom.h file: Configuration Philosophy.
(line 30)
* customized input parser: Input Parsers. (line 6)
@@ -32369,12 +33508,12 @@ Index
* dark corner, CONVFMT variable: Strings And Numbers. (line 39)
* dark corner, escape sequences: Other Arguments. (line 38)
* dark corner, escape sequences, for metacharacters: Escape Sequences.
- (line 141)
+ (line 144)
* dark corner, exit statement: Exit Statement. (line 30)
* dark corner, field separators: Full Line Fields. (line 22)
* dark corner, FILENAME variable: Getline Notes. (line 19)
-* dark corner, FILENAME variable <1>: Auto-set. (line 89)
-* dark corner, FNR/NR variables: Auto-set. (line 326)
+* dark corner, FILENAME variable <1>: Auto-set. (line 108)
+* dark corner, FNR/NR variables: Auto-set. (line 377)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, format-control characters <1>: Control Letters.
(line 93)
@@ -32390,13 +33529,13 @@ Index
* dark corner, OFMT variable: OFMT. (line 27)
* dark corner, regexp as second argument to index(): String Functions.
(line 164)
-* dark corner, regexp constants: Using Constant Regexps.
+* dark corner, regexp constants: Standard Regexp Constants.
(line 6)
* dark corner, regexp constants, /= operator and: Assignment Ops.
(line 149)
-* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
+* dark corner, regexp constants, as arguments to user-defined functions: Standard Regexp Constants.
(line 43)
-* dark corner, split() function: String Functions. (line 361)
+* dark corner, split() function: String Functions. (line 363)
* dark corner, strings, storing: gawk split records. (line 82)
* dark corner, value of ARGV[0]: Auto-set. (line 39)
* dark corner, ^, in FS: Regexp Field Splitting.
@@ -32406,8 +33545,8 @@ Index
* database, group, reading: Group Functions. (line 6)
* database, users, reading: Passwd Functions. (line 6)
* date utility, GNU: Time Functions. (line 17)
-* date utility, POSIX: Time Functions. (line 253)
-* dates, converting to timestamps: Time Functions. (line 76)
+* date utility, POSIX: Time Functions. (line 255)
+* dates, converting to timestamps: Time Functions. (line 78)
* dates, information related to, localization: Explaining gettext.
(line 112)
* Davies, Stephen: Acknowledgments. (line 60)
@@ -32528,7 +33667,7 @@ Index
* debugger, read commands from a file: Debugger Info. (line 97)
* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 269)
+* decimal point character, locale specific: Options. (line 283)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott: Acknowledgments. (line 60)
@@ -32569,17 +33708,17 @@ Index
(line 132)
* 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 87)
* differences in awk and gawk, error messages: Special FD. (line 19)
* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
(line 37)
-* differences in awk and gawk, FPAT variable: User-modified. (line 43)
-* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 115)
+* differences in awk and gawk, FPAT variable: User-modified. (line 46)
+* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 134)
* 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 76)
+ (line 79)
* differences in awk and gawk, implementation limitations: Getline Notes.
(line 14)
* differences in awk and gawk, implementation limitations <1>: Redirection.
@@ -32592,32 +33731,34 @@ Index
(line 96)
* differences in awk and gawk, line continuations: Conditional Exp.
(line 34)
-* differences in awk and gawk, LINT variable: User-modified. (line 87)
+* differences in awk and gawk, LINT variable: User-modified. (line 90)
* differences in awk and gawk, match() function: String Functions.
(line 262)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
-* differences in awk and gawk, PROCINFO array: Auto-set. (line 129)
+* differences in awk and gawk, PROCINFO array: Auto-set. (line 148)
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 124)
-* differences in awk and gawk, regexp constants: Using Constant Regexps.
+* differences in awk and gawk, regexp constants: Standard Regexp Constants.
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
+* differences in awk and gawk, retrying input: Retrying Input.
+ (line 6)
* differences in awk and gawk, RS/RT variables: gawk split records.
(line 58)
-* differences in awk and gawk, RT variable: Auto-set. (line 264)
+* differences in awk and gawk, RT variable: Auto-set. (line 315)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
- (line 348)
+ (line 350)
* differences in awk and gawk, strings: Scalar Constants. (line 20)
* differences in awk and gawk, strings, storing: gawk split records.
(line 76)
-* differences in awk and gawk, SYMTAB variable: Auto-set. (line 268)
+* differences in awk and gawk, SYMTAB variable: Auto-set. (line 319)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
- (line 152)
+ (line 155)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
(line 66)
* directories, command-line: Command-line directories.
@@ -32651,12 +33792,12 @@ Index
* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
* dupword.awk program: Dupword Program. (line 31)
-* dynamic profiling: Profiling. (line 178)
+* dynamic profiling: Profiling. (line 177)
* dynamically loaded extensions: Dynamic Extensions. (line 6)
* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
-* effective group ID of gawk user: Auto-set. (line 134)
-* effective user ID of gawk user: Auto-set. (line 138)
+* effective group ID of gawk user: Auto-set. (line 172)
+* effective user ID of gawk user: Auto-set. (line 180)
* egrep utility: Bracket Expressions. (line 34)
* egrep utility <1>: Egrep Program. (line 6)
* egrep.awk program: Egrep Program. (line 53)
@@ -32711,14 +33852,14 @@ Index
(line 11)
* equals sign (=), == operator <1>: Precedence. (line 64)
* EREs (Extended Regular Expressions): Bracket Expressions. (line 34)
-* ERRNO variable: Auto-set. (line 73)
+* ERRNO variable: Auto-set. (line 87)
* ERRNO variable <1>: TCP/IP Networking. (line 54)
* ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26)
* ERRNO variable, with close() function: Close Files And Pipes.
(line 140)
* ERRNO variable, with getline command: Getline. (line 19)
* error handling: Special FD. (line 19)
-* error handling, ERRNO variable and: Auto-set. (line 73)
+* error handling, ERRNO variable and: Auto-set. (line 87)
* error output: Special FD. (line 6)
* escape processing, gsub()/gensub()/sub() functions: Gory Details.
(line 6)
@@ -32759,7 +33900,7 @@ Index
(line 102)
* exp: Numeric Functions. (line 19)
* expand utility: Very Simple. (line 73)
-* Expat XML parser library: gawkextlib. (line 35)
+* Expat XML parser library: gawkextlib. (line 37)
* exponent: Numeric Functions. (line 19)
* expressions: Expressions. (line 6)
* expressions, as patterns: Expression Patterns. (line 6)
@@ -32778,7 +33919,7 @@ Index
(line 6)
* extension API version: Extension Versioning.
(line 6)
-* extension API, version number: Auto-set. (line 223)
+* extension API, version number: Auto-set. (line 266)
* extension example: Extension Example. (line 6)
* extension registration: Registration Functions.
(line 6)
@@ -32829,12 +33970,11 @@ Index
(line 6)
* field separator, POSIX and: Full Line Fields. (line 16)
* field separators: Field Separators. (line 15)
-* field separators <1>: User-modified. (line 50)
-* field separators <2>: User-modified. (line 113)
+* field separators <1>: User-modified. (line 53)
+* field separators <2>: User-modified. (line 116)
* field separators, choice of: Field Separators. (line 50)
* 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, FPAT variable and: User-modified. (line 46)
* field separators, regular expressions as: Field Separators. (line 50)
* field separators, regular expressions as <1>: Regexp Field Splitting.
(line 6)
@@ -32854,7 +33994,7 @@ Index
* fields, separating <1>: Field Separators. (line 15)
* fields, single-character: Single Character Fields.
(line 6)
-* FIELDWIDTHS variable: Constant Size. (line 22)
+* FIELDWIDTHS variable: Fixed width data. (line 17)
* FIELDWIDTHS variable <1>: User-modified. (line 37)
* file descriptors: Special FD. (line 6)
* file inclusion, @include directive: Include Files. (line 8)
@@ -32862,7 +34002,7 @@ Index
* file names, in compatibility mode: Special Caveats. (line 9)
* file names, standard streams in gawk: Special FD. (line 48)
* FILENAME variable: Reading Files. (line 6)
-* FILENAME variable <1>: Auto-set. (line 89)
+* FILENAME variable <1>: Auto-set. (line 108)
* FILENAME variable, getline, setting with: Getline Notes. (line 19)
* filenames, assignments as: Ignoring Assigns. (line 6)
* files, .gmo: Explaining gettext. (line 42)
@@ -32906,7 +34046,7 @@ Index
* files, portable object template: Explaining gettext. (line 31)
* files, portable object, converting to message object files: I18N Example.
(line 66)
-* files, portable object, generating: Options. (line 147)
+* files, portable object, generating: Options. (line 161)
* files, processing, ARGIND variable and: Auto-set. (line 50)
* files, reading: Rewind Function. (line 6)
* files, reading, multiline records: Multiple Line. (line 6)
@@ -32930,8 +34070,8 @@ Index
* fnmatch() extension function: Extension Sample Fnmatch.
(line 12)
* FNR variable: Records. (line 6)
-* FNR variable <1>: Auto-set. (line 99)
-* FNR variable, changing: Auto-set. (line 326)
+* FNR variable <1>: Auto-set. (line 118)
+* FNR variable, changing: Auto-set. (line 377)
* for statement: For Statement. (line 6)
* for statement, looping over arrays: Scanning an Array. (line 20)
* fork() extension function: Extension Sample Fork.
@@ -32941,11 +34081,11 @@ Index
(line 57)
* format specifiers, printf statement: Control Letters. (line 6)
* format specifiers, strftime() function (gawk): Time Functions.
- (line 89)
-* format time string: Time Functions. (line 48)
+ (line 91)
+* format time string: Time Functions. (line 50)
* formats, numeric output: OFMT. (line 6)
* formatting output: Printf. (line 6)
-* formatting strings: String Functions. (line 384)
+* formatting strings: String Functions. (line 386)
* forward slash (/) to enclose regular expressions: Regexp. (line 10)
* forward slash (/), / operator: Precedence. (line 54)
* forward slash (/), /= operator: Assignment Ops. (line 129)
@@ -32955,7 +34095,7 @@ Index
* forward slash (/), patterns and: Expression Patterns. (line 24)
* FPAT variable: Splitting By Content.
(line 25)
-* FPAT variable <1>: User-modified. (line 43)
+* FPAT variable <1>: User-modified. (line 46)
* frame debugger command: Execution Stack. (line 27)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 8)
@@ -32965,11 +34105,11 @@ Index
* Free Software Foundation (FSF) <3>: Glossary. (line 405)
* FreeBSD: Glossary. (line 748)
* FS variable: Field Separators. (line 15)
-* FS variable <1>: User-modified. (line 50)
+* FS variable <1>: User-modified. (line 53)
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
(line 20)
-* FS variable, as TAB character: Options. (line 266)
+* FS variable, as TAB character: Options. (line 280)
* FS variable, changing value of: Field Separators. (line 34)
* FS variable, running awk programs and: Cut Program. (line 63)
* FS variable, setting from command line: Command Line Field Separator.
@@ -32983,7 +34123,7 @@ Index
* FSF (Free Software Foundation) <3>: Glossary. (line 405)
* fts() extension function: Extension Sample File Functions.
(line 60)
-* FUNCTAB array: Auto-set. (line 115)
+* FUNCTAB array: Auto-set. (line 134)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function calls, indirect, @-notation for: Indirect Calls. (line 47)
@@ -33034,8 +34174,8 @@ Index
* G., Daniel Richard: Acknowledgments. (line 60)
* G., Daniel Richard <1>: Maintainers. (line 14)
* Garfinkle, Scott: Contributors. (line 35)
-* gawk program, dynamic profiling: Profiling. (line 178)
-* gawk version: Auto-set. (line 198)
+* gawk program, dynamic profiling: Profiling. (line 177)
+* gawk version: Auto-set. (line 241)
* gawk, ARGIND variable in: Other Arguments. (line 15)
* gawk, awk and: Preface. (line 21)
* gawk, awk and <1>: This Manual. (line 14)
@@ -33056,26 +34196,26 @@ Index
* gawk, ERRNO variable in <1>: Close Files And Pipes.
(line 140)
* gawk, ERRNO variable in <2>: BEGINFILE/ENDFILE. (line 26)
-* gawk, ERRNO variable in <3>: Auto-set. (line 73)
+* gawk, ERRNO variable in <3>: Auto-set. (line 87)
* gawk, ERRNO variable in <4>: TCP/IP Networking. (line 54)
-* gawk, escape sequences: Escape Sequences. (line 118)
-* gawk, extensions, disabling: Options. (line 254)
+* gawk, escape sequences: Escape Sequences. (line 121)
+* gawk, extensions, disabling: Options. (line 271)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
-* gawk, field separators and: User-modified. (line 71)
-* gawk, FIELDWIDTHS variable in: Constant Size. (line 22)
+* gawk, field separators and: User-modified. (line 74)
+* gawk, FIELDWIDTHS variable in: Fixed width data. (line 17)
* gawk, FIELDWIDTHS variable in <1>: User-modified. (line 37)
* gawk, file names in: Special Files. (line 6)
* gawk, format-control characters: Control Letters. (line 18)
* gawk, format-control characters <1>: Control Letters. (line 93)
* gawk, FPAT variable in: Splitting By Content.
(line 25)
-* gawk, FPAT variable in <1>: User-modified. (line 43)
-* gawk, FUNCTAB array in: Auto-set. (line 115)
+* gawk, FPAT variable in <1>: User-modified. (line 46)
+* gawk, FUNCTAB array in: Auto-set. (line 134)
* gawk, function arguments and: Calling Built-in. (line 16)
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 41)
* gawk, IGNORECASE variable in: Case-sensitivity. (line 26)
-* gawk, IGNORECASE variable in <1>: User-modified. (line 76)
+* gawk, IGNORECASE variable in <1>: User-modified. (line 79)
* gawk, IGNORECASE variable in <2>: Array Intro. (line 100)
* gawk, IGNORECASE variable in <3>: String Functions. (line 58)
* gawk, IGNORECASE variable in <4>: Array Sorting Functions.
@@ -33093,16 +34233,16 @@ Index
(line 6)
* gawk, interval expressions and: Regexp Operators. (line 139)
* gawk, line continuation in: Conditional Exp. (line 34)
-* gawk, LINT variable in: User-modified. (line 87)
+* gawk, LINT variable in: User-modified. (line 90)
* gawk, list of contributors to: Contributors. (line 6)
* gawk, MS-Windows version of: PC Using. (line 9)
* gawk, newlines in: Statements/Lines. (line 12)
* gawk, octal numbers and: Nondecimal-numbers. (line 41)
* gawk, predefined variables and: Built-in Variables. (line 14)
-* gawk, PROCINFO array in: Auto-set. (line 129)
-* gawk, PROCINFO array in <1>: Time Functions. (line 47)
-* gawk, PROCINFO array in <2>: Two-way I/O. (line 108)
-* gawk, regexp constants and: Using Constant Regexps.
+* gawk, PROCINFO array in: Auto-set. (line 148)
+* gawk, PROCINFO array in <1>: Time Functions. (line 49)
+* gawk, PROCINFO array in <2>: Two-way I/O. (line 114)
+* gawk, regexp constants and: Standard Regexp Constants.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
(line 26)
@@ -33111,25 +34251,32 @@ Index
* gawk, regular expressions, precedence: Regexp Operators. (line 161)
* gawk, RT variable in: awk split records. (line 124)
* gawk, RT variable in <1>: Multiple Line. (line 130)
-* gawk, RT variable in <2>: Auto-set. (line 264)
+* gawk, RT variable in <2>: Auto-set. (line 315)
* gawk, See Also awk: Preface. (line 34)
* gawk, source code, obtaining: Getting. (line 6)
-* gawk, splitting fields and: Constant Size. (line 86)
+* gawk, splitting fields and: Testing field creation.
+ (line 6)
* gawk, string-translation functions: I18N Functions. (line 6)
-* gawk, SYMTAB array in: Auto-set. (line 268)
-* gawk, TEXTDOMAIN variable in: User-modified. (line 152)
+* gawk, SYMTAB array in: Auto-set. (line 319)
+* gawk, TEXTDOMAIN variable in: User-modified. (line 155)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
-* gawk, versions of, information about, printing: Options. (line 299)
+* gawk, versions of, information about, printing: Options. (line 318)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 66)
* gawkextlib: gawkextlib. (line 6)
* gawkextlib project: gawkextlib. (line 6)
+* gawklibpath_append shell function: Shell Startup Files. (line 29)
+* gawklibpath_default shell function: Shell Startup Files. (line 22)
+* gawklibpath_prepend shell function: Shell Startup Files. (line 25)
+* gawkpath_append shell function: Shell Startup Files. (line 19)
+* gawkpath_default shell function: Shell Startup Files. (line 12)
+* gawkpath_prepend shell function: Shell Startup Files. (line 15)
* General Public License (GPL): Glossary. (line 396)
* General Public License, See GPL: Manual History. (line 11)
* generate time values: Time Functions. (line 25)
-* gensub: Using Constant Regexps.
+* gensub: Standard Regexp Constants.
(line 43)
* gensub <1>: String Functions. (line 89)
* gensub() function (gawk), escape processing: Gory Details. (line 6)
@@ -33179,7 +34326,7 @@ Index
* gettext() function (C library): Explaining gettext. (line 63)
* gettimeofday() extension function: Extension Sample Time.
(line 12)
-* git utility: gawkextlib. (line 29)
+* git utility: gawkextlib. (line 31)
* git utility <1>: Other Versions. (line 29)
* git utility <2>: Accessing The Source.
(line 10)
@@ -33193,7 +34340,7 @@ Index
* GNU Lesser General Public License: Glossary. (line 491)
* GNU long options: Command Line. (line 13)
* GNU long options <1>: Options. (line 6)
-* GNU long options, printing list of: Options. (line 154)
+* GNU long options, printing list of: Options. (line 168)
* GNU Project: Manual History. (line 11)
* GNU Project <1>: Glossary. (line 405)
* GNU/Linux: Manual History. (line 28)
@@ -33207,12 +34354,12 @@ Index
* Grigera, Juan: Contributors. (line 58)
* group database, reading: Group Functions. (line 6)
* group file: Group Functions. (line 6)
-* group ID of gawk user: Auto-set. (line 147)
+* group ID of gawk user: Auto-set. (line 190)
* groups, information about: Group Functions. (line 6)
-* gsub: Using Constant Regexps.
+* gsub: Standard Regexp Constants.
(line 43)
* gsub <1>: String Functions. (line 139)
-* gsub() function, arguments of: String Functions. (line 463)
+* gsub() function, arguments of: String Functions. (line 465)
* gsub() function, escape processing: Gory Details. (line 6)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 69)
@@ -33225,11 +34372,11 @@ Index
* help debugger command: Miscellaneous Debugger Commands.
(line 69)
* hexadecimal numbers: Nondecimal-numbers. (line 6)
-* hexadecimal values, enabling interpretation of: Options. (line 209)
+* hexadecimal values, enabling interpretation of: Options. (line 223)
* history expansion, in debugger: Readline Support. (line 6)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
-* HUP signal, for dynamic profiling: Profiling. (line 210)
+* HUP signal, for dynamic profiling: Profiling. (line 209)
* hyphen (-), - operator: Precedence. (line 51)
* hyphen (-), - operator <1>: Precedence. (line 57)
* hyphen (-), -- operator: Increment Ops. (line 48)
@@ -33247,7 +34394,7 @@ 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 76)
+* IGNORECASE variable: User-modified. (line 79)
* IGNORECASE variable, and array indices: Array Intro. (line 100)
* IGNORECASE variable, and array sorting functions: Array Sorting Functions.
(line 83)
@@ -33311,7 +34458,9 @@ Index
* installing gawk: Installation. (line 6)
* instruction tracing, in debugger: Debugger Info. (line 90)
* int: Numeric Functions. (line 24)
-* INT signal (MS-Windows): Profiling. (line 213)
+* INT signal (MS-Windows): Profiling. (line 212)
+* intdiv: Numeric Functions. (line 29)
+* intdiv <1>: Numeric Functions. (line 29)
* integer array indices: Numeric Array Subscripts.
(line 31)
* integers, arbitrary precision: Arbitrary Precision Integers.
@@ -33320,7 +34469,7 @@ Index
* interacting with other programs: I/O Functions. (line 107)
* internationalization: I18N Functions. (line 6)
* internationalization <1>: I18N and L10N. (line 6)
-* internationalization, localization: User-modified. (line 152)
+* internationalization, localization: User-modified. (line 155)
* internationalization, localization <1>: Internationalization.
(line 13)
* internationalization, localization, character classes: Bracket Expressions.
@@ -33367,7 +34516,7 @@ Index
* Kernighan, Brian <8>: Other Versions. (line 13)
* Kernighan, Brian <9>: Basic Data Typing. (line 54)
* Kernighan, Brian <10>: Glossary. (line 206)
-* kill command, dynamic profiling: Profiling. (line 187)
+* kill command, dynamic profiling: Profiling. (line 186)
* Knights, jedi: Undocumented. (line 6)
* Kwok, Conrad: Contributors. (line 35)
* l debugger command (alias for list): Miscellaneous Debugger Commands.
@@ -33433,17 +34582,17 @@ 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 87)
+* lint checking: User-modified. (line 90)
* lint checking, array elements: Delete. (line 34)
* lint checking, array subscripts: Uninitialized Subscripts.
(line 43)
* lint checking, empty programs: Command Line. (line 16)
-* lint checking, issuing warnings: Options. (line 184)
+* lint checking, issuing warnings: Options. (line 198)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 338)
+ (line 357)
* lint checking, undefined functions: Pass By Value/Reference.
(line 85)
-* LINT variable: User-modified. (line 87)
+* LINT variable: User-modified. (line 90)
* Linux: Manual History. (line 28)
* Linux <1>: I18N Example. (line 57)
* Linux <2>: Glossary. (line 748)
@@ -33453,17 +34602,17 @@ Index
* list function definitions, in debugger: Debugger Info. (line 30)
* loading extensions, @load directive: Loading Shared Libraries.
(line 8)
-* loading, extensions: Options. (line 172)
+* loading, extensions: Options. (line 186)
* local variables, in a function: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 81)
-* locale decimal point character: Options. (line 269)
+* locale decimal point character: Options. (line 283)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
(line 6)
-* log: Numeric Functions. (line 29)
+* log: Numeric Functions. (line 47)
* log files, timestamps in: Time Functions. (line 6)
-* logarithm: Numeric Functions. (line 29)
+* logarithm: Numeric Functions. (line 47)
* logical false/true: Truth Values. (line 6)
* logical operators, See Boolean expressions: Boolean Ops. (line 6)
* login information: Passwd Functions. (line 16)
@@ -33499,13 +34648,13 @@ Index
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
-* matching, null strings: String Functions. (line 537)
-* mawk utility: Escape Sequences. (line 118)
+* matching, null strings: String Functions. (line 539)
+* mawk utility: Escape Sequences. (line 121)
* mawk utility <1>: Getline/Pipe. (line 62)
* mawk utility <2>: Concatenation. (line 36)
* mawk utility <3>: Nextfile Statement. (line 47)
* mawk utility <4>: Other Versions. (line 48)
-* maximum precision supported by MPFR library: Auto-set. (line 212)
+* maximum precision supported by MPFR library: Auto-set. (line 255)
* McIlroy, Doug: Glossary. (line 257)
* McPhee, Patrick: Contributors. (line 101)
* message object files: Explaining gettext. (line 42)
@@ -33517,12 +34666,13 @@ Index
(line 48)
* messages from extensions: Printing Messages. (line 6)
* metacharacters in regular expressions: Regexp Operators. (line 6)
-* metacharacters, escape sequences for: Escape Sequences. (line 137)
-* minimum precision required by MPFR library: Auto-set. (line 215)
+* metacharacters, escape sequences for: Escape Sequences. (line 140)
+* minimum precision required by MPFR library: Auto-set. (line 258)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
* Moore, Duncan: Getline Notes. (line 40)
+* MPFR, checking availability of: Checking for MPFR. (line 6)
* msgfmt utility: I18N Example. (line 66)
* multiple precision: Arbitrary Precision Arithmetic.
(line 6)
@@ -33538,10 +34688,8 @@ Index
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines: Statements/Lines. (line 6)
-* newlines <1>: Options. (line 260)
+* newlines <1>: Options. (line 277)
* newlines <2>: Boolean Ops. (line 69)
-* newlines, as field separators: Default Field Splitting.
- (line 6)
* newlines, as record separators: awk split records. (line 12)
* newlines, in dynamic regexps: Computed Regexps. (line 60)
* newlines, in regexp constants: Computed Regexps. (line 70)
@@ -33568,7 +34716,7 @@ Index
* nexti debugger command: Debugger Execution Control.
(line 49)
* NF variable: Fields. (line 33)
-* NF variable <1>: Auto-set. (line 104)
+* NF variable <1>: Auto-set. (line 123)
* NF variable, decrementing: Changing Fields. (line 107)
* ni debugger command (alias for nexti): Debugger Execution Control.
(line 49)
@@ -33577,8 +34725,8 @@ Index
(line 23)
* not Boolean-logic operator: Boolean Ops. (line 6)
* NR variable: Records. (line 6)
-* NR variable <1>: Auto-set. (line 124)
-* NR variable, changing: Auto-set. (line 326)
+* NR variable <1>: Auto-set. (line 143)
+* NR variable, changing: Auto-set. (line 377)
* null strings: awk split records. (line 114)
* null strings <1>: Regexp Field Splitting.
(line 43)
@@ -33590,8 +34738,8 @@ Index
(line 43)
* null strings, converting numbers to strings: Strings And Numbers.
(line 21)
-* null strings, matching: String Functions. (line 537)
-* number as string of bits: Bitwise Functions. (line 111)
+* null strings, matching: String Functions. (line 539)
+* number as string of bits: Bitwise Functions. (line 108)
* number of array elements: String Functions. (line 200)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
@@ -33602,27 +34750,27 @@ Index
* numbers, Cliff random: Cliff Random Function.
(line 6)
* numbers, converting: Strings And Numbers. (line 6)
-* numbers, converting <1>: Bitwise Functions. (line 111)
+* numbers, converting <1>: Bitwise Functions. (line 108)
* numbers, converting, to strings: User-modified. (line 30)
-* numbers, converting, to strings <1>: User-modified. (line 104)
+* numbers, converting, to strings <1>: User-modified. (line 107)
* numbers, hexadecimal: Nondecimal-numbers. (line 6)
* numbers, octal: Nondecimal-numbers. (line 6)
* numbers, rounding: Round Function. (line 6)
* numeric constants: Scalar Constants. (line 6)
* numeric functions: Numeric Functions. (line 6)
* numeric, output format: OFMT. (line 6)
-* numeric, strings: Variable Typing. (line 6)
+* numeric, strings: Variable Typing. (line 67)
* o debugger command (alias for option): Debugger Info. (line 57)
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
-* octal values, enabling interpretation of: Options. (line 209)
+* octal values, enabling interpretation of: Options. (line 223)
* OFMT variable: OFMT. (line 15)
* OFMT variable <1>: Strings And Numbers. (line 56)
-* OFMT variable <2>: User-modified. (line 104)
+* OFMT variable <2>: User-modified. (line 107)
* OFMT variable, POSIX awk and: OFMT. (line 27)
* OFS variable: Changing Fields. (line 64)
* OFS variable <1>: Output Separators. (line 6)
-* OFS variable <2>: User-modified. (line 113)
+* OFS variable <2>: User-modified. (line 116)
* OpenBSD: Glossary. (line 748)
* OpenSolaris: Other Versions. (line 100)
* operating systems, BSD-based: Manual History. (line 28)
@@ -33669,7 +34817,7 @@ Index
* options, deprecated: Obsolete. (line 6)
* options, long: Command Line. (line 13)
* options, long <1>: Options. (line 6)
-* options, printing list of: Options. (line 154)
+* options, printing list of: Options. (line 168)
* or: Bitwise Functions. (line 50)
* OR bitwise operation: Bitwise Functions. (line 6)
* or Boolean-logic operator: Boolean Ops. (line 6)
@@ -33678,7 +34826,7 @@ Index
* ord() user-defined function: Ordinal Functions. (line 16)
* order of evaluation, concatenation: Concatenation. (line 41)
* ORS variable: Output Separators. (line 20)
-* ORS variable <1>: User-modified. (line 119)
+* ORS variable <1>: User-modified. (line 122)
* output field separator, See OFS variable: Changing Fields. (line 64)
* output record separator, See ORS variable: Output Separators.
(line 20)
@@ -33698,7 +34846,7 @@ Index
* p debugger command (alias for print): Viewing And Changing Data.
(line 35)
* Papadopoulos, Panos: Contributors. (line 129)
-* parent process ID of gawk process: Auto-set. (line 187)
+* parent process ID of gawk process: Auto-set. (line 230)
* parentheses (), in a profile: Profiling. (line 146)
* parentheses (), regexp operator: Regexp Operators. (line 81)
* password file: Passwd Functions. (line 16)
@@ -33742,14 +34890,14 @@ Index
* plus sign (+), += operator <1>: Precedence. (line 94)
* plus sign (+), regexp operator: Regexp Operators. (line 105)
* pointers to functions: Indirect Calls. (line 6)
-* portability: Escape Sequences. (line 100)
+* portability: Escape Sequences. (line 103)
* portability, #! (executable scripts): Executable Scripts. (line 33)
* portability, ** operator and: Arithmetic Ops. (line 81)
* portability, **= operator and: Assignment Ops. (line 144)
* portability, ARGV variable: Executable Scripts. (line 59)
* portability, backslash continuation and: Statements/Lines. (line 30)
* portability, backslash in escape sequences: Escape Sequences.
- (line 105)
+ (line 108)
* portability, close() function and: Close Files And Pipes.
(line 81)
* portability, data files as single record: gawk split records.
@@ -33767,13 +34915,13 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 97)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 358)
-* portability, substr() function: String Functions. (line 513)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 377)
+* portability, substr() function: String Functions. (line 515)
* portable object files: Explaining gettext. (line 37)
* portable object files <1>: Translator i18n. (line 6)
* portable object files, converting to message object files: I18N Example.
(line 66)
-* portable object files, generating: Options. (line 147)
+* portable object files, generating: Options. (line 161)
* portable object template files: Explaining gettext. (line 31)
* porting gawk: New Ports. (line 6)
* positional specifiers, printf statement: Format Modifiers. (line 13)
@@ -33788,7 +34936,7 @@ Index
* POSIX awk, < operator and: Getline/File. (line 26)
* POSIX awk, arithmetic operators and: Arithmetic Ops. (line 30)
* POSIX awk, backslashes in string constants: Escape Sequences.
- (line 105)
+ (line 108)
* POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 15)
* POSIX awk, bracket expressions and: Bracket Expressions. (line 34)
* POSIX awk, bracket expressions and, character classes: Bracket Expressions.
@@ -33799,17 +34947,15 @@ Index
* POSIX awk, changes in awk versions: POSIX. (line 6)
* POSIX awk, continue statement and: Continue Statement. (line 44)
* POSIX awk, CONVFMT variable and: User-modified. (line 30)
-* POSIX awk, date utility and: Time Functions. (line 253)
-* POSIX awk, field separators and: Fields. (line 6)
-* POSIX awk, field separators and <1>: Full Line Fields. (line 16)
-* POSIX awk, FS variable and: User-modified. (line 60)
+* POSIX awk, date utility and: Time Functions. (line 255)
+* POSIX awk, field separators and: Full Line Fields. (line 16)
* POSIX awk, function keyword in: Definition Syntax. (line 99)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 90)
* POSIX awk, functions and, length(): String Functions. (line 179)
* POSIX awk, GNU long options and: Options. (line 15)
* POSIX awk, interval expressions in: Regexp Operators. (line 135)
* POSIX awk, next/nextfile statements and: Next Statement. (line 44)
-* POSIX awk, numeric strings and: Variable Typing. (line 6)
+* POSIX awk, numeric strings and: Variable Typing. (line 67)
* POSIX awk, OFMT variable and: OFMT. (line 27)
* POSIX awk, OFMT variable and <1>: Strings And Numbers. (line 56)
* POSIX awk, period (.), using: Regexp Operators. (line 51)
@@ -33817,13 +34963,13 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 161)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 56)
-* POSIX mode: Options. (line 254)
-* POSIX mode <1>: Options. (line 338)
+* POSIX mode: Options. (line 271)
+* POSIX mode <1>: Options. (line 357)
* POSIX, awk and: Preface. (line 21)
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
-* POSIXLY_CORRECT environment variable: Options. (line 338)
-* PREC variable: User-modified. (line 124)
+* POSIXLY_CORRECT environment variable: Options. (line 357)
+* PREC variable: User-modified. (line 127)
* precedence: Increment Ops. (line 60)
* precedence <1>: Precedence. (line 6)
* precedence, regexp operators: Regexp Operators. (line 156)
@@ -33838,7 +34984,7 @@ Index
* print statement, commas, omitting: Print Examples. (line 30)
* print statement, I/O operators in: Precedence. (line 70)
* print statement, line continuations and: Print Examples. (line 75)
-* print statement, OFMT variable and: User-modified. (line 113)
+* print statement, OFMT variable and: User-modified. (line 116)
* print statement, See Also redirection, of output: Redirection.
(line 17)
* print statement, sprintf() function and: Round Function. (line 6)
@@ -33864,19 +35010,19 @@ Index
* printf statement, syntax of: Basic Printf. (line 6)
* printing: Printing. (line 6)
* printing messages from extensions: Printing Messages. (line 6)
-* printing, list of options: Options. (line 154)
+* printing, list of options: Options. (line 168)
* printing, mailing labels: Labels Program. (line 6)
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
* private variables: Library Names. (line 11)
-* process group ID of gawk process: Auto-set. (line 181)
-* process ID of gawk process: Auto-set. (line 184)
+* process group ID of gawk process: Auto-set. (line 224)
+* process ID of gawk process: Auto-set. (line 227)
* processes, two-way communications with: Two-way I/O. (line 6)
* processing data: Basic High Level. (line 6)
-* PROCINFO array: Auto-set. (line 129)
-* PROCINFO array <1>: Time Functions. (line 47)
+* PROCINFO array: Auto-set. (line 148)
+* PROCINFO array <1>: Time Functions. (line 49)
* PROCINFO array <2>: Passwd Functions. (line 6)
-* PROCINFO array, and communications via ptys: Two-way I/O. (line 108)
+* PROCINFO array, and communications via ptys: Two-way I/O. (line 114)
* 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.
@@ -33884,8 +35030,8 @@ Index
* PROCINFO, values of sorted_in: Controlling Scanning.
(line 26)
* profiling awk programs: Profiling. (line 6)
-* profiling awk programs, dynamically: Profiling. (line 178)
-* program identifiers: Auto-set. (line 150)
+* profiling awk programs, dynamically: Profiling. (line 177)
+* program identifiers: Auto-set. (line 193)
* program, definition of: Getting Started. (line 21)
* programming conventions, --non-decimal-data option: Nondecimal Data.
(line 35)
@@ -33921,7 +35067,7 @@ Index
* QuikTrim Awk: Other Versions. (line 139)
* quit debugger command: Miscellaneous Debugger Commands.
(line 102)
-* QUIT signal (MS-Windows): Profiling. (line 213)
+* QUIT signal (MS-Windows): Profiling. (line 212)
* quoting in gawk command lines: Long. (line 26)
* quoting in gawk command lines, tricks for: Quoting. (line 91)
* quoting, for small awk programs: Comments. (line 27)
@@ -33930,12 +35076,12 @@ Index
* Rakitzis, Byron: History Sorting. (line 25)
* Ramey, Chet: Acknowledgments. (line 60)
* Ramey, Chet <1>: General Data Types. (line 6)
-* rand: Numeric Functions. (line 34)
+* rand: Numeric Functions. (line 52)
* random numbers, Cliff: Cliff Random Function.
(line 6)
* random numbers, rand()/srand() functions: Numeric Functions.
- (line 34)
-* random numbers, seed of: Numeric Functions. (line 64)
+ (line 52)
+* random numbers, seed of: Numeric Functions. (line 82)
* range expressions (regexps): Bracket Expressions. (line 6)
* range patterns: Ranges. (line 6)
* range patterns, line continuation and: Ranges. (line 64)
@@ -33954,7 +35100,7 @@ Index
* reading input files: Reading Files. (line 6)
* recipe for a programming language: History. (line 6)
* record separators: awk split records. (line 6)
-* record separators <1>: User-modified. (line 133)
+* record separators <1>: User-modified. (line 136)
* record separators, changing: awk split records. (line 85)
* record separators, regular expressions as: awk split records.
(line 124)
@@ -33980,7 +35126,7 @@ Index
(line 103)
* regexp constants, /=.../, /= operator and: Assignment Ops. (line 149)
* regexp constants, as patterns: Expression Patterns. (line 34)
-* regexp constants, in gawk: Using Constant Regexps.
+* regexp constants, in gawk: Standard Regexp Constants.
(line 28)
* regexp constants, slashes vs. quotes: Computed Regexps. (line 30)
* regexp constants, vs. string constants: Computed Regexps. (line 40)
@@ -33996,7 +35142,7 @@ Index
* regular expressions, as record separators: awk split records.
(line 124)
* regular expressions, case sensitivity: Case-sensitivity. (line 6)
-* regular expressions, case sensitivity <1>: User-modified. (line 76)
+* regular expressions, case sensitivity <1>: User-modified. (line 79)
* regular expressions, computed: Computed Regexps. (line 6)
* regular expressions, constants, See regexp constants: Regexp Usage.
(line 57)
@@ -34005,7 +35151,7 @@ Index
(line 60)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 73)
-* regular expressions, interval expressions and: Options. (line 278)
+* regular expressions, interval expressions and: Options. (line 292)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators: Regexp Usage. (line 19)
@@ -34021,7 +35167,8 @@ Index
* regular expressions, searching for: Egrep Program. (line 6)
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
-* replace in string: String Functions. (line 409)
+* replace in string: String Functions. (line 411)
+* retrying input: Retrying Input. (line 6)
* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
@@ -34045,7 +35192,7 @@ Index
* right shift: Bitwise Functions. (line 54)
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 54)
-* RLENGTH variable: Auto-set. (line 251)
+* RLENGTH variable: Auto-set. (line 302)
* RLENGTH variable, match() function and: String Functions. (line 227)
* Robbins, Arnold: Command Line Field Separator.
(line 71)
@@ -34066,16 +35213,16 @@ Index
* round to nearest integer: Numeric Functions. (line 24)
* round() user-defined function: Round Function. (line 16)
* rounding numbers: Round Function. (line 6)
-* ROUNDMODE variable: User-modified. (line 128)
+* ROUNDMODE variable: User-modified. (line 131)
* RS variable: awk split records. (line 12)
-* RS variable <1>: User-modified. (line 133)
+* RS variable <1>: User-modified. (line 136)
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift: Bitwise Functions. (line 54)
-* RSTART variable: Auto-set. (line 257)
+* RSTART variable: Auto-set. (line 308)
* RSTART variable, match() function and: String Functions. (line 227)
* RT variable: awk split records. (line 124)
* RT variable <1>: Multiple Line. (line 130)
-* RT variable <2>: Auto-set. (line 264)
+* RT variable <2>: Auto-set. (line 315)
* Rubin, Paul: History. (line 30)
* Rubin, Paul <1>: Contributors. (line 16)
* rule, definition of: Getting Started. (line 21)
@@ -34086,14 +35233,14 @@ Index
(line 68)
* sample debugging session: Sample Debugging Session.
(line 6)
-* sandbox mode: Options. (line 285)
+* sandbox mode: Options. (line 304)
* save debugger options: Debugger Info. (line 85)
* scalar or array: Type Functions. (line 11)
* scalar values: Basic Data Typing. (line 13)
* scanning arrays: Scanning an Array. (line 6)
* scanning multidimensional arrays: Multiscanning. (line 11)
* Schorr, Andrew: Acknowledgments. (line 60)
-* Schorr, Andrew <1>: Auto-set. (line 296)
+* Schorr, Andrew <1>: Auto-set. (line 347)
* Schorr, Andrew <2>: Contributors. (line 134)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
@@ -34112,7 +35259,7 @@ Index
* sed utility: Full Line Fields. (line 22)
* sed utility <1>: Simple Sed. (line 6)
* sed utility <2>: Glossary. (line 16)
-* seeding random number generator: Numeric Functions. (line 64)
+* seeding random number generator: Numeric Functions. (line 82)
* semicolon (;), AWKPATH variable and: PC Using. (line 9)
* semicolon (;), separating statements in actions: Statements/Lines.
(line 90)
@@ -34120,18 +35267,17 @@ Index
(line 19)
* semicolon (;), separating statements in actions <2>: Statements.
(line 10)
-* separators, field: User-modified. (line 50)
-* separators, field <1>: User-modified. (line 113)
+* separators, field: User-modified. (line 53)
+* separators, field <1>: User-modified. (line 116)
* 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, field, FPAT variable and: User-modified. (line 46)
* separators, for records: awk split records. (line 6)
* separators, for records <1>: awk split records. (line 85)
-* separators, for records <2>: User-modified. (line 133)
+* separators, for records <2>: User-modified. (line 136)
* 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 146)
+* separators, subscript: User-modified. (line 149)
* set breakpoint: Breakpoint Control. (line 11)
* set debugger command: Viewing And Changing Data.
(line 58)
@@ -34176,19 +35322,20 @@ Index
* sidebar, A Constant's Base Does Not Affect Its Value: Nondecimal-numbers.
(line 63)
* sidebar, Backslash Before Regular Characters: Escape Sequences.
- (line 103)
+ (line 106)
+* sidebar, Beware The Smoke and Mirrors!: Bitwise Functions. (line 126)
* sidebar, Changing FS Does Not Affect the Fields: Full Line Fields.
(line 14)
-* sidebar, Changing NR and FNR: Auto-set. (line 324)
+* sidebar, Changing NR and FNR: Auto-set. (line 375)
* sidebar, Controlling Output Buffering with system(): I/O Functions.
(line 164)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
- (line 135)
+ (line 138)
* sidebar, FS and IGNORECASE: Field Splitting Summary.
(line 37)
* sidebar, Interactive Versus Noninteractive Buffering: I/O Functions.
(line 74)
-* sidebar, Matching the Null String: String Functions. (line 535)
+* sidebar, Matching the Null String: String Functions. (line 537)
* sidebar, Operator Evaluation Order: Increment Ops. (line 58)
* sidebar, Piping into sh: Redirection. (line 134)
* sidebar, Pre-POSIX awk Used OFMT for String Conversion: Strings And Numbers.
@@ -34205,19 +35352,19 @@ Index
(line 130)
* sidebar, Using \n in Bracket Expressions of Dynamic Regexps: Computed Regexps.
(line 58)
-* SIGHUP signal, for dynamic profiling: Profiling. (line 210)
-* SIGINT signal (MS-Windows): Profiling. (line 213)
-* signals, HUP/SIGHUP, for profiling: Profiling. (line 210)
-* signals, INT/SIGINT (MS-Windows): Profiling. (line 213)
-* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 213)
-* signals, USR1/SIGUSR1, for profiling: Profiling. (line 187)
+* SIGHUP signal, for dynamic profiling: Profiling. (line 209)
+* SIGINT signal (MS-Windows): Profiling. (line 212)
+* signals, HUP/SIGHUP, for profiling: Profiling. (line 209)
+* signals, INT/SIGINT (MS-Windows): Profiling. (line 212)
+* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 212)
+* signals, USR1/SIGUSR1, for profiling: Profiling. (line 186)
* signature program: Signature Program. (line 6)
-* SIGQUIT signal (MS-Windows): Profiling. (line 213)
-* SIGUSR1 signal, for dynamic profiling: Profiling. (line 187)
+* SIGQUIT signal (MS-Windows): Profiling. (line 212)
+* SIGUSR1 signal, for dynamic profiling: Profiling. (line 186)
* silent debugger command: Debugger Execution Control.
(line 10)
-* sin: Numeric Functions. (line 75)
-* sine: Numeric Functions. (line 75)
+* sin: Numeric Functions. (line 93)
+* sine: Numeric Functions. (line 93)
* single quote ('): One-shot. (line 15)
* single quote (') in gawk command lines: Long. (line 35)
* single quote ('), in shell commands: Quoting. (line 48)
@@ -34257,20 +35404,20 @@ Index
* source files, search path for: Programs Exercises. (line 70)
* sparse arrays: Array Intro. (line 76)
* Spencer, Henry: Glossary. (line 16)
-* split: String Functions. (line 315)
+* split: String Functions. (line 317)
* split string into array: String Functions. (line 296)
* split utility: Split Program. (line 6)
* split() function, array elements, deleting: Delete. (line 61)
* split.awk program: Split Program. (line 30)
* sprintf: OFMT. (line 15)
-* sprintf <1>: String Functions. (line 384)
-* sprintf() function, OFMT variable and: User-modified. (line 113)
+* sprintf <1>: String Functions. (line 386)
+* sprintf() function, OFMT variable and: User-modified. (line 116)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
-* sqrt: Numeric Functions. (line 78)
+* sqrt: Numeric Functions. (line 96)
* square brackets ([]), regexp operator: Regexp Operators. (line 56)
-* square root: Numeric Functions. (line 78)
-* srand: Numeric Functions. (line 82)
+* square root: Numeric Functions. (line 96)
+* srand: Numeric Functions. (line 100)
* stack frame: Debugging Terms. (line 10)
* Stallman, Richard: Manual History. (line 6)
* Stallman, Richard <1>: Acknowledgments. (line 18)
@@ -34294,7 +35441,7 @@ Index
(line 79)
* stream editors: Full Line Fields. (line 22)
* stream editors <1>: Simple Sed. (line 6)
-* strftime: Time Functions. (line 48)
+* strftime: Time Functions. (line 50)
* string constants: Scalar Constants. (line 15)
* string constants, vs. regexp constants: Computed Regexps. (line 40)
* string extraction (internationalization): String Extraction.
@@ -34305,12 +35452,12 @@ Index
* string-manipulation functions: String Functions. (line 6)
* string-matching operators: Regexp Usage. (line 19)
* string-translation functions: I18N Functions. (line 6)
-* strings splitting, example: String Functions. (line 334)
+* strings splitting, example: String Functions. (line 336)
* strings, converting: Strings And Numbers. (line 6)
-* strings, converting <1>: Bitwise Functions. (line 111)
-* strings, converting letter case: String Functions. (line 523)
+* strings, converting <1>: Bitwise Functions. (line 108)
+* strings, converting letter case: String Functions. (line 525)
* strings, converting, numbers to: User-modified. (line 30)
-* strings, converting, numbers to <1>: User-modified. (line 104)
+* strings, converting, numbers to <1>: User-modified. (line 107)
* strings, empty, See null strings: awk split records. (line 114)
* strings, extracting: String Extraction. (line 6)
* strings, for localization: Programmer i18n. (line 13)
@@ -34318,16 +35465,16 @@ Index
* strings, merging arrays into: Join Function. (line 6)
* strings, null: Regexp Field Splitting.
(line 43)
-* strings, numeric: Variable Typing. (line 6)
-* strtonum: String Functions. (line 391)
+* strings, numeric: Variable Typing. (line 67)
+* strtonum: String Functions. (line 393)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 35)
-* sub: Using Constant Regexps.
+* sub: Standard Regexp Constants.
(line 43)
-* sub <1>: String Functions. (line 409)
-* sub() function, arguments of: String Functions. (line 463)
+* sub <1>: String Functions. (line 411)
+* sub() function, arguments of: String Functions. (line 465)
* sub() function, escape processing: Gory Details. (line 6)
-* subscript separators: User-modified. (line 146)
+* subscript separators: User-modified. (line 149)
* subscripts in arrays, multidimensional: Multidimensional. (line 10)
* subscripts in arrays, multidimensional, scanning: Multiscanning.
(line 11)
@@ -34335,20 +35482,20 @@ Index
(line 6)
* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
(line 6)
-* SUBSEP variable: User-modified. (line 146)
+* SUBSEP variable: User-modified. (line 149)
* SUBSEP variable, and multidimensional arrays: Multidimensional.
(line 16)
* substitute in string: String Functions. (line 89)
-* substr: String Functions. (line 482)
-* substring: String Functions. (line 482)
+* substr: String Functions. (line 484)
+* substring: String Functions. (line 484)
* Sumner, Andrew: Other Versions. (line 68)
-* supplementary groups of gawk process: Auto-set. (line 228)
+* supplementary groups of gawk process: Auto-set. (line 271)
* switch statement: Switch Statement. (line 6)
-* SYMTAB array: Auto-set. (line 268)
+* SYMTAB array: Auto-set. (line 319)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 149)
* system: I/O Functions. (line 107)
-* systime: Time Functions. (line 66)
+* systime: Time Functions. (line 68)
* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
* tbreak debugger command: Breakpoint Control. (line 90)
* Tcl: Library Names. (line 58)
@@ -34358,7 +35505,7 @@ Index
* tee.awk program: Tee Program. (line 26)
* temporary breakpoint: Breakpoint Control. (line 90)
* terminating records: awk split records. (line 124)
-* testbits.awk program: Bitwise Functions. (line 72)
+* testbits.awk program: Bitwise Functions. (line 69)
* testext extension: Extension Sample API Tests.
(line 6)
* Texinfo: Conventions. (line 6)
@@ -34366,14 +35513,14 @@ Index
* Texinfo <2>: Dupword Program. (line 17)
* Texinfo <3>: Extract Program. (line 12)
* Texinfo <4>: Distribution contents.
- (line 77)
+ (line 83)
* Texinfo <5>: Adding Code. (line 100)
* Texinfo, chapter beginnings in files: Regexp Operators. (line 22)
* Texinfo, extracting programs from source files: Extract Program.
(line 6)
* text, printing: Print. (line 22)
* text, printing, unduplicated lines of: Uniq Program. (line 6)
-* TEXTDOMAIN variable: User-modified. (line 152)
+* TEXTDOMAIN variable: User-modified. (line 155)
* TEXTDOMAIN variable <1>: Programmer i18n. (line 8)
* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60)
* TEXTDOMAIN variable, portability and: I18N Portability. (line 20)
@@ -34396,12 +35543,12 @@ Index
* time, retrieving: Time Functions. (line 17)
* timeout, reading input: Read Timeout. (line 6)
* timestamps: Time Functions. (line 6)
-* timestamps <1>: Time Functions. (line 66)
-* timestamps, converting dates to: Time Functions. (line 76)
+* timestamps <1>: Time Functions. (line 68)
+* timestamps, converting dates to: Time Functions. (line 78)
* timestamps, formatted: Getlocaltime Function.
(line 6)
-* tolower: String Functions. (line 524)
-* toupper: String Functions. (line 530)
+* tolower: String Functions. (line 526)
+* toupper: String Functions. (line 532)
* tr utility: Translate Program. (line 6)
* trace debugger command: Miscellaneous Debugger Commands.
(line 110)
@@ -34409,15 +35556,15 @@ Index
* translate string: I18N Functions. (line 21)
* translate.awk program: Translate Program. (line 55)
* treating files, as single records: gawk split records. (line 92)
-* troubleshooting, --non-decimal-data option: Options. (line 209)
+* troubleshooting, --non-decimal-data option: Options. (line 223)
* troubleshooting, == operator: Comparison Operators.
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 29)
* troubleshooting, backslash before nonspecial character: Escape Sequences.
- (line 105)
+ (line 108)
* troubleshooting, division: Arithmetic Ops. (line 44)
-* troubleshooting, fatal errors, field widths, specifying: Constant Size.
- (line 22)
+* troubleshooting, fatal errors, field widths, specifying: Fixed width data.
+ (line 17)
* troubleshooting, fatal errors, printf format strings: Format Modifiers.
(line 157)
* troubleshooting, fflush() function: I/O Functions. (line 63)
@@ -34427,7 +35574,7 @@ Index
* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in.
(line 16)
* troubleshooting, getline function: File Checking. (line 25)
-* troubleshooting, gsub()/sub() functions: String Functions. (line 473)
+* troubleshooting, gsub()/sub() functions: String Functions. (line 475)
* troubleshooting, match() function: String Functions. (line 291)
* troubleshooting, print statement, omitting commas: Print Examples.
(line 30)
@@ -34437,7 +35584,7 @@ Index
* troubleshooting, regexp constants vs. string constants: Computed Regexps.
(line 40)
* troubleshooting, string concatenation: Concatenation. (line 27)
-* troubleshooting, substr() function: String Functions. (line 500)
+* troubleshooting, substr() function: String Functions. (line 502)
* troubleshooting, system() function: I/O Functions. (line 129)
* troubleshooting, typographical errors, global variables: Options.
(line 99)
@@ -34448,6 +35595,8 @@ Index
* trunc-mod operation: Arithmetic Ops. (line 66)
* truth values: Truth Values. (line 6)
* type conversion: Strings And Numbers. (line 21)
+* type, of variable: Type Functions. (line 14)
+* typeof: Type Functions. (line 14)
* u debugger command (alias for until): Debugger Execution Control.
(line 82)
* unassigned array elements: Reference to Elements.
@@ -34470,7 +35619,7 @@ Index
* uniq.awk program: Uniq Program. (line 65)
* Unix: Glossary. (line 748)
* Unix awk, backslashes in escape sequences: Escape Sequences.
- (line 118)
+ (line 121)
* Unix awk, close() function and: Close Files And Pipes.
(line 132)
* Unix awk, password files, field separators and: Command Line Field Separator.
@@ -34489,10 +35638,11 @@ Index
* user-modifiable variables: User-modified. (line 6)
* users, information about, printing: Id Program. (line 6)
* users, information about, retrieving: Passwd Functions. (line 16)
-* USR1 signal, for dynamic profiling: Profiling. (line 187)
+* USR1 signal, for dynamic profiling: Profiling. (line 186)
* values, numeric: Basic Data Typing. (line 13)
* values, string: Basic Data Typing. (line 13)
* variable assignments and input files: Other Arguments. (line 26)
+* variable type: Type Functions. (line 14)
* variable typing: Typing and Comparison.
(line 9)
* variables: Other Features. (line 6)
@@ -34523,10 +35673,10 @@ Index
* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
(line 6)
* variables, user-defined: Variables. (line 6)
-* version of gawk: Auto-set. (line 198)
-* version of gawk extension API: Auto-set. (line 223)
-* version of GNU MP library: Auto-set. (line 206)
-* version of GNU MPFR library: Auto-set. (line 208)
+* version of gawk: Auto-set. (line 241)
+* version of gawk extension API: Auto-set. (line 266)
+* version of GNU MP library: Auto-set. (line 249)
+* version of GNU MPFR library: Auto-set. (line 251)
* vertical bar (|): Regexp Operators. (line 70)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 10)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 64)
@@ -34538,7 +35688,7 @@ Index
* Vinschen, Corinna: Acknowledgments. (line 60)
* w debugger command (alias for watch): Viewing And Changing Data.
(line 66)
-* w utility: Constant Size. (line 22)
+* w utility: Fixed width data. (line 17)
* wait() extension function: Extension Sample Fork.
(line 22)
* waitpid() extension function: Extension Sample Fork.
@@ -34547,7 +35697,7 @@ Index
* Wall, Larry: Array Intro. (line 6)
* Wall, Larry <1>: Future Extensions. (line 6)
* Wallin, Anders: Contributors. (line 104)
-* warnings, issuing: Options. (line 184)
+* warnings, issuing: Options. (line 198)
* watch debugger command: Viewing And Changing Data.
(line 66)
* watchpoint: Debugging Terms. (line 42)
@@ -34563,7 +35713,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 260)
+* whitespace, newlines as: Options. (line 277)
* Williams, Kent: Contributors. (line 35)
* Woehlke, Matthew: Contributors. (line 80)
* Woods, John: Contributors. (line 28)
@@ -34593,563 +35743,580 @@ Index

Tag Table:
Node: Top1200
-Node: Foreword342162
-Node: Foreword446604
-Node: Preface48136
-Ref: Preface-Footnote-150995
-Ref: Preface-Footnote-251102
-Ref: Preface-Footnote-351336
-Node: History51478
-Node: Names53830
-Ref: Names-Footnote-154924
-Node: This Manual55071
-Ref: This Manual-Footnote-161556
-Node: Conventions61656
-Node: Manual History64010
-Ref: Manual History-Footnote-167005
-Ref: Manual History-Footnote-267046
-Node: How To Contribute67120
-Node: Acknowledgments67771
-Node: Getting Started72657
-Node: Running gawk75096
-Node: One-shot76286
-Node: Read Terminal77549
-Node: Long79542
-Node: Executable Scripts81055
-Ref: Executable Scripts-Footnote-183850
-Node: Comments83953
-Node: Quoting86437
-Node: DOS Quoting91954
-Node: Sample Data Files92629
-Node: Very Simple95224
-Node: Two Rules100126
-Node: More Complex102011
-Node: Statements/Lines104877
-Ref: Statements/Lines-Footnote-1109336
-Node: Other Features109601
-Node: When110537
-Ref: When-Footnote-1112291
-Node: Intro Summary112356
-Node: Invoking Gawk113240
-Node: Command Line114754
-Node: Options115552
-Ref: Options-Footnote-1131459
-Ref: Options-Footnote-2131689
-Node: Other Arguments131714
-Node: Naming Standard Input134661
-Node: Environment Variables135754
-Node: AWKPATH Variable136312
-Ref: AWKPATH Variable-Footnote-1139613
-Ref: AWKPATH Variable-Footnote-2139647
-Node: AWKLIBPATH Variable139908
-Node: Other Environment Variables141052
-Node: Exit Status145000
-Node: Include Files145677
-Node: Loading Shared Libraries149272
-Node: Obsolete150700
-Node: Undocumented151392
-Node: Invoking Summary151689
-Node: Regexp153349
-Node: Regexp Usage154803
-Node: Escape Sequences156840
-Node: Regexp Operators162854
-Ref: Regexp Operators-Footnote-1170270
-Ref: Regexp Operators-Footnote-2170417
-Node: Bracket Expressions170515
-Ref: table-char-classes172991
-Node: Leftmost Longest176128
-Node: Computed Regexps177431
-Node: GNU Regexp Operators180858
-Node: Case-sensitivity184537
-Ref: Case-sensitivity-Footnote-1187424
-Ref: Case-sensitivity-Footnote-2187659
-Node: Regexp Summary187767
-Node: Reading Files189233
-Node: Records191327
-Node: awk split records192060
-Node: gawk split records196991
-Ref: gawk split records-Footnote-1201531
-Node: Fields201568
-Ref: Fields-Footnote-1204348
-Node: Nonconstant Fields204434
-Ref: Nonconstant Fields-Footnote-1206670
-Node: Changing Fields206874
-Node: Field Separators212802
-Node: Default Field Splitting215500
-Node: Regexp Field Splitting216618
-Node: Single Character Fields219971
-Node: Command Line Field Separator221031
-Node: Full Line Fields224249
-Ref: Full Line Fields-Footnote-1225771
-Ref: Full Line Fields-Footnote-2225817
-Node: Field Splitting Summary225918
-Node: Constant Size227992
-Node: Splitting By Content232570
-Ref: Splitting By Content-Footnote-1236541
-Node: Multiple Line236704
-Ref: Multiple Line-Footnote-1242586
-Node: Getline242765
-Node: Plain Getline244969
-Node: Getline/Variable247608
-Node: Getline/File248757
-Node: Getline/Variable/File250143
-Ref: Getline/Variable/File-Footnote-1251746
-Node: Getline/Pipe251834
-Node: Getline/Variable/Pipe254539
-Node: Getline/Coprocess255672
-Node: Getline/Variable/Coprocess256937
-Node: Getline Notes257677
-Node: Getline Summary260472
-Ref: table-getline-variants260894
-Node: Read Timeout261642
-Ref: Read Timeout-Footnote-1265483
-Node: Command-line directories265541
-Node: Input Summary266445
-Node: Input Exercises269617
-Node: Printing270345
-Node: Print272121
-Node: Print Examples273578
-Node: Output Separators276358
-Node: OFMT278375
-Node: Printf279731
-Node: Basic Printf280516
-Node: Control Letters282090
-Node: Format Modifiers286078
-Node: Printf Examples292093
-Node: Redirection294579
-Node: Special FD301420
-Ref: Special FD-Footnote-1304588
-Node: Special Files304662
-Node: Other Inherited Files305279
-Node: Special Network306280
-Node: Special Caveats307140
-Node: Close Files And Pipes308089
-Ref: Close Files And Pipes-Footnote-1315282
-Ref: Close Files And Pipes-Footnote-2315430
-Node: Output Summary315581
-Node: Output Exercises316579
-Node: Expressions317258
-Node: Values318446
-Node: Constants319124
-Node: Scalar Constants319815
-Ref: Scalar Constants-Footnote-1320679
-Node: Nondecimal-numbers320929
-Node: Regexp Constants323942
-Node: Using Constant Regexps324468
-Node: Variables327631
-Node: Using Variables328288
-Node: Assignment Options330198
-Node: Conversion332071
-Node: Strings And Numbers332595
-Ref: Strings And Numbers-Footnote-1335658
-Node: Locale influences conversions335767
-Ref: table-locale-affects338525
-Node: All Operators339143
-Node: Arithmetic Ops339772
-Node: Concatenation342278
-Ref: Concatenation-Footnote-1345125
-Node: Assignment Ops345232
-Ref: table-assign-ops350223
-Node: Increment Ops351536
-Node: Truth Values and Conditions354996
-Node: Truth Values356070
-Node: Typing and Comparison357118
-Node: Variable Typing357938
-Node: Comparison Operators361562
-Ref: table-relational-ops361981
-Node: POSIX String Comparison365476
-Ref: POSIX String Comparison-Footnote-1366550
-Node: Boolean Ops366689
-Ref: Boolean Ops-Footnote-1371171
-Node: Conditional Exp371263
-Node: Function Calls372999
-Node: Precedence376876
-Node: Locales380535
-Node: Expressions Summary382167
-Node: Patterns and Actions384740
-Node: Pattern Overview385860
-Node: Regexp Patterns387537
-Node: Expression Patterns388079
-Node: Ranges391860
-Node: BEGIN/END394968
-Node: Using BEGIN/END395729
-Ref: Using BEGIN/END-Footnote-1398465
-Node: I/O And BEGIN/END398571
-Node: BEGINFILE/ENDFILE400885
-Node: Empty403792
-Node: Using Shell Variables404109
-Node: Action Overview406383
-Node: Statements408708
-Node: If Statement410556
-Node: While Statement412051
-Node: Do Statement414079
-Node: For Statement415227
-Node: Switch Statement418385
-Node: Break Statement420771
-Node: Continue Statement422863
-Node: Next Statement424690
-Node: Nextfile Statement427073
-Node: Exit Statement429725
-Node: Built-in Variables432128
-Node: User-modified433261
-Ref: User-modified-Footnote-1440886
-Node: Auto-set440948
-Ref: Auto-set-Footnote-1454304
-Ref: Auto-set-Footnote-2454510
-Node: ARGC and ARGV454566
-Node: Pattern Action Summary458779
-Node: Arrays461209
-Node: Array Basics462538
-Node: Array Intro463382
-Ref: figure-array-elements465357
-Ref: Array Intro-Footnote-1468061
-Node: Reference to Elements468189
-Node: Assigning Elements470653
-Node: Array Example471144
-Node: Scanning an Array472903
-Node: Controlling Scanning475925
-Ref: Controlling Scanning-Footnote-1481324
-Node: Numeric Array Subscripts481640
-Node: Uninitialized Subscripts483824
-Node: Delete485443
-Ref: Delete-Footnote-1488195
-Node: Multidimensional488252
-Node: Multiscanning491347
-Node: Arrays of Arrays492938
-Node: Arrays Summary497705
-Node: Functions499798
-Node: Built-in500836
-Node: Calling Built-in501917
-Node: Numeric Functions503913
-Ref: Numeric Functions-Footnote-1507941
-Ref: Numeric Functions-Footnote-2508298
-Ref: Numeric Functions-Footnote-3508346
-Node: String Functions508618
-Ref: String Functions-Footnote-1532122
-Ref: String Functions-Footnote-2532250
-Ref: String Functions-Footnote-3532498
-Node: Gory Details532585
-Ref: table-sub-escapes534376
-Ref: table-sub-proposed535895
-Ref: table-posix-sub537258
-Ref: table-gensub-escapes538799
-Ref: Gory Details-Footnote-1539622
-Node: I/O Functions539776
-Ref: table-system-return-values546358
-Ref: I/O Functions-Footnote-1548338
-Ref: I/O Functions-Footnote-2548486
-Node: Time Functions548606
-Ref: Time Functions-Footnote-1559128
-Ref: Time Functions-Footnote-2559196
-Ref: Time Functions-Footnote-3559354
-Ref: Time Functions-Footnote-4559465
-Ref: Time Functions-Footnote-5559577
-Ref: Time Functions-Footnote-6559804
-Node: Bitwise Functions560070
-Ref: table-bitwise-ops560664
-Ref: Bitwise Functions-Footnote-1564982
-Node: Type Functions565155
-Node: I18N Functions566311
-Node: User-defined567962
-Node: Definition Syntax568767
-Ref: Definition Syntax-Footnote-1574454
-Node: Function Example574525
-Ref: Function Example-Footnote-1577447
-Node: Function Caveats577469
-Node: Calling A Function577987
-Node: Variable Scope578945
-Node: Pass By Value/Reference581939
-Node: Return Statement585438
-Node: Dynamic Typing588417
-Node: Indirect Calls589347
-Ref: Indirect Calls-Footnote-1599598
-Node: Functions Summary599726
-Node: Library Functions602431
-Ref: Library Functions-Footnote-1606038
-Ref: Library Functions-Footnote-2606181
-Node: Library Names606352
-Ref: Library Names-Footnote-1609812
-Ref: Library Names-Footnote-2610035
-Node: General Functions610121
-Node: Strtonum Function611224
-Node: Assert Function614246
-Node: Round Function617572
-Node: Cliff Random Function619113
-Node: Ordinal Functions620129
-Ref: Ordinal Functions-Footnote-1623192
-Ref: Ordinal Functions-Footnote-2623444
-Node: Join Function623654
-Ref: Join Function-Footnote-1625424
-Node: Getlocaltime Function625624
-Node: Readfile Function629366
-Node: Shell Quoting631338
-Node: Data File Management632739
-Node: Filetrans Function633371
-Node: Rewind Function637467
-Node: File Checking639377
-Ref: File Checking-Footnote-1640711
-Node: Empty Files640912
-Node: Ignoring Assigns642891
-Node: Getopt Function644441
-Ref: Getopt Function-Footnote-1655910
-Node: Passwd Functions656110
-Ref: Passwd Functions-Footnote-1664949
-Node: Group Functions665037
-Ref: Group Functions-Footnote-1672935
-Node: Walking Arrays673142
-Node: Library Functions Summary676150
-Node: Library Exercises677556
-Node: Sample Programs678021
-Node: Running Examples678791
-Node: Clones679519
-Node: Cut Program680743
-Node: Egrep Program690672
-Ref: Egrep Program-Footnote-1698184
-Node: Id Program698294
-Node: Split Program701974
-Ref: Split Program-Footnote-1705433
-Node: Tee Program705562
-Node: Uniq Program708352
-Node: Wc Program715778
-Ref: Wc Program-Footnote-1720033
-Node: Miscellaneous Programs720127
-Node: Dupword Program721340
-Node: Alarm Program723370
-Node: Translate Program728225
-Ref: Translate Program-Footnote-1732790
-Node: Labels Program733060
-Ref: Labels Program-Footnote-1736411
-Node: Word Sorting736495
-Node: History Sorting740567
-Node: Extract Program742402
-Node: Simple Sed749931
-Node: Igawk Program753005
-Ref: Igawk Program-Footnote-1767336
-Ref: Igawk Program-Footnote-2767538
-Ref: Igawk Program-Footnote-3767660
-Node: Anagram Program767775
-Node: Signature Program770837
-Node: Programs Summary772084
-Node: Programs Exercises773298
-Ref: Programs Exercises-Footnote-1777427
-Node: Advanced Features777518
-Node: Nondecimal Data779508
-Node: Array Sorting781099
-Node: Controlling Array Traversal781799
-Ref: Controlling Array Traversal-Footnote-1790166
-Node: Array Sorting Functions790284
-Ref: Array Sorting Functions-Footnote-1795375
-Node: Two-way I/O795571
-Ref: Two-way I/O-Footnote-1801865
-Ref: Two-way I/O-Footnote-2802052
-Node: TCP/IP Networking802134
-Node: Profiling805252
-Node: Advanced Features Summary812791
-Node: Internationalization814727
-Node: I18N and L10N816207
-Node: Explaining gettext816894
-Ref: Explaining gettext-Footnote-1822786
-Ref: Explaining gettext-Footnote-2822971
-Node: Programmer i18n823136
-Ref: Programmer i18n-Footnote-1828085
-Node: Translator i18n828134
-Node: String Extraction828928
-Ref: String Extraction-Footnote-1830060
-Node: Printf Ordering830146
-Ref: Printf Ordering-Footnote-1832932
-Node: I18N Portability832996
-Ref: I18N Portability-Footnote-1835452
-Node: I18N Example835515
-Ref: I18N Example-Footnote-1838321
-Node: Gawk I18N838394
-Node: I18N Summary839039
-Node: Debugger840380
-Node: Debugging841402
-Node: Debugging Concepts841843
-Node: Debugging Terms843652
-Node: Awk Debugging846227
-Node: Sample Debugging Session847133
-Node: Debugger Invocation847667
-Node: Finding The Bug849053
-Node: List of Debugger Commands855531
-Node: Breakpoint Control856864
-Node: Debugger Execution Control860558
-Node: Viewing And Changing Data863920
-Node: Execution Stack867294
-Node: Debugger Info868931
-Node: Miscellaneous Debugger Commands873002
-Node: Readline Support878090
-Node: Limitations878986
-Node: Debugging Summary881095
-Node: Arbitrary Precision Arithmetic882268
-Node: Computer Arithmetic883684
-Ref: table-numeric-ranges887275
-Ref: Computer Arithmetic-Footnote-1887997
-Node: Math Definitions888054
-Ref: table-ieee-formats891368
-Ref: Math Definitions-Footnote-1891971
-Node: MPFR features892076
-Node: FP Math Caution893793
-Ref: FP Math Caution-Footnote-1894865
-Node: Inexactness of computations895234
-Node: Inexact representation896194
-Node: Comparing FP Values897554
-Node: Errors accumulate898636
-Node: Getting Accuracy900069
-Node: Try To Round902779
-Node: Setting precision903678
-Ref: table-predefined-precision-strings904375
-Node: Setting the rounding mode906205
-Ref: table-gawk-rounding-modes906579
-Ref: Setting the rounding mode-Footnote-1909987
-Node: Arbitrary Precision Integers910166
-Ref: Arbitrary Precision Integers-Footnote-1913150
-Node: POSIX Floating Point Problems913299
-Ref: POSIX Floating Point Problems-Footnote-1917181
-Node: Floating point summary917219
-Node: Dynamic Extensions919409
-Node: Extension Intro920962
-Node: Plugin License922228
-Node: Extension Mechanism Outline923025
-Ref: figure-load-extension923464
-Ref: figure-register-new-function925029
-Ref: figure-call-new-function926121
-Node: Extension API Description928183
-Node: Extension API Functions Introduction929631
-Node: General Data Types934443
-Ref: General Data Types-Footnote-1940398
-Node: Memory Allocation Functions940697
-Ref: Memory Allocation Functions-Footnote-1943542
-Node: Constructor Functions943641
-Node: Registration Functions945386
-Node: Extension Functions946071
-Node: Exit Callback Functions948370
-Node: Extension Version String949620
-Node: Input Parsers950283
-Node: Output Wrappers960165
-Node: Two-way processors964677
-Node: Printing Messages966942
-Ref: Printing Messages-Footnote-1968016
-Node: Updating ERRNO968169
-Node: Requesting Values968908
-Ref: table-value-types-returned969645
-Node: Accessing Parameters970528
-Node: Symbol Table Access971763
-Node: Symbol table by name972275
-Node: Symbol table by cookie974296
-Ref: Symbol table by cookie-Footnote-1978448
-Node: Cached values978512
-Ref: Cached values-Footnote-1982019
-Node: Array Manipulation982110
-Ref: Array Manipulation-Footnote-1983209
-Node: Array Data Types983246
-Ref: Array Data Types-Footnote-1985904
-Node: Array Functions985996
-Node: Flattening Arrays989854
-Node: Creating Arrays996762
-Node: Extension API Variables1001531
-Node: Extension Versioning1002167
-Ref: gawk-api-version1002604
-Node: Extension API Informational Variables1004360
-Node: Extension API Boilerplate1005424
-Node: Finding Extensions1009238
-Node: Extension Example1009797
-Node: Internal File Description1010595
-Node: Internal File Ops1014675
-Ref: Internal File Ops-Footnote-11026437
-Node: Using Internal File Ops1026577
-Ref: Using Internal File Ops-Footnote-11028960
-Node: Extension Samples1029234
-Node: Extension Sample File Functions1030763
-Node: Extension Sample Fnmatch1038412
-Node: Extension Sample Fork1039899
-Node: Extension Sample Inplace1041117
-Node: Extension Sample Ord1044334
-Node: Extension Sample Readdir1045170
-Ref: table-readdir-file-types1046059
-Node: Extension Sample Revout1046864
-Node: Extension Sample Rev2way1047453
-Node: Extension Sample Read write array1048193
-Node: Extension Sample Readfile1050135
-Node: Extension Sample Time1051230
-Node: Extension Sample API Tests1052578
-Node: gawkextlib1053070
-Node: Extension summary1055494
-Node: Extension Exercises1059186
-Node: Language History1060684
-Node: V7/SVR3.11062340
-Node: SVR41064492
-Node: POSIX1065926
-Node: BTL1067305
-Node: POSIX/GNU1068034
-Node: Feature History1073555
-Node: Common Extensions1086884
-Node: Ranges and Locales1088167
-Ref: Ranges and Locales-Footnote-11092783
-Ref: Ranges and Locales-Footnote-21092810
-Ref: Ranges and Locales-Footnote-31093045
-Node: Contributors1093266
-Node: History summary1098826
-Node: Installation1100206
-Node: Gawk Distribution1101150
-Node: Getting1101634
-Node: Extracting1102595
-Node: Distribution contents1104233
-Node: Unix Installation1109975
-Node: Quick Installation1110591
-Node: Additional Configuration Options1113018
-Node: Configuration Philosophy1114822
-Node: Non-Unix Installation1117191
-Node: PC Installation1117651
-Node: PC Binary Installation1118489
-Node: PC Compiling1118924
-Node: PC Using1120041
-Node: Cygwin1123086
-Node: MSYS1123856
-Node: VMS Installation1124357
-Node: VMS Compilation1125148
-Ref: VMS Compilation-Footnote-11126377
-Node: VMS Dynamic Extensions1126435
-Node: VMS Installation Details1128120
-Node: VMS Running1130373
-Node: VMS GNV1134652
-Node: VMS Old Gawk1135387
-Node: Bugs1135858
-Node: Bug address1136521
-Node: Usenet1138918
-Node: Maintainers1139695
-Node: Other Versions1141071
-Node: Installation summary1147655
-Node: Notes1148690
-Node: Compatibility Mode1149555
-Node: Additions1150337
-Node: Accessing The Source1151262
-Node: Adding Code1152697
-Node: New Ports1158915
-Node: Derived Files1163403
-Ref: Derived Files-Footnote-11168888
-Ref: Derived Files-Footnote-21168923
-Ref: Derived Files-Footnote-31169521
-Node: Future Extensions1169635
-Node: Implementation Limitations1170293
-Node: Extension Design1171476
-Node: Old Extension Problems1172630
-Ref: Old Extension Problems-Footnote-11174148
-Node: Extension New Mechanism Goals1174205
-Ref: Extension New Mechanism Goals-Footnote-11177569
-Node: Extension Other Design Decisions1177758
-Node: Extension Future Growth1179871
-Node: Old Extension Mechanism1180707
-Node: Notes summary1182470
-Node: Basic Concepts1183652
-Node: Basic High Level1184333
-Ref: figure-general-flow1184615
-Ref: figure-process-flow1185300
-Ref: Basic High Level-Footnote-11188601
-Node: Basic Data Typing1188786
-Node: Glossary1192114
-Node: Copying1224061
-Node: GNU Free Documentation License1261600
-Node: Index1286718
+Node: Foreword343279
+Node: Foreword447721
+Node: Preface49253
+Ref: Preface-Footnote-152112
+Ref: Preface-Footnote-252219
+Ref: Preface-Footnote-352453
+Node: History52595
+Node: Names54947
+Ref: Names-Footnote-156041
+Node: This Manual56188
+Ref: This Manual-Footnote-162673
+Node: Conventions62773
+Node: Manual History65127
+Ref: Manual History-Footnote-168122
+Ref: Manual History-Footnote-268163
+Node: How To Contribute68237
+Node: Acknowledgments68888
+Node: Getting Started73774
+Node: Running gawk76213
+Node: One-shot77403
+Node: Read Terminal78666
+Node: Long80659
+Node: Executable Scripts82172
+Ref: Executable Scripts-Footnote-184967
+Node: Comments85070
+Node: Quoting87554
+Node: DOS Quoting93071
+Node: Sample Data Files95126
+Node: Very Simple97721
+Node: Two Rules102623
+Node: More Complex104508
+Node: Statements/Lines107374
+Ref: Statements/Lines-Footnote-1111833
+Node: Other Features112098
+Node: When113034
+Ref: When-Footnote-1114788
+Node: Intro Summary114853
+Node: Invoking Gawk115737
+Node: Command Line117251
+Node: Options118049
+Ref: Options-Footnote-1134668
+Ref: Options-Footnote-2134898
+Node: Other Arguments134923
+Node: Naming Standard Input137870
+Node: Environment Variables138963
+Node: AWKPATH Variable139521
+Ref: AWKPATH Variable-Footnote-1142932
+Ref: AWKPATH Variable-Footnote-2142966
+Node: AWKLIBPATH Variable143227
+Node: Other Environment Variables144484
+Node: Exit Status148305
+Node: Include Files148982
+Node: Loading Shared Libraries152577
+Node: Obsolete154005
+Node: Undocumented154697
+Node: Invoking Summary154994
+Node: Regexp156654
+Node: Regexp Usage158108
+Node: Escape Sequences160145
+Node: Regexp Operators166377
+Ref: Regexp Operators-Footnote-1173793
+Ref: Regexp Operators-Footnote-2173940
+Node: Bracket Expressions174038
+Ref: table-char-classes176514
+Node: Leftmost Longest179651
+Node: Computed Regexps180954
+Node: GNU Regexp Operators184381
+Node: Case-sensitivity188060
+Ref: Case-sensitivity-Footnote-1190947
+Ref: Case-sensitivity-Footnote-2191182
+Node: Regexp Summary191290
+Node: Reading Files192756
+Node: Records195025
+Node: awk split records195758
+Node: gawk split records200689
+Ref: gawk split records-Footnote-1205229
+Node: Fields205266
+Node: Nonconstant Fields208007
+Ref: Nonconstant Fields-Footnote-1210243
+Node: Changing Fields210447
+Node: Field Separators216375
+Node: Default Field Splitting219073
+Node: Regexp Field Splitting220191
+Node: Single Character Fields223544
+Node: Command Line Field Separator224604
+Node: Full Line Fields227822
+Ref: Full Line Fields-Footnote-1229344
+Ref: Full Line Fields-Footnote-2229390
+Node: Field Splitting Summary229491
+Node: Constant Size231565
+Node: Fixed width data232297
+Node: Skipping intervening235764
+Node: Allowing trailing data236562
+Node: Fields with fixed data237599
+Node: Splitting By Content239117
+Ref: Splitting By Content-Footnote-1242767
+Node: Testing field creation242930
+Node: Multiple Line244551
+Ref: Multiple Line-Footnote-1250435
+Node: Getline250614
+Node: Plain Getline253083
+Node: Getline/Variable255724
+Node: Getline/File256875
+Node: Getline/Variable/File258263
+Ref: Getline/Variable/File-Footnote-1259868
+Node: Getline/Pipe259956
+Node: Getline/Variable/Pipe262663
+Node: Getline/Coprocess263798
+Node: Getline/Variable/Coprocess265065
+Node: Getline Notes265807
+Node: Getline Summary268604
+Ref: table-getline-variants269028
+Node: Read Timeout269776
+Ref: Read Timeout-Footnote-1273682
+Node: Retrying Input273740
+Node: Command-line directories274939
+Node: Input Summary275845
+Node: Input Exercises279017
+Node: Printing279745
+Node: Print281579
+Node: Print Examples283036
+Node: Output Separators285816
+Node: OFMT287833
+Node: Printf289189
+Node: Basic Printf289974
+Node: Control Letters291548
+Node: Format Modifiers295536
+Node: Printf Examples301551
+Node: Redirection304037
+Node: Special FD310878
+Ref: Special FD-Footnote-1314046
+Node: Special Files314120
+Node: Other Inherited Files314737
+Node: Special Network315738
+Node: Special Caveats316598
+Node: Close Files And Pipes317547
+Ref: table-close-pipe-return-values324454
+Ref: Close Files And Pipes-Footnote-1325237
+Ref: Close Files And Pipes-Footnote-2325385
+Node: Nonfatal325537
+Node: Output Summary327862
+Node: Output Exercises329084
+Node: Expressions329763
+Node: Values330951
+Node: Constants331629
+Node: Scalar Constants332320
+Ref: Scalar Constants-Footnote-1333184
+Node: Nondecimal-numbers333434
+Node: Regexp Constants336435
+Node: Using Constant Regexps336961
+Node: Standard Regexp Constants337583
+Node: Strong Regexp Constants340771
+Node: Variables343729
+Node: Using Variables344386
+Node: Assignment Options346296
+Node: Conversion348169
+Node: Strings And Numbers348693
+Ref: Strings And Numbers-Footnote-1351756
+Node: Locale influences conversions351865
+Ref: table-locale-affects354623
+Node: All Operators355241
+Node: Arithmetic Ops355870
+Node: Concatenation358376
+Ref: Concatenation-Footnote-1361223
+Node: Assignment Ops361330
+Ref: table-assign-ops366321
+Node: Increment Ops367634
+Node: Truth Values and Conditions371094
+Node: Truth Values372168
+Node: Typing and Comparison373216
+Node: Variable Typing374036
+Ref: Variable Typing-Footnote-1380499
+Ref: Variable Typing-Footnote-2380571
+Node: Comparison Operators380648
+Ref: table-relational-ops381067
+Node: POSIX String Comparison384562
+Ref: POSIX String Comparison-Footnote-1386257
+Ref: POSIX String Comparison-Footnote-2386396
+Node: Boolean Ops386480
+Ref: Boolean Ops-Footnote-1390962
+Node: Conditional Exp391054
+Node: Function Calls392790
+Node: Precedence396667
+Node: Locales400326
+Node: Expressions Summary401958
+Node: Patterns and Actions404531
+Node: Pattern Overview405651
+Node: Regexp Patterns407328
+Node: Expression Patterns407870
+Node: Ranges411651
+Node: BEGIN/END414759
+Node: Using BEGIN/END415520
+Ref: Using BEGIN/END-Footnote-1418256
+Node: I/O And BEGIN/END418362
+Node: BEGINFILE/ENDFILE420676
+Node: Empty423583
+Node: Using Shell Variables423900
+Node: Action Overview426174
+Node: Statements428499
+Node: If Statement430347
+Node: While Statement431842
+Node: Do Statement433870
+Node: For Statement435018
+Node: Switch Statement438176
+Node: Break Statement440562
+Node: Continue Statement442654
+Node: Next Statement444481
+Node: Nextfile Statement446864
+Node: Exit Statement449516
+Node: Built-in Variables451919
+Node: User-modified453052
+Node: Auto-set460819
+Ref: Auto-set-Footnote-1476416
+Ref: Auto-set-Footnote-2476622
+Node: ARGC and ARGV476678
+Node: Pattern Action Summary480891
+Node: Arrays483321
+Node: Array Basics484650
+Node: Array Intro485494
+Ref: figure-array-elements487469
+Ref: Array Intro-Footnote-1490173
+Node: Reference to Elements490301
+Node: Assigning Elements492765
+Node: Array Example493256
+Node: Scanning an Array495015
+Node: Controlling Scanning498037
+Ref: Controlling Scanning-Footnote-1503436
+Node: Numeric Array Subscripts503752
+Node: Uninitialized Subscripts505936
+Node: Delete507555
+Ref: Delete-Footnote-1510307
+Node: Multidimensional510364
+Node: Multiscanning513459
+Node: Arrays of Arrays515050
+Node: Arrays Summary519817
+Node: Functions521910
+Node: Built-in522948
+Node: Calling Built-in524029
+Node: Numeric Functions526025
+Ref: Numeric Functions-Footnote-1530970
+Ref: Numeric Functions-Footnote-2531327
+Ref: Numeric Functions-Footnote-3531375
+Node: String Functions531647
+Ref: String Functions-Footnote-1555305
+Ref: String Functions-Footnote-2555433
+Ref: String Functions-Footnote-3555681
+Node: Gory Details555768
+Ref: table-sub-escapes557559
+Ref: table-sub-proposed559078
+Ref: table-posix-sub560441
+Ref: table-gensub-escapes561982
+Ref: Gory Details-Footnote-1562805
+Node: I/O Functions562959
+Ref: table-system-return-values569541
+Ref: I/O Functions-Footnote-1571521
+Ref: I/O Functions-Footnote-2571669
+Node: Time Functions571789
+Ref: Time Functions-Footnote-1582456
+Ref: Time Functions-Footnote-2582524
+Ref: Time Functions-Footnote-3582682
+Ref: Time Functions-Footnote-4582793
+Ref: Time Functions-Footnote-5582905
+Ref: Time Functions-Footnote-6583132
+Node: Bitwise Functions583398
+Ref: table-bitwise-ops583992
+Ref: Bitwise Functions-Footnote-1590025
+Ref: Bitwise Functions-Footnote-2590198
+Node: Type Functions590389
+Node: I18N Functions593064
+Node: User-defined594715
+Node: Definition Syntax595520
+Ref: Definition Syntax-Footnote-1601207
+Node: Function Example601278
+Ref: Function Example-Footnote-1604200
+Node: Function Caveats604222
+Node: Calling A Function604740
+Node: Variable Scope605698
+Node: Pass By Value/Reference608692
+Node: Return Statement612191
+Node: Dynamic Typing615170
+Node: Indirect Calls616100
+Ref: Indirect Calls-Footnote-1626351
+Node: Functions Summary626479
+Node: Library Functions629184
+Ref: Library Functions-Footnote-1632791
+Ref: Library Functions-Footnote-2632934
+Node: Library Names633105
+Ref: Library Names-Footnote-1636565
+Ref: Library Names-Footnote-2636788
+Node: General Functions636874
+Node: Strtonum Function637977
+Node: Assert Function640999
+Node: Round Function644325
+Node: Cliff Random Function645866
+Node: Ordinal Functions646882
+Ref: Ordinal Functions-Footnote-1649945
+Ref: Ordinal Functions-Footnote-2650197
+Node: Join Function650407
+Ref: Join Function-Footnote-1652177
+Node: Getlocaltime Function652377
+Node: Readfile Function656119
+Node: Shell Quoting658091
+Node: Data File Management659492
+Node: Filetrans Function660124
+Node: Rewind Function664220
+Node: File Checking666130
+Ref: File Checking-Footnote-1667464
+Node: Empty Files667665
+Node: Ignoring Assigns669644
+Node: Getopt Function671194
+Ref: Getopt Function-Footnote-1682663
+Node: Passwd Functions682863
+Ref: Passwd Functions-Footnote-1691702
+Node: Group Functions691790
+Ref: Group Functions-Footnote-1699688
+Node: Walking Arrays699895
+Node: Library Functions Summary702903
+Node: Library Exercises704309
+Node: Sample Programs704774
+Node: Running Examples705544
+Node: Clones706272
+Node: Cut Program707496
+Node: Egrep Program717425
+Ref: Egrep Program-Footnote-1724937
+Node: Id Program725047
+Node: Split Program728727
+Ref: Split Program-Footnote-1732186
+Node: Tee Program732315
+Node: Uniq Program735105
+Node: Wc Program742531
+Ref: Wc Program-Footnote-1746786
+Node: Miscellaneous Programs746880
+Node: Dupword Program748093
+Node: Alarm Program750123
+Node: Translate Program754978
+Ref: Translate Program-Footnote-1759543
+Node: Labels Program759813
+Ref: Labels Program-Footnote-1763164
+Node: Word Sorting763248
+Node: History Sorting767320
+Node: Extract Program769155
+Node: Simple Sed776684
+Node: Igawk Program779758
+Ref: Igawk Program-Footnote-1794089
+Ref: Igawk Program-Footnote-2794291
+Ref: Igawk Program-Footnote-3794413
+Node: Anagram Program794528
+Node: Signature Program797590
+Node: Programs Summary798837
+Node: Programs Exercises800051
+Ref: Programs Exercises-Footnote-1804180
+Node: Advanced Features804271
+Node: Nondecimal Data806261
+Node: Array Sorting807852
+Node: Controlling Array Traversal808552
+Ref: Controlling Array Traversal-Footnote-1816919
+Node: Array Sorting Functions817037
+Ref: Array Sorting Functions-Footnote-1822128
+Node: Two-way I/O822324
+Ref: Two-way I/O-Footnote-1828875
+Ref: Two-way I/O-Footnote-2829062
+Node: TCP/IP Networking829144
+Node: Profiling832262
+Ref: Profiling-Footnote-1840934
+Node: Advanced Features Summary841257
+Node: Internationalization843101
+Node: I18N and L10N844581
+Node: Explaining gettext845268
+Ref: Explaining gettext-Footnote-1851160
+Ref: Explaining gettext-Footnote-2851345
+Node: Programmer i18n851510
+Ref: Programmer i18n-Footnote-1856459
+Node: Translator i18n856508
+Node: String Extraction857302
+Ref: String Extraction-Footnote-1858434
+Node: Printf Ordering858520
+Ref: Printf Ordering-Footnote-1861306
+Node: I18N Portability861370
+Ref: I18N Portability-Footnote-1863826
+Node: I18N Example863889
+Ref: I18N Example-Footnote-1866695
+Node: Gawk I18N866768
+Node: I18N Summary867413
+Node: Debugger868754
+Node: Debugging869776
+Node: Debugging Concepts870217
+Node: Debugging Terms872026
+Node: Awk Debugging874601
+Node: Sample Debugging Session875507
+Node: Debugger Invocation876041
+Node: Finding The Bug877427
+Node: List of Debugger Commands883905
+Node: Breakpoint Control885238
+Node: Debugger Execution Control888932
+Node: Viewing And Changing Data892294
+Node: Execution Stack895668
+Node: Debugger Info897305
+Node: Miscellaneous Debugger Commands901376
+Node: Readline Support906464
+Node: Limitations907360
+Node: Debugging Summary909469
+Node: Arbitrary Precision Arithmetic910748
+Node: Computer Arithmetic912233
+Ref: table-numeric-ranges915824
+Ref: Computer Arithmetic-Footnote-1916546
+Node: Math Definitions916603
+Ref: table-ieee-formats919917
+Ref: Math Definitions-Footnote-1920520
+Node: MPFR features920625
+Node: FP Math Caution922342
+Ref: FP Math Caution-Footnote-1923414
+Node: Inexactness of computations923783
+Node: Inexact representation924743
+Node: Comparing FP Values926103
+Node: Errors accumulate927185
+Node: Getting Accuracy928618
+Node: Try To Round931328
+Node: Setting precision932227
+Ref: table-predefined-precision-strings932924
+Node: Setting the rounding mode934754
+Ref: table-gawk-rounding-modes935128
+Ref: Setting the rounding mode-Footnote-1938536
+Node: Arbitrary Precision Integers938715
+Ref: Arbitrary Precision Integers-Footnote-1943620
+Node: Checking for MPFR943769
+Node: POSIX Floating Point Problems945066
+Ref: POSIX Floating Point Problems-Footnote-1948937
+Node: Floating point summary948975
+Node: Dynamic Extensions951165
+Node: Extension Intro952718
+Node: Plugin License953984
+Node: Extension Mechanism Outline954781
+Ref: figure-load-extension955220
+Ref: figure-register-new-function956785
+Ref: figure-call-new-function957877
+Node: Extension API Description959939
+Node: Extension API Functions Introduction961581
+Node: General Data Types966915
+Ref: General Data Types-Footnote-1974120
+Node: Memory Allocation Functions974419
+Ref: Memory Allocation Functions-Footnote-1977264
+Node: Constructor Functions977363
+Node: Registration Functions980362
+Node: Extension Functions981047
+Node: Exit Callback Functions986260
+Node: Extension Version String987510
+Node: Input Parsers988173
+Node: Output Wrappers1000880
+Node: Two-way processors1005392
+Node: Printing Messages1007657
+Ref: Printing Messages-Footnote-11008828
+Node: Updating ERRNO1008981
+Node: Requesting Values1009720
+Ref: table-value-types-returned1010457
+Node: Accessing Parameters1011393
+Node: Symbol Table Access1012628
+Node: Symbol table by name1013140
+Node: Symbol table by cookie1014929
+Ref: Symbol table by cookie-Footnote-11019114
+Node: Cached values1019178
+Ref: Cached values-Footnote-11022714
+Node: Array Manipulation1022805
+Ref: Array Manipulation-Footnote-11023896
+Node: Array Data Types1023933
+Ref: Array Data Types-Footnote-11026591
+Node: Array Functions1026683
+Node: Flattening Arrays1031082
+Node: Creating Arrays1038023
+Node: Redirection API1042792
+Node: Extension API Variables1045634
+Node: Extension Versioning1046267
+Ref: gawk-api-version1046704
+Node: Extension API Informational Variables1048432
+Node: Extension API Boilerplate1049496
+Node: Changes from API V11053358
+Node: Finding Extensions1054018
+Node: Extension Example1054577
+Node: Internal File Description1055375
+Node: Internal File Ops1059455
+Ref: Internal File Ops-Footnote-11070855
+Node: Using Internal File Ops1070995
+Ref: Using Internal File Ops-Footnote-11073378
+Node: Extension Samples1073652
+Node: Extension Sample File Functions1075181
+Node: Extension Sample Fnmatch1082830
+Node: Extension Sample Fork1084317
+Node: Extension Sample Inplace1085535
+Node: Extension Sample Ord1088752
+Node: Extension Sample Readdir1089588
+Ref: table-readdir-file-types1090477
+Node: Extension Sample Revout1091282
+Node: Extension Sample Rev2way1091871
+Node: Extension Sample Read write array1092611
+Node: Extension Sample Readfile1094553
+Node: Extension Sample Time1095648
+Node: Extension Sample API Tests1096996
+Node: gawkextlib1097488
+Node: Extension summary1099935
+Node: Extension Exercises1103637
+Node: Language History1105135
+Node: V7/SVR3.11106791
+Node: SVR41108943
+Node: POSIX1110377
+Node: BTL1111756
+Node: POSIX/GNU1112485
+Node: Feature History1118377
+Node: Common Extensions1132801
+Node: Ranges and Locales1134084
+Ref: Ranges and Locales-Footnote-11138700
+Ref: Ranges and Locales-Footnote-21138727
+Ref: Ranges and Locales-Footnote-31138962
+Node: Contributors1139183
+Node: History summary1144743
+Node: Installation1146123
+Node: Gawk Distribution1147067
+Node: Getting1147551
+Node: Extracting1148512
+Node: Distribution contents1150150
+Node: Unix Installation1156492
+Node: Quick Installation1157174
+Node: Shell Startup Files1159588
+Node: Additional Configuration Options1160677
+Node: Configuration Philosophy1162666
+Node: Non-Unix Installation1165035
+Node: PC Installation1165495
+Node: PC Binary Installation1166333
+Node: PC Compiling1166768
+Node: PC Using1167885
+Node: Cygwin1170930
+Node: MSYS1171700
+Node: VMS Installation1172201
+Node: VMS Compilation1172992
+Ref: VMS Compilation-Footnote-11174221
+Node: VMS Dynamic Extensions1174279
+Node: VMS Installation Details1175964
+Node: VMS Running1178217
+Node: VMS GNV1182496
+Node: VMS Old Gawk1183231
+Node: Bugs1183702
+Node: Bug address1184365
+Node: Usenet1186762
+Node: Maintainers1187539
+Node: Other Versions1188915
+Node: Installation summary1195499
+Node: Notes1196534
+Node: Compatibility Mode1197399
+Node: Additions1198181
+Node: Accessing The Source1199106
+Node: Adding Code1200541
+Node: New Ports1206759
+Node: Derived Files1211247
+Ref: Derived Files-Footnote-11216732
+Ref: Derived Files-Footnote-21216767
+Ref: Derived Files-Footnote-31217365
+Node: Future Extensions1217479
+Node: Implementation Limitations1218137
+Node: Extension Design1219320
+Node: Old Extension Problems1220474
+Ref: Old Extension Problems-Footnote-11221992
+Node: Extension New Mechanism Goals1222049
+Ref: Extension New Mechanism Goals-Footnote-11225413
+Node: Extension Other Design Decisions1225602
+Node: Extension Future Growth1227715
+Node: Old Extension Mechanism1228551
+Node: Notes summary1230314
+Node: Basic Concepts1231496
+Node: Basic High Level1232177
+Ref: figure-general-flow1232459
+Ref: figure-process-flow1233144
+Ref: Basic High Level-Footnote-11236445
+Node: Basic Data Typing1236630
+Node: Glossary1239958
+Node: Copying1271905
+Node: GNU Free Documentation License1309444
+Node: Index1334562

End Tag Table