summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-27 21:57:30 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-27 21:57:30 +0200
commit00c8e9d7dbd0a868f066f3f83c277d0cd3901af5 (patch)
treebf6924242f3764f3126a021b0b967971477dd188
parentbfd8866ce49d4a816e5e11f0d3cbdda298ea5ec9 (diff)
downloadgawk-00c8e9d7dbd0a868f066f3f83c277d0cd3901af5.tar.gz
First round of indexing changes.
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/gawk.info1577
-rw-r--r--doc/gawk.texi423
-rw-r--r--doc/gawktexi.in417
4 files changed, 1487 insertions, 934 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index fed2cc82..1a59539c 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2014-03-27 Eli Zaretskii <eliz@gnu.org>
+
+ * gawktexi.in: First round of massive indexing improvements.
+
2014-03-27 Antonio Giovanni Colombo <azc100@gmail.com>
* gawktexi.in: Redo all the examples using BBS-list to a different
diff --git a/doc/gawk.info b/doc/gawk.info
index 2e18da5b..29af8ab4 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -2475,7 +2475,7 @@ The following list describes options mandated by the POSIX standard:
`--bignum'
Force arbitrary precision arithmetic on numbers. This option has
no effect if `gawk' is not compiled to use the GNU MPFR and MP
- libraries (*note Arbitrary Precision Arithmetic::).
+ libraries (*note Gawk and MPFR::).
`-n'
`--non-decimal-data'
@@ -2743,13 +2743,14 @@ on the command-line with the `-f' option. In most `awk'
implementations, you must supply a precise path name for each program
file, unless the file is in the current directory. But in `gawk', if
the file name supplied to the `-f' or `-i' options does not contain a
-`/', then `gawk' searches a list of directories (called the "search
-path"), one by one, looking for a file with the specified name.
+directory separator `/', then `gawk' searches a list of directories
+(called the "search path"), one by one, looking for a file with the
+specified name.
The search path is a string consisting of directory names separated by
-colons. `gawk' gets its search path from the `AWKPATH' environment
+colons(1). `gawk' gets its search path from the `AWKPATH' environment
variable. If that variable does not exist, `gawk' uses a default path,
-`.:/usr/local/share/awk'.(1)
+`.:/usr/local/share/awk'.(2)
The search path feature is particularly useful for building libraries
of useful `awk' functions. The library files can be placed in a
@@ -2790,7 +2791,9 @@ found, and `gawk' no longer needs to use `AWKPATH'.
---------- Footnotes ----------
- (1) Your version of `gawk' may use a different directory; it will
+ (1) Semicolons on MS-Windows and MS-DOS.
+
+ (2) Your version of `gawk' may use a different directory; it will
depend upon how `gawk' was built and installed. The actual directory is
the value of `$(datadir)' generated when `gawk' was configured. You
probably don't need to worry about this, though.
@@ -9873,8 +9876,8 @@ with a pound sign (`#').
The following additional elements in the array are available to
provide information about the MPFR and GMP libraries if your
- version of `gawk' supports arbitrary precision numbers (*note
- Arbitrary Precision Arithmetic::):
+ version of `gawk' supports arbitrary precision numbers (*note Gawk
+ and MPFR::):
`PROCINFO["mpfr_version"]'
The version of the GNU MPFR library.
@@ -11272,9 +11275,10 @@ pound sign (`#'):
SOURCE is duplicated into DEST. DEST is then sorted, leaving the
indices of SOURCE unchanged.
- When comparing strings, `IGNORECASE' affects the sorting. If the
- SOURCE array contains subarrays as values (*note Arrays of
- Arrays::), they will come last, after all scalar values.
+ When comparing strings, `IGNORECASE' affects the sorting (*note
+ Array Sorting Functions::). If the SOURCE array contains
+ subarrays as values (*note Arrays of Arrays::), they will come
+ last, after all scalar values.
For example, if the contents of `a' are as follows:
@@ -11313,7 +11317,7 @@ pound sign (`#'):
`$0'. It returns the modified string as the result of the
function and the original target string is _not_ changed.
- `gensub()' is a general substitution function. It's purpose is to
+ `gensub()' is a general substitution function. Its purpose is to
provide more features than the standard `sub()' and `gsub()'
functions.
@@ -16028,9 +16032,9 @@ groups in the `PROCINFO' array have the indices `"group1"' through
However, we don't know in advance how many of these groups there are.
This loop works by starting at one, concatenating the value with
-`"group"', and then using `in' to see if that value is in the array.
-Eventually, `i' is incremented past the last group in the array and the
-loop exits.
+`"group"', and then using `in' to see if that value is in the array
+(*note Reference to Elements::). Eventually, `i' is incremented past
+the last group in the array and the loop exits.
The loop is also correct if there are _no_ supplementary groups;
then the condition is false the first time it's tested, and the loop
@@ -30024,9 +30028,9 @@ Index
* ! (exclamation point), !~ operator <5>: Computed Regexps. (line 6)
* ! (exclamation point), !~ operator <6>: Case-sensitivity. (line 26)
* ! (exclamation point), !~ operator: Regexp Usage. (line 19)
-* " (double quote) <1>: Quoting. (line 37)
-* " (double quote): Read Terminal. (line 25)
+* " (double quote) in shell commands: Read Terminal. (line 25)
* " (double quote), in regexp constants: Computed Regexps. (line 28)
+* " (double quote), in shell commands: Quoting. (line 37)
* # (number sign), #! (executable scripts): Executable Scripts.
(line 6)
* # (number sign), commenting: Comments. (line 6)
@@ -30042,13 +30046,13 @@ Index
* & (ampersand), && operator: Boolean Ops. (line 57)
* & (ampersand), gsub()/gensub()/sub() functions and: Gory Details.
(line 6)
-* ' (single quote) <1>: Quoting. (line 31)
-* ' (single quote) <2>: Long. (line 33)
* ' (single quote): One-shot. (line 15)
+* ' (single quote) in gawk command lines: Long. (line 33)
+* ' (single quote), in shell commands: Quoting. (line 31)
* ' (single quote), vs. apostrophe: Comments. (line 27)
* ' (single quote), with double quotes: Quoting. (line 53)
-* () (parentheses) <1>: Profiling. (line 146)
* () (parentheses): Regexp Operators. (line 79)
+* () (parentheses), in a profile: Profiling. (line 146)
* * (asterisk), * operator, as multiplication operator: Precedence.
(line 55)
* * (asterisk), * operator, as regexp operator: Regexp Operators.
@@ -30086,8 +30090,9 @@ Index
(line 15)
* --disable-nls configuration option: Additional Configuration Options.
(line 30)
-* --dump-variables option <1>: Library Names. (line 45)
* --dump-variables option: Options. (line 93)
+* --dump-variables option, using for library functions: Library Names.
+ (line 45)
* --exec option: Options. (line 125)
* --field-separator option: Options. (line 21)
* --file option: Options. (line 25)
@@ -30130,12 +30135,12 @@ Index
* -d option: Options. (line 93)
* -E option: Options. (line 125)
* -e option: Options. (line 117)
-* -F option: Command Line Field Separator.
- (line 6)
* -f option: Options. (line 25)
* -F option: Options. (line 21)
* -f option: Long. (line 12)
* -F option, -Ft sets FS to TAB: Options. (line 301)
+* -F option, command line: Command Line Field Separator.
+ (line 6)
* -f option, multiple uses: Options. (line 306)
* -g option: Options. (line 147)
* -h option: Options. (line 154)
@@ -30155,7 +30160,7 @@ Index
* -V option: Options. (line 293)
* -v option: Options. (line 32)
* -W option: Options. (line 46)
-* . (period): Regexp Operators. (line 43)
+* . (period), regexp operator: Regexp Operators. (line 43)
* .gmo files: Explaining gettext. (line 41)
* .gmo files, converting from .po: I18N Example. (line 62)
* .gmo files, specifying directory of <1>: Programmer i18n. (line 47)
@@ -30164,7 +30169,7 @@ Index
* .po files: Explaining gettext. (line 36)
* .po files, converting to .gmo: I18N Example. (line 62)
* .pot files: Explaining gettext. (line 30)
-* / (forward slash): Regexp. (line 10)
+* / (forward slash) to enclose regular expressions: Regexp. (line 10)
* / (forward slash), / operator: Precedence. (line 55)
* / (forward slash), /= operator <1>: Precedence. (line 95)
* / (forward slash), /= operator: Assignment Ops. (line 129)
@@ -30208,11 +30213,9 @@ Index
* ? (question mark), regexp operator <1>: GNU Regexp Operators.
(line 59)
* ? (question mark), regexp operator: Regexp Operators. (line 111)
-* [] (square brackets): Regexp Operators. (line 55)
-* \ (backslash) <1>: Regexp Operators. (line 18)
-* \ (backslash) <2>: Quoting. (line 31)
-* \ (backslash) <3>: Comments. (line 50)
-* \ (backslash): Read Terminal. (line 25)
+* [] (square brackets), regexp operator: Regexp Operators. (line 55)
+* \ (backslash): Comments. (line 50)
+* \ (backslash) in shell commands: Read Terminal. (line 25)
* \ (backslash), \" escape sequence: Escape Sequences. (line 76)
* \ (backslash), \' operator (gawk): GNU Regexp Operators.
(line 56)
@@ -30259,6 +30262,8 @@ Index
* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
(line 112)
* \ (backslash), in regexp constants: Computed Regexps. (line 28)
+* \ (backslash), in shell commands: Quoting. (line 31)
+* \ (backslash), regexp operator: Regexp Operators. (line 18)
* ^ (caret), ^ operator: Precedence. (line 49)
* ^ (caret), ^= operator <1>: Precedence. (line 95)
* ^ (caret), ^= operator: Assignment Ops. (line 129)
@@ -30276,6 +30281,8 @@ Index
* _ord_init() user-defined function: Ordinal Functions. (line 16)
* _pw_init() user-defined function: Passwd Functions. (line 105)
* accessing fields: Fields. (line 6)
+* accessing global variables from extensions: Symbol Table Access.
+ (line 6)
* account information <1>: Group Functions. (line 6)
* account information: Passwd Functions. (line 16)
* actions: Action Overview. (line 6)
@@ -30298,6 +30305,8 @@ Index
* alarm clock example program: Alarm Program. (line 11)
* alarm.awk program: Alarm Program. (line 31)
* algorithms: Basic High Level. (line 68)
+* allocating memory for extensions: Memory Allocation Functions.
+ (line 6)
* Alpha (DEC): Manual History. (line 28)
* amazing awk assembler (aaa): Glossary. (line 12)
* amazingly workable formatter (awf): Glossary. (line 25)
@@ -30313,13 +30322,20 @@ Index
* and Boolean-logic operator: Boolean Ops. (line 6)
* and() function (gawk): Bitwise Functions. (line 39)
* ANSI: Glossary. (line 35)
+* API informational variables: Extension API Informational Variables.
+ (line 6)
+* API version: Extension Versioning.
+ (line 6)
* arbitrary precision: Arbitrary Precision Arithmetic.
(line 6)
+* arbitrary precision integers: Arbitrary Precision Integers.
+ (line 6)
* archeologists: Bugs. (line 6)
-* ARGC/ARGV variables <1>: ARGC and ARGV. (line 6)
+* arctangent: Numeric Functions. (line 11)
* ARGC/ARGV variables: Auto-set. (line 11)
* ARGC/ARGV variables, command-line arguments: Other Arguments.
(line 12)
+* ARGC/ARGV variables, how to use: ARGC and ARGV. (line 6)
* ARGC/ARGV variables, portability and: Executable Scripts. (line 42)
* ARGIND variable: Auto-set. (line 40)
* ARGIND variable, command-line arguments: Other Arguments. (line 12)
@@ -30329,36 +30345,50 @@ Index
* arguments, command-line, invoking awk: Command Line. (line 6)
* arguments, in function calls: Function Calls. (line 16)
* arguments, processing: Getopt Function. (line 6)
+* ARGV array, indexing into: Other Arguments. (line 12)
* arithmetic operators: Arithmetic Ops. (line 6)
+* array manipulation in extensions: Array Manipulation. (line 6)
+* array members: Reference to Elements.
+ (line 6)
+* array scanning order, controlling: Controlling Scanning.
+ (line 12)
+* array, number of elements: String Functions. (line 194)
* arrays: Arrays. (line 6)
+* arrays of arrays: Arrays of Arrays. (line 6)
+* arrays, an example of using: Array Example. (line 6)
+* arrays, and IGNORECASE variable: Array Intro. (line 91)
* arrays, as parameters to functions: Pass By Value/Reference.
(line 47)
* arrays, associative: Array Intro. (line 49)
* arrays, associative, library functions and: Library Names. (line 57)
* arrays, deleting entire contents: Delete. (line 39)
-* arrays, elements, assigning: Assigning Elements. (line 6)
+* arrays, elements that don't exist: Reference to Elements.
+ (line 23)
+* arrays, elements, assigning values: Assigning Elements. (line 6)
* arrays, elements, deleting: Delete. (line 6)
-* arrays, elements, order of: Scanning an Array. (line 48)
-* arrays, elements, referencing: Reference to Elements.
- (line 6)
+* arrays, elements, order of access by in operator: Scanning an Array.
+ (line 48)
* arrays, elements, retrieving number of: String Functions. (line 32)
* arrays, for statement and: Scanning an Array. (line 20)
-* arrays, IGNORECASE variable and: Array Intro. (line 91)
* arrays, indexing: Array Intro. (line 49)
* arrays, merging into strings: Join Function. (line 6)
* arrays, multidimensional: Multidimensional. (line 10)
* arrays, multidimensional, scanning: Multiscanning. (line 11)
-* arrays, names of: Arrays. (line 18)
+* arrays, names of, and names of functions/variables: Arrays. (line 18)
+* arrays, numeric subscripts: Numeric Array Subscripts.
+ (line 6)
+* arrays, referencing elements: Reference to Elements.
+ (line 6)
* arrays, scanning: Scanning an Array. (line 6)
* arrays, sorting: Array Sorting Functions.
(line 6)
-* arrays, sorting, IGNORECASE variable and: Array Sorting Functions.
+* arrays, sorting, and IGNORECASE variable: Array Sorting Functions.
(line 83)
* arrays, sparse: Array Intro. (line 70)
-* arrays, subscripts: Numeric Array Subscripts.
- (line 6)
* arrays, subscripts, uninitialized variables as: Uninitialized Subscripts.
(line 6)
+* arrays, unassigned elements: Reference to Elements.
+ (line 18)
* artificial intelligence, gawk and: Distribution contents.
(line 52)
* ASCII <1>: Glossary. (line 133)
@@ -30376,6 +30406,8 @@ Index
* assert() function (C library): Assert Function. (line 6)
* assert() user-defined function: Assert Function. (line 28)
* assertions: Assert Function. (line 6)
+* assign values to variables, in debugger: Viewing And Changing Data.
+ (line 59)
* assignment operators: Assignment Ops. (line 6)
* assignment operators, evaluation order: Assignment Ops. (line 111)
* assignment operators, lvalues/rvalues: Assignment Ops. (line 32)
@@ -30394,6 +30426,7 @@ Index
* asterisk (*), *= operator <1>: Precedence. (line 95)
* asterisk (*), *= operator: Assignment Ops. (line 129)
* atan2() function: Numeric Functions. (line 11)
+* automatic displays, in debugger: Debugger Info. (line 24)
* awf (amazingly workable formatter) program: Glossary. (line 25)
* awk debugging, enabling: Options. (line 108)
* awk language, POSIX version: Assignment Ops. (line 136)
@@ -30455,10 +30488,8 @@ Index
* awksed.awk program: Simple Sed. (line 25)
* awkvars.out file: Options. (line 93)
* b debugger command (alias for break): Breakpoint Control. (line 11)
-* backslash (\) <1>: Regexp Operators. (line 18)
-* backslash (\) <2>: Quoting. (line 31)
-* backslash (\) <3>: Comments. (line 50)
-* backslash (\): Read Terminal. (line 25)
+* backslash (\): Comments. (line 50)
+* backslash (\) in shell commands: Read Terminal. (line 25)
* backslash (\), \" escape sequence: Escape Sequences. (line 76)
* backslash (\), \' operator (gawk): GNU Regexp Operators.
(line 56)
@@ -30505,13 +30536,15 @@ Index
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
(line 112)
* backslash (\), in regexp constants: Computed Regexps. (line 28)
+* backslash (\), in shell commands: Quoting. (line 31)
+* backslash (\), regexp operator: Regexp Operators. (line 18)
* backtrace debugger command: Execution Stack. (line 13)
* Beebe, Nelson H.F. <1>: Other Versions. (line 78)
* Beebe, Nelson H.F.: Acknowledgments. (line 60)
-* BEGIN pattern <1>: Profiling. (line 62)
+* BEGIN pattern <1>: Using BEGIN/END. (line 6)
* BEGIN pattern <2>: BEGIN/END. (line 6)
-* BEGIN pattern <3>: Field Separators. (line 45)
-* BEGIN pattern: Records. (line 29)
+* BEGIN pattern: Field Separators. (line 45)
+* BEGIN pattern, and profiling: Profiling. (line 62)
* BEGIN pattern, assert() user-defined function and: Assert Function.
(line 83)
* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 70)
@@ -30545,7 +30578,12 @@ Index
(line 33)
* BINMODE variable <1>: PC Using. (line 33)
* BINMODE variable: User-modified. (line 10)
+* bit-manipulation functions: Bitwise Functions. (line 6)
* bits2str() user-defined function: Bitwise Functions. (line 70)
+* bitwise AND: Bitwise Functions. (line 39)
+* bitwise complement: Bitwise Functions. (line 43)
+* bitwise OR: Bitwise Functions. (line 49)
+* bitwise XOR: Bitwise Functions. (line 55)
* bitwise, complement: Bitwise Functions. (line 25)
* bitwise, operations: Bitwise Functions. (line 6)
* bitwise, shift: Bitwise Functions. (line 32)
@@ -30574,6 +30612,14 @@ Index
(line 6)
* break debugger command: Breakpoint Control. (line 11)
* break statement: Break Statement. (line 6)
+* breakpoint: Debugging Terms. (line 33)
+* breakpoint at location, how to delete: Breakpoint Control. (line 36)
+* breakpoint commands: Debugger Execution Control.
+ (line 10)
+* breakpoint condition: Breakpoint Control. (line 54)
+* breakpoint, delete by number: Breakpoint Control. (line 64)
+* breakpoint, how to disable or enable: Breakpoint Control. (line 69)
+* breakpoint, setting: Breakpoint Control. (line 11)
* Brennan, Michael <1>: Other Versions. (line 6)
* Brennan, Michael <2>: Two-way I/O. (line 6)
* Brennan, Michael <3>: Simple Sed. (line 25)
@@ -30581,7 +30627,7 @@ Index
* Brennan, Michael: Foreword. (line 83)
* Brian Kernighan's awk <1>: I/O Functions. (line 40)
* Brian Kernighan's awk <2>: Gory Details. (line 15)
-* Brian Kernighan's awk <3>: String Functions. (line 489)
+* Brian Kernighan's awk <3>: String Functions. (line 490)
* Brian Kernighan's awk <4>: Delete. (line 48)
* Brian Kernighan's awk <5>: Nextfile Statement. (line 47)
* Brian Kernighan's awk <6>: Continue Statement. (line 43)
@@ -30625,6 +30671,7 @@ Index
(line 47)
* call by value: Pass By Value/Reference.
(line 18)
+* call stack, display in debugger: Execution Stack. (line 13)
* caret (^), ^ operator: Precedence. (line 49)
* caret (^), ^= operator <1>: Precedence. (line 95)
* caret (^), ^= operator: Assignment Ops. (line 129)
@@ -30633,16 +30680,18 @@ Index
(line 59)
* caret (^), regexp operator: Regexp Operators. (line 22)
* case keyword: Switch Statement. (line 6)
+* case sensitivity, and regexps: User-modified. (line 82)
+* case sensitivity, and string comparisons: User-modified. (line 82)
* case sensitivity, array indices and: Array Intro. (line 91)
-* case sensitivity, converting case: String Functions. (line 519)
+* case sensitivity, converting case: String Functions. (line 520)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
-* case sensitivity, regexps and <1>: User-modified. (line 82)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
-* case sensitivity, string comparisons and: User-modified. (line 82)
* CGI, awk scripts for: Options. (line 125)
+* changing precision of a number: Changing Precision. (line 6)
* character classes, See bracket expressions: Regexp Operators.
(line 55)
+* character lists in regular expression: Bracket Expressions. (line 6)
* character lists, See bracket expressions: Regexp Operators. (line 55)
* character sets (machine character encodings) <1>: Glossary. (line 133)
* character sets (machine character encodings): Ordinal Functions.
@@ -30664,12 +30713,12 @@ Index
(line 6)
* cliff_rand() user-defined function: Cliff Random Function.
(line 12)
+* close file or coprocess: I/O Functions. (line 10)
* close() function <1>: I/O Functions. (line 10)
-* close() function <2>: Close Files And Pipes.
+* close() function: Close Files And Pipes.
(line 18)
-* close() function <3>: Getline/Pipe. (line 27)
-* close() function: Getline/Variable/File.
- (line 30)
+* close() function, portability: Close Files And Pipes.
+ (line 81)
* close() function, return value: Close Files And Pipes.
(line 130)
* close() function, two-way pipes and: Two-way I/O. (line 77)
@@ -30683,6 +30732,7 @@ Index
* columns, aligning: Print Examples. (line 70)
* columns, cutting: Cut Program. (line 6)
* comma (,), in range patterns: Ranges. (line 6)
+* command completion, in debugger: Readline Support. (line 6)
* command line, arguments <1>: ARGC and ARGV. (line 6)
* command line, arguments <2>: Auto-set. (line 11)
* command line, arguments: Other Arguments. (line 6)
@@ -30692,16 +30742,16 @@ Index
* command line, FS on, setting: Command Line Field Separator.
(line 6)
* command line, invoking awk from: Command Line. (line 6)
-* command line, options <1>: Command Line Field Separator.
- (line 6)
-* command line, options <2>: Options. (line 6)
-* command line, options: Long. (line 12)
+* command line, option -f: Long. (line 12)
+* command line, options: Options. (line 6)
* command line, options, end of: Options. (line 54)
* command line, variables, assigning on: Assignment Options. (line 6)
* command-line options, processing: Getopt Function. (line 6)
* command-line options, string extraction: String Extraction. (line 6)
* commands debugger command: Debugger Execution Control.
(line 10)
+* commands to execute at breakpoint: Debugger Execution Control.
+ (line 10)
* commenting: Comments. (line 6)
* commenting, backslash continuation and: Statements/Lines. (line 76)
* common extensions, ** operator: Arithmetic Ops. (line 30)
@@ -30714,7 +30764,7 @@ Index
* common extensions, delete to delete entire arrays: Delete. (line 39)
* common extensions, func keyword: Definition Syntax. (line 83)
* common extensions, length() applied to an array: String Functions.
- (line 193)
+ (line 194)
* common extensions, RS as a regexp: Records. (line 135)
* common extensions, single character fields: Single Character Fields.
(line 6)
@@ -30753,25 +30803,33 @@ Index
(line 35)
* configuration options, gawk: Additional Configuration Options.
(line 6)
+* constant regexps: Regexp Usage. (line 57)
* constants, floating-point: Floating-point Constants.
(line 6)
* constants, nondecimal: Nondecimal Data. (line 6)
+* constants, numeric: Scalar Constants. (line 6)
* constants, types of: Constants. (line 6)
* context, floating-point: Floating-point Context.
(line 6)
+* continue program, in debugger: Debugger Execution Control.
+ (line 33)
* continue statement: Continue Statement. (line 6)
* control statements: Statements. (line 6)
-* converting, case: String Functions. (line 519)
-* converting, dates to timestamps: Time Functions. (line 75)
-* converting, during subscripting: Numeric Array Subscripts.
+* controlling array scanning order: Controlling Scanning.
+ (line 12)
+* convert string to lower case: String Functions. (line 521)
+* convert string to number: String Functions. (line 385)
+* convert string to upper case: String Functions. (line 527)
+* converting integer array subscripts: Numeric Array Subscripts.
(line 31)
+* converting, dates to timestamps: Time Functions. (line 75)
* converting, numbers to strings <1>: Bitwise Functions. (line 109)
* converting, numbers to strings: Conversion. (line 6)
* converting, strings to numbers <1>: Bitwise Functions. (line 109)
* converting, strings to numbers: Conversion. (line 6)
* CONVFMT variable <1>: User-modified. (line 28)
* CONVFMT variable: Conversion. (line 29)
-* CONVFMT variable, array subscripts and: Numeric Array Subscripts.
+* CONVFMT variable, and array subscripts: Numeric Array Subscripts.
(line 6)
* cookie: Glossary. (line 149)
* coprocesses <1>: Two-way I/O. (line 44)
@@ -30780,14 +30838,19 @@ Index
(line 6)
* coprocesses, getline from: Getline/Coprocess. (line 6)
* cos() function: Numeric Functions. (line 15)
+* cosine: Numeric Functions. (line 15)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 44)
* csh utility, POSIXLY_CORRECT environment variable: Options. (line 348)
* csh utility, |& operator, comparison with: Two-way I/O. (line 44)
* ctime() user-defined function: Function Example. (line 73)
* currency symbols, localization: Explaining gettext. (line 103)
+* current system time: Time Functions. (line 65)
* custom.h file: Configuration Philosophy.
(line 30)
+* customized input parser: Input Parsers. (line 6)
+* customized output wrapper: Output Wrappers. (line 6)
+* customized two-way processor: Two-way processors. (line 6)
* cut utility: Cut Program. (line 6)
* cut.awk program: Cut Program. (line 45)
* d debugger command (alias for delete): Breakpoint Control. (line 64)
@@ -30821,7 +30884,7 @@ Index
(line 20)
* dark corner, input files: Records. (line 118)
* dark corner, invoking awk: Command Line. (line 16)
-* dark corner, length() function: String Functions. (line 179)
+* dark corner, length() function: String Functions. (line 180)
* dark corner, locale's decimal point character: Conversion. (line 77)
* dark corner, multiline records: Multiple Line. (line 35)
* dark corner, NF variable, decrementing: Changing Fields. (line 107)
@@ -30832,7 +30895,7 @@ Index
(line 147)
* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
(line 43)
-* dark corner, split() function: String Functions. (line 358)
+* dark corner, split() function: String Functions. (line 359)
* dark corner, strings, storing: Records. (line 210)
* dark corner, value of ARGV[0]: Auto-set. (line 35)
* data, fixed-width: Constant Size. (line 10)
@@ -30951,6 +31014,12 @@ Index
(line 67)
* debugger commands, watch: Viewing And Changing Data.
(line 67)
+* debugger history file: Debugger Info. (line 80)
+* debugger history size: Debugger Info. (line 65)
+* debugger options: Debugger Info. (line 57)
+* debugger prompt: Debugger Info. (line 77)
+* debugger, how to start: Debugger Invocation. (line 6)
+* debugger, read commands from a file: Debugger Info. (line 96)
* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
* decimal point character, locale specific: Options. (line 263)
@@ -30959,12 +31028,18 @@ Index
* Deifik, Scott <1>: Bugs. (line 70)
* Deifik, Scott <2>: Contributors. (line 53)
* Deifik, Scott: Acknowledgments. (line 60)
+* delete ARRAY: Delete. (line 39)
+* delete breakpoint at location: Breakpoint Control. (line 36)
+* delete breakpoint by number: Breakpoint Control. (line 64)
* delete debugger command: Breakpoint Control. (line 64)
* delete statement: Delete. (line 6)
+* delete watchpoint: Viewing And Changing Data.
+ (line 84)
* deleting elements in arrays: Delete. (line 6)
* deleting entire arrays: Delete. (line 39)
* Demaille, Akim: Acknowledgments. (line 60)
-* differences between gawk and awk: String Functions. (line 193)
+* describe call stack frame, in debugger: Debugger Info. (line 27)
+* differences between gawk and awk: String Functions. (line 194)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 88)
* differences in awk and gawk, ARGIND variable: Auto-set. (line 40)
@@ -31011,7 +31086,7 @@ Index
(line 34)
* differences in awk and gawk, LINT variable: User-modified. (line 98)
* differences in awk and gawk, match() function: String Functions.
- (line 256)
+ (line 257)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
* differences in awk and gawk, PROCINFO array: Auto-set. (line 133)
@@ -31025,7 +31100,7 @@ Index
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
- (line 346)
+ (line 347)
* differences in awk and gawk, strings: Scalar Constants. (line 20)
* differences in awk and gawk, strings, storing: Records. (line 206)
* differences in awk and gawk, SYMTAB variable: Auto-set. (line 274)
@@ -31035,15 +31110,18 @@ Index
(line 66)
* directories, command line: Command line directories.
(line 6)
-* directories, searching <1>: Igawk Program. (line 368)
-* directories, searching <2>: AWKLIBPATH Variable. (line 6)
-* directories, searching: AWKPATH Variable. (line 6)
+* directories, searching: Igawk Program. (line 368)
+* directories, searching for shared libraries: AWKLIBPATH Variable.
+ (line 6)
+* directories, searching for source files: AWKPATH Variable. (line 6)
+* disable breakpoint: Breakpoint Control. (line 69)
* disable debugger command: Breakpoint Control. (line 69)
* display debugger command: Viewing And Changing Data.
(line 8)
+* display debugger options: Debugger Info. (line 57)
* division: Arithmetic Ops. (line 44)
-* do-while statement <1>: Do Statement. (line 6)
-* do-while statement: Regexp Usage. (line 19)
+* do-while statement: Do Statement. (line 6)
+* do-while statement, use of regexps in: Regexp Usage. (line 19)
* documentation, of awk programs: Library Names. (line 6)
* documentation, online: Manual History. (line 11)
* documents, searching: Dupword Program. (line 6)
@@ -31053,35 +31131,46 @@ Index
(line 30)
* dollar sign ($), regexp operator: Regexp Operators. (line 35)
* double precision floating-point: General Arithmetic. (line 21)
-* double quote (") <1>: Quoting. (line 37)
-* double quote ("): Read Terminal. (line 25)
+* double quote (") in shell commands: Read Terminal. (line 25)
* double quote ("), in regexp constants: Computed Regexps. (line 28)
+* double quote ("), in shell commands: Quoting. (line 37)
* down debugger command: Execution Stack. (line 21)
* Drepper, Ulrich: Acknowledgments. (line 52)
+* dump all variables of a program: Options. (line 93)
* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
* dupword.awk program: Dupword Program. (line 31)
+* dynamic profiling: Profiling. (line 179)
+* dynamically loaded extensions: Dynamic Extensions. (line 6)
* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
+* effective group id of gawk user: Auto-set. (line 138)
+* effective user id of gawk user: Auto-set. (line 142)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 24)
* egrep.awk program: Egrep Program. (line 54)
-* elements in arrays: Reference to Elements.
- (line 6)
-* elements in arrays, assigning: Assigning Elements. (line 6)
+* elements in arrays, assigning values: Assigning Elements. (line 6)
* elements in arrays, deleting: Delete. (line 6)
-* elements in arrays, order of: Scanning an Array. (line 48)
+* elements in arrays, order of access by in operator: Scanning an Array.
+ (line 48)
* elements in arrays, scanning: Scanning an Array. (line 6)
+* elements of arrays: Reference to Elements.
+ (line 6)
* email address for bug reports, bug-gawk@gnu.org: Bugs. (line 30)
* EMISTERED: TCP/IP Networking. (line 6)
+* empty array elements: Reference to Elements.
+ (line 18)
* empty pattern: Empty. (line 6)
+* empty strings: Records. (line 122)
* empty strings, See null strings: Regexp Field Splitting.
(line 43)
+* enable breakpoint: Breakpoint Control. (line 73)
* enable debugger command: Breakpoint Control. (line 73)
* end debugger command: Debugger Execution Control.
(line 10)
-* END pattern <1>: Profiling. (line 62)
+* END pattern <1>: Using BEGIN/END. (line 6)
* END pattern: BEGIN/END. (line 6)
+* END pattern, and profiling: Profiling. (line 62)
* END pattern, assert() user-defined function and: Assert Function.
(line 75)
* END pattern, backslash continuation and: Egrep Program. (line 220)
@@ -31101,7 +31190,9 @@ Index
* endpwent() function (C library): Passwd Functions. (line 210)
* endpwent() user-defined function: Passwd Functions. (line 213)
* ENVIRON array: Auto-set. (line 60)
-* environment variables: Auto-set. (line 60)
+* environment variables used by gawk: Environment Variables.
+ (line 6)
+* environment variables, in ENVIRON array: Auto-set. (line 60)
* epoch, definition of: Glossary. (line 235)
* equals sign (=), = operator: Assignment Ops. (line 6)
* equals sign (=), == operator <1>: Precedence. (line 65)
@@ -31109,19 +31200,21 @@ Index
(line 11)
* EREs (Extended Regular Expressions): Bracket Expressions. (line 24)
* ERRNO variable <1>: TCP/IP Networking. (line 54)
-* ERRNO variable <2>: Auto-set. (line 73)
-* ERRNO variable <3>: BEGINFILE/ENDFILE. (line 26)
-* ERRNO variable <4>: Close Files And Pipes.
+* ERRNO variable: Auto-set. (line 73)
+* ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26)
+* ERRNO variable, with close() function: Close Files And Pipes.
(line 138)
-* ERRNO variable: Getline. (line 19)
+* ERRNO variable, with getline command: Getline. (line 19)
* error handling: Special FD. (line 16)
* error handling, ERRNO variable and: Auto-set. (line 73)
* error output: Special FD. (line 6)
* escape processing, gsub()/gensub()/sub() functions: Gory Details.
(line 6)
-* escape sequences: Escape Sequences. (line 6)
+* escape sequences, in strings: Escape Sequences. (line 6)
* eval debugger command: Viewing And Changing Data.
(line 23)
+* evaluate expressions, in debugger: Viewing And Changing Data.
+ (line 23)
* evaluation order: Increment Ops. (line 60)
* evaluation order, concatenation: Concatenation. (line 41)
* evaluation order, functions: Calling Built-in. (line 30)
@@ -31144,9 +31237,12 @@ Index
* exit statement: Exit Statement. (line 6)
* exit status, of gawk: Exit Status. (line 6)
* exit status, of VMS: VMS Running. (line 29)
+* exit the debugger: Miscellaneous Debugger Commands.
+ (line 99)
* exp() function: Numeric Functions. (line 18)
* expand utility: Very Simple. (line 69)
* Expat XML parser library: gawkextlib. (line 35)
+* exponent: Numeric Functions. (line 18)
* expressions: Expressions. (line 6)
* expressions, as patterns: Expression Patterns. (line 6)
* expressions, assignment: Assignment Ops. (line 6)
@@ -31158,6 +31254,20 @@ Index
(line 9)
* expressions, selecting: Conditional Exp. (line 6)
* Extended Regular Expressions (EREs): Bracket Expressions. (line 24)
+* extension API: Extension API Description.
+ (line 6)
+* extension API informational variables: Extension API Informational Variables.
+ (line 6)
+* extension API version: Extension Versioning.
+ (line 6)
+* extension API, version number: Auto-set. (line 229)
+* extension example: Extension Example. (line 6)
+* extension registration: Registration Functions.
+ (line 6)
+* extension search path: Finding Extensions. (line 6)
+* extensions distributed with gawk: Extension Samples. (line 6)
+* extensions, allocating memory: Memory Allocation Functions.
+ (line 6)
* extensions, Brian Kernighan's awk <1>: Common Extensions. (line 6)
* extensions, Brian Kernighan's awk: BTL. (line 6)
* extensions, common, ** operator: Arithmetic Ops. (line 30)
@@ -31171,12 +31281,13 @@ Index
* extensions, common, fflush() function: I/O Functions. (line 40)
* extensions, common, func keyword: Definition Syntax. (line 83)
* extensions, common, length() applied to an array: String Functions.
- (line 193)
+ (line 194)
* extensions, common, RS as a regexp: Records. (line 135)
* extensions, common, single character fields: Single Character Fields.
(line 6)
* extensions, in gawk, not in POSIX awk: POSIX/GNU. (line 6)
* extensions, mawk: Common Extensions. (line 6)
+* extensions, where to find: gawkextlib. (line 6)
* extract.awk program: Extract Program. (line 79)
* extraction, of marked strings (internationalization): String Extraction.
(line 6)
@@ -31194,16 +31305,16 @@ Index
* field numbers: Nonconstant Fields. (line 6)
* field operator $: Fields. (line 19)
* field operators, dollar sign as: Fields. (line 19)
+* field separator, in multiline records: Multiple Line. (line 41)
+* field separator, on command line: Command Line Field Separator.
+ (line 6)
+* field separator, POSIX and: Field Splitting Summary.
+ (line 40)
* field separators <1>: User-modified. (line 56)
* field separators: Field Separators. (line 15)
* field separators, choice of: Field Separators. (line 51)
* field separators, FIELDWIDTHS variable and: User-modified. (line 35)
* field separators, FPAT variable and: User-modified. (line 45)
-* field separators, in multiline records: Multiple Line. (line 41)
-* field separators, on command line: Command Line Field Separator.
- (line 6)
-* field separators, POSIX and <1>: Field Splitting Summary.
- (line 40)
* field separators, POSIX and: Fields. (line 6)
* field separators, regular expressions as <1>: Regexp Field Splitting.
(line 6)
@@ -31245,7 +31356,6 @@ Index
* files, /inet/... (gawk): TCP/IP Networking. (line 6)
* files, /inet4/... (gawk): TCP/IP Networking. (line 6)
* files, /inet6/... (gawk): TCP/IP Networking. (line 6)
-* files, as single records: Records. (line 219)
* files, awk programs in: Long. (line 6)
* files, awkprof.out: Profiling. (line 6)
* files, awkvars.out: Options. (line 93)
@@ -31284,6 +31394,8 @@ Index
* files, source, search path for: Igawk Program. (line 368)
* files, splitting: Split Program. (line 6)
* files, Texinfo, extracting programs from: Extract Program. (line 6)
+* find substring in string: String Functions. (line 151)
+* finding extensions: Finding Extensions. (line 6)
* finish debugger command: Debugger Execution Control.
(line 39)
* Fish, Fred: Contributors. (line 50)
@@ -31295,6 +31407,7 @@ Index
* floating-point, numbers, arbitrary precision: Arbitrary Precision Arithmetic.
(line 6)
* floating-point, VAX/VMS: VMS Running. (line 51)
+* flush buffered output: I/O Functions. (line 25)
* fnmatch() extension function: Extension Sample Fnmatch.
(line 12)
* FNR variable <1>: Auto-set. (line 103)
@@ -31310,9 +31423,11 @@ Index
* format specifiers, printf statement: Control Letters. (line 6)
* format specifiers, strftime() function (gawk): Time Functions.
(line 88)
+* format time string: Time Functions. (line 48)
* formats, numeric output: OFMT. (line 6)
* formatting output: Printf. (line 6)
-* forward slash (/): Regexp. (line 10)
+* formatting strings: String Functions. (line 378)
+* forward slash (/) to enclose regular expressions: Regexp. (line 10)
* forward slash (/), / operator: Precedence. (line 55)
* forward slash (/), /= operator <1>: Precedence. (line 95)
* forward slash (/), /= operator: Assignment Ops. (line 129)
@@ -31341,6 +31456,7 @@ Index
(line 6)
* FS, containing ^: Regexp Field Splitting.
(line 59)
+* FS, in multiline records: Multiple Line. (line 41)
* FSF (Free Software Foundation) <1>: Glossary. (line 297)
* FSF (Free Software Foundation) <2>: Getting. (line 10)
* FSF (Free Software Foundation): Manual History. (line 6)
@@ -31349,6 +31465,7 @@ Index
* FUNCTAB array: Auto-set. (line 119)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
+* function definition example: Function Example. (line 6)
* function pointers: Indirect Calls. (line 6)
* functions, arrays as parameters to: Pass By Value/Reference.
(line 47)
@@ -31386,7 +31503,7 @@ Index
(line 71)
* functions, user-defined: User-defined. (line 6)
* functions, user-defined, calling: Function Caveats. (line 6)
-* functions, user-defined, counts: Profiling. (line 137)
+* functions, user-defined, counts, in a profile: Profiling. (line 137)
* functions, user-defined, library of: Library Functions. (line 6)
* functions, user-defined, next/nextfile statements and <1>: Nextfile Statement.
(line 47)
@@ -31395,6 +31512,7 @@ Index
* G-d: Acknowledgments. (line 78)
* Garfinkle, Scott: Contributors. (line 34)
* gawk program, dynamic profiling: Profiling. (line 179)
+* gawk version: Auto-set. (line 204)
* gawk, ARGIND variable in: Other Arguments. (line 12)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 23)
@@ -31403,7 +31521,7 @@ Index
* gawk, built-in variables and: Built-in Variables. (line 14)
* gawk, character classes and: Bracket Expressions. (line 90)
* gawk, coding style in: Adding Code. (line 38)
-* gawk, command-line options: GNU Regexp Operators.
+* gawk, command-line options, and regular expressions: GNU Regexp Operators.
(line 70)
* gawk, comparison operators and: Comparison Operators.
(line 50)
@@ -31437,7 +31555,7 @@ Index
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42)
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
(line 83)
-* gawk, IGNORECASE variable in <2>: String Functions. (line 32)
+* gawk, IGNORECASE variable in <2>: String Functions. (line 48)
* gawk, IGNORECASE variable in <3>: Array Intro. (line 91)
* gawk, IGNORECASE variable in <4>: User-modified. (line 82)
* gawk, IGNORECASE variable in: Case-sensitivity. (line 26)
@@ -31472,9 +31590,7 @@ Index
(line 6)
* gawk, regular expressions, precedence: Regexp Operators. (line 161)
* gawk, RT variable in <1>: Auto-set. (line 266)
-* gawk, RT variable in <2>: Getline/Variable/File.
- (line 10)
-* gawk, RT variable in <3>: Multiple Line. (line 129)
+* gawk, RT variable in <2>: Multiple Line. (line 129)
* gawk, RT variable in: Records. (line 132)
* gawk, See Also awk: Preface. (line 36)
* gawk, source code, obtaining: Getting. (line 6)
@@ -31488,10 +31604,12 @@ Index
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
+* gawkextlib: gawkextlib. (line 6)
* gawkextlib project: gawkextlib. (line 6)
* General Public License (GPL): Glossary. (line 306)
* General Public License, See GPL: Manual History. (line 11)
-* gensub() function (gawk) <1>: String Functions. (line 81)
+* generate time values: Time Functions. (line 25)
+* gensub() function (gawk) <1>: String Functions. (line 82)
* gensub() function (gawk): Using Constant Regexps.
(line 43)
* gensub() function (gawk), escape processing: Gory Details. (line 6)
@@ -31517,6 +31635,8 @@ Index
* getline command, FILENAME variable and: Getline Notes. (line 19)
* getline command, return values: Getline. (line 19)
* getline command, variants: Getline Summary. (line 6)
+* getline from a file: Getline/File. (line 6)
+* getline into a variable: Getline/Variable. (line 6)
* getline statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE.
(line 54)
* getlocaltime() user-defined function: Getlocaltime Function.
@@ -31540,8 +31660,7 @@ Index
* git utility <3>: Other Versions. (line 29)
* git utility: gawkextlib. (line 29)
* git, use of for gawk source code: Derived Files. (line 6)
-* GMP: Arbitrary Precision Arithmetic.
- (line 6)
+* GMP: Gawk and MPFR. (line 6)
* GNITS mailing list: Acknowledgments. (line 52)
* GNU awk, See gawk: Preface. (line 49)
* GNU Free Documentation License: GNU Free Documentation License.
@@ -31564,11 +31683,12 @@ Index
* Grigera, Juan: Contributors. (line 57)
* group database, reading: Group Functions. (line 6)
* group file: Group Functions. (line 6)
+* group id of gawk user: Auto-set. (line 177)
* groups, information about: Group Functions. (line 6)
-* gsub() function <1>: String Functions. (line 134)
+* gsub() function <1>: String Functions. (line 135)
* gsub() function: Using Constant Regexps.
(line 43)
-* gsub() function, arguments of: String Functions. (line 459)
+* gsub() function, arguments of: String Functions. (line 460)
* gsub() function, escape processing: Gory Details. (line 6)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 66)
@@ -31582,9 +31702,10 @@ Index
(line 66)
* hexadecimal numbers: Nondecimal-numbers. (line 6)
* hexadecimal values, enabling interpretation of: Options. (line 207)
+* history expansion, in debugger: Readline Support. (line 6)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
-* HUP signal: Profiling. (line 211)
+* HUP signal, for dynamic profiling: Profiling. (line 211)
* hyphen (-), - operator: Precedence. (line 52)
* hyphen (-), -- operator <1>: Precedence. (line 46)
* hyphen (-), -- operator: Increment Ops. (line 48)
@@ -31597,38 +31718,37 @@ Index
* id.awk program: Id Program. (line 30)
* IEEE-754 format: Floating-point Representation.
(line 6)
-* if statement <1>: If Statement. (line 6)
-* if statement: Regexp Usage. (line 19)
+* if statement: If Statement. (line 6)
* if statement, actions, changing: Ranges. (line 25)
+* if statement, use of regexps in: Regexp Usage. (line 19)
* igawk.sh program: Igawk Program. (line 124)
+* ignore breakpoint: Breakpoint Control. (line 87)
* ignore debugger command: Breakpoint Control. (line 87)
-* IGNORECASE variable <1>: Array Sorting Functions.
- (line 83)
-* IGNORECASE variable <2>: String Functions. (line 32)
-* IGNORECASE variable <3>: Array Intro. (line 91)
-* IGNORECASE variable <4>: User-modified. (line 82)
-* IGNORECASE variable: Case-sensitivity. (line 26)
-* IGNORECASE variable, array sorting and: Array Sorting Functions.
+* IGNORECASE variable: User-modified. (line 82)
+* IGNORECASE variable, and array indices: Array Intro. (line 91)
+* IGNORECASE variable, and array sorting functions: Array Sorting Functions.
(line 83)
-* IGNORECASE variable, array subscripts and: Array Intro. (line 91)
* IGNORECASE variable, in example programs: Library Functions.
(line 53)
+* IGNORECASE variable, ~ and !~ operators: Case-sensitivity. (line 26)
* Illumos: Other Versions. (line 104)
* Illumos, POSIX-compliant awk: Other Versions. (line 104)
* implementation issues, gawk: Notes. (line 6)
* implementation issues, gawk, debugging: Compatibility Mode. (line 6)
* implementation issues, gawk, limits <1>: Redirection. (line 135)
* implementation issues, gawk, limits: Getline Notes. (line 14)
-* in operator <1>: Id Program. (line 93)
-* in operator <2>: Scanning an Array. (line 17)
-* in operator <3>: Reference to Elements.
- (line 37)
-* in operator <4>: For Statement. (line 75)
-* in operator <5>: Precedence. (line 83)
+* in operator <1>: For Statement. (line 75)
+* in operator <2>: Precedence. (line 83)
* in operator: Comparison Operators.
(line 11)
+* in operator, index existence in multidimensional arrays: Multidimensional.
+ (line 43)
+* in operator, order of array access: Scanning an Array. (line 48)
+* in operator, testing if array element exists: Reference to Elements.
+ (line 37)
+* in operator, use in loops: Scanning an Array. (line 17)
* increment operators: Increment Ops. (line 6)
-* index() function: String Functions. (line 150)
+* index() function: String Functions. (line 151)
* indexing arrays: Array Intro. (line 49)
* indirect function calls: Indirect Calls. (line 6)
* infinite precision: Arbitrary Precision Arithmetic.
@@ -31646,6 +31766,7 @@ Index
* input files, running awk without: Read Terminal. (line 6)
* input files, variable assignments and: Other Arguments. (line 19)
* input pipeline: Getline/Pipe. (line 9)
+* input record, length of: String Functions. (line 171)
* input redirection: Getline/File. (line 6)
* input, data, nondecimal: Nondecimal Data. (line 6)
* input, explicit: Getline. (line 6)
@@ -31654,14 +31775,18 @@ Index
* input, splitting into records: Records. (line 6)
* input, standard <1>: Special FD. (line 6)
* input, standard: Read Terminal. (line 6)
+* input/output functions: I/O Functions. (line 6)
* input/output, binary: User-modified. (line 10)
* input/output, from BEGIN and END: I/O And BEGIN/END. (line 6)
* input/output, two-way: Two-way I/O. (line 44)
* insomnia, cure for: Alarm Program. (line 6)
* installation, VMS: VMS Installation. (line 6)
* installing gawk: Installation. (line 6)
+* instruction tracing, in debugger: Debugger Info. (line 89)
* INT signal (MS-Windows): Profiling. (line 214)
* int() function: Numeric Functions. (line 23)
+* integer array indices: Numeric Array Subscripts.
+ (line 31)
* integers: General Arithmetic. (line 6)
* integers, arbitrary precision: Arbitrary Precision Integers.
(line 6)
@@ -31685,8 +31810,9 @@ Index
* internationalizing a program: Explaining gettext. (line 6)
* interpreted programs <1>: Glossary. (line 357)
* interpreted programs: Basic High Level. (line 15)
-* interval expressions: Regexp Operators. (line 116)
+* interval expressions, regexp operator: Regexp Operators. (line 116)
* inventory-shipped file: Sample Data Files. (line 32)
+* invoke shell command: I/O Functions. (line 72)
* isarray() function (gawk): Type Functions. (line 11)
* ISO: Glossary. (line 368)
* ISO 8859-1: Glossary. (line 133)
@@ -31741,9 +31867,12 @@ Index
* left angle bracket (<), <= operator <1>: Precedence. (line 65)
* left angle bracket (<), <= operator: Comparison Operators.
(line 11)
+* left shift: Bitwise Functions. (line 46)
* left shift, bitwise: Bitwise Functions. (line 32)
* leftmost longest match: Multiple Line. (line 26)
-* length() function: String Functions. (line 163)
+* length of input record: String Functions. (line 171)
+* length of string: String Functions. (line 164)
+* length() function: String Functions. (line 164)
* Lesser General Public License (LGPL): Glossary. (line 397)
* LGPL (Lesser General Public License): Glossary. (line 397)
* libmawk: Other Versions. (line 120)
@@ -31793,10 +31922,12 @@ Index
* Linux <1>: Glossary. (line 616)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
+* list all global variables, in debugger: Debugger Info. (line 48)
* list debugger command: Miscellaneous Debugger Commands.
(line 72)
+* list function definitions, in debugger: Debugger Info. (line 30)
* loading, library: Options. (line 173)
-* local variables: Variable Scope. (line 6)
+* local variables, in a function: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 80)
* locale decimal point character: Options. (line 263)
* locale, definition of: Locales. (line 6)
@@ -31805,6 +31936,7 @@ Index
(line 6)
* log files, timestamps in: Time Functions. (line 6)
* log() function: Numeric Functions. (line 30)
+* logarithm: Numeric Functions. (line 30)
* logical false/true: Truth Values. (line 6)
* logical operators, See Boolean expressions: Boolean Ops. (line 6)
* login information: Passwd Functions. (line 16)
@@ -31812,7 +31944,7 @@ Index
* loops: While Statement. (line 6)
* loops, break statement and: Break Statement. (line 6)
* loops, continue statements and: For Statement. (line 64)
-* loops, count for header: Profiling. (line 131)
+* loops, count for header, in a profile: Profiling. (line 131)
* loops, do-while: Do Statement. (line 6)
* loops, exiting: Break Statement. (line 6)
* loops, for, array scanning: Scanning an Array. (line 6)
@@ -31832,9 +31964,10 @@ Index
(line 6)
* marked strings, extracting: String Extraction. (line 6)
* Marx, Groucho: Increment Ops. (line 60)
-* match() function: String Functions. (line 203)
+* match regexp in string: String Functions. (line 204)
+* match() function: String Functions. (line 204)
* match() function, RSTART/RLENGTH variables: String Functions.
- (line 220)
+ (line 221)
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
@@ -31844,6 +31977,7 @@ Index
* mawk utility <3>: Concatenation. (line 36)
* mawk utility <4>: Getline/Pipe. (line 62)
* mawk utility: Escape Sequences. (line 124)
+* maximum precision supported by MPFR library: Auto-set. (line 218)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 41)
* message object files, converting from portable object files: I18N Example.
@@ -31852,15 +31986,18 @@ Index
(line 47)
* message object files, specifying directory of: Explaining gettext.
(line 53)
+* messages from extensions: Printing Messages. (line 6)
+* metacharacters in regular expressions: Regexp Operators. (line 6)
* metacharacters, escape sequences for: Escape Sequences. (line 130)
+* minimum precision supported by MPFR library: Auto-set. (line 221)
* mktime() function (gawk): Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 103)
-* MPFR: Arbitrary Precision Arithmetic.
- (line 6)
+* MPFR: Gawk and MPFR. (line 6)
* msgfmt utility: I18N Example. (line 62)
* multiple precision: Arbitrary Precision Arithmetic.
(line 6)
+* multiple-line records: Multiple Line. (line 6)
* n debugger command (alias for next): Debugger Execution Control.
(line 43)
* names, arrays/variables <1>: Library Names. (line 6)
@@ -31911,6 +32048,8 @@ Index
* ni debugger command (alias for nexti): Debugger Execution Control.
(line 49)
* noassign.awk program: Ignoring Assigns. (line 15)
+* non-existent array elements: Reference to Elements.
+ (line 23)
* not Boolean-logic operator: Boolean Ops. (line 6)
* NR variable <1>: Auto-set. (line 128)
* NR variable: Records. (line 6)
@@ -31920,12 +32059,14 @@ Index
* null strings <3>: Regexp Field Splitting.
(line 43)
* null strings: Records. (line 122)
-* null strings, array elements and: Delete. (line 27)
+* null strings in gawk arguments, quoting and: Quoting. (line 62)
+* null strings, and deleting array elements: Delete. (line 27)
* null strings, as array subscripts: Uninitialized Subscripts.
(line 43)
* null strings, converting numbers to strings: Conversion. (line 21)
* null strings, matching: Gory Details. (line 164)
-* null strings, quoting and: Quoting. (line 62)
+* number as string of bits: Bitwise Functions. (line 109)
+* number of array elements: String Functions. (line 194)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
* number sign (#), commenting: Comments. (line 6)
@@ -31940,9 +32081,9 @@ Index
* numbers, floating-point: General Arithmetic. (line 6)
* numbers, hexadecimal: Nondecimal-numbers. (line 6)
* numbers, octal: Nondecimal-numbers. (line 6)
-* numbers, random: Numeric Functions. (line 64)
* numbers, rounding: Round Function. (line 6)
-* numeric, constants: Scalar Constants. (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)
* o debugger command (alias for option): Debugger Info. (line 57)
@@ -31992,10 +32133,7 @@ Index
* operators, word-boundary (gawk): GNU Regexp Operators.
(line 63)
* option debugger command: Debugger Info. (line 57)
-* options, command-line <1>: Command Line Field Separator.
- (line 6)
-* options, command-line <2>: Options. (line 6)
-* options, command-line: Long. (line 12)
+* options, command-line: Options. (line 6)
* options, command-line, end of: Options. (line 54)
* options, command-line, invoking awk: Command Line. (line 6)
* options, command-line, processing: Getopt Function. (line 6)
@@ -32016,6 +32154,7 @@ Index
* output record separator, See ORS variable: Output Separators.
(line 20)
* output redirection: Redirection. (line 6)
+* output wrapper: Output Wrappers. (line 6)
* output, buffering: I/O Functions. (line 29)
* output, duplicating into files: Tee Program. (line 6)
* output, files, closing: Close Files And Pipes.
@@ -32029,14 +32168,15 @@ Index
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
* P1003.1 POSIX standard: Glossary. (line 454)
-* parentheses () <1>: Profiling. (line 146)
+* parent process id of gawk process: Auto-set. (line 186)
* parentheses (): Regexp Operators. (line 79)
+* parentheses (), in a profile: Profiling. (line 146)
* password file: Passwd Functions. (line 16)
-* patsplit() function (gawk): String Functions. (line 290)
+* patsplit() function (gawk): String Functions. (line 291)
* patterns: Patterns and Actions.
(line 6)
* patterns, comparison expressions as: Expression Patterns. (line 14)
-* patterns, counts: Profiling. (line 118)
+* patterns, counts, in a profile: Profiling. (line 118)
* patterns, default: Very Simple. (line 34)
* patterns, empty: Empty. (line 6)
* patterns, expressions as: Regexp Patterns. (line 6)
@@ -32051,17 +32191,18 @@ Index
* percent sign (%), % operator: Precedence. (line 55)
* percent sign (%), %= operator <1>: Precedence. (line 95)
* percent sign (%), %= operator: Assignment Ops. (line 129)
-* period (.): Regexp Operators. (line 43)
+* period (.), regexp operator: Regexp Operators. (line 43)
* Perl: Future Extensions. (line 6)
* Peters, Arno: Contributors. (line 85)
* Peterson, Hal: Contributors. (line 39)
-* pipes, closing: Close Files And Pipes.
+* pipe, closing: Close Files And Pipes.
(line 6)
-* pipes, input: Getline/Pipe. (line 9)
-* pipes, output: Redirection. (line 57)
+* pipe, input: Getline/Pipe. (line 9)
+* pipe, output: Redirection. (line 57)
* Pitts, Dave <1>: Bugs. (line 73)
* Pitts, Dave: Acknowledgments. (line 60)
* Plauger, P.J.: Library Functions. (line 12)
+* plug-in: Extension Intro. (line 6)
* plus sign (+), + operator: Precedence. (line 52)
* plus sign (+), ++ operator <1>: Precedence. (line 46)
* plus sign (+), ++ operator: Increment Ops. (line 11)
@@ -32086,7 +32227,7 @@ Index
* portability, gawk: New Ports. (line 6)
* portability, gettext library and: Explaining gettext. (line 10)
* portability, internationalization and: I18N Portability. (line 6)
-* portability, length() function: String Functions. (line 172)
+* portability, length() function: String Functions. (line 173)
* portability, new awk vs. old awk: Conversion. (line 55)
* portability, next statement in user-defined functions: Pass By Value/Reference.
(line 91)
@@ -32094,7 +32235,7 @@ Index
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
* portability, POSIXLY_CORRECT environment variable: Options. (line 353)
-* portability, substr() function: String Functions. (line 509)
+* portability, substr() function: String Functions. (line 510)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 36)
* portable object files, converting to message object files: I18N Example.
@@ -32131,7 +32272,7 @@ Index
* POSIX awk, FS variable and: User-modified. (line 66)
* POSIX awk, function keyword in: Definition Syntax. (line 83)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 54)
-* POSIX awk, functions and, length(): String Functions. (line 172)
+* POSIX awk, functions and, length(): String Functions. (line 173)
* 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 45)
@@ -32164,6 +32305,8 @@ Index
* print statement, See Also redirection, of output: Redirection.
(line 17)
* print statement, sprintf() function and: Round Function. (line 6)
+* print variables, in debugger: Viewing And Changing Data.
+ (line 36)
* printf debugger command: Viewing And Changing Data.
(line 54)
* printf statement <1>: Printf. (line 6)
@@ -32183,22 +32326,30 @@ Index
* printf statement, sprintf() function and: Round Function. (line 6)
* 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, 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 180)
+* process id of gawk process: Auto-set. (line 183)
* processes, two-way communications with: Two-way I/O. (line 23)
* processing data: Basic High Level. (line 6)
-* PROCINFO array <1>: Two-way I/O. (line 116)
-* PROCINFO array <2>: Id Program. (line 15)
-* PROCINFO array <3>: Group Functions. (line 6)
-* PROCINFO array <4>: Passwd Functions. (line 6)
-* PROCINFO array <5>: Time Functions. (line 47)
-* PROCINFO array <6>: Auto-set. (line 133)
-* PROCINFO array: Obsolete. (line 11)
+* PROCINFO array <1>: Passwd Functions. (line 6)
+* PROCINFO array <2>: Time Functions. (line 47)
+* PROCINFO array: Auto-set. (line 133)
+* PROCINFO array, and communications via ptys: Two-way I/O. (line 116)
+* PROCINFO array, and group membership: Group Functions. (line 6)
+* PROCINFO array, and user and group ID numbers: Id Program. (line 15)
+* PROCINFO array, testing the field splitting: Passwd Functions.
+ (line 161)
+* PROCINFO array, uses: Auto-set. (line 239)
+* PROCINFO, values of sorted_in: Controlling Scanning.
+ (line 24)
* profiling awk programs: Profiling. (line 6)
* profiling awk programs, dynamically: Profiling. (line 179)
+* program identifiers: Auto-set. (line 151)
* program, definition of: Getting Started. (line 21)
* programmers, attractiveness of: Two-way I/O. (line 6)
* programming conventions, --non-decimal-data option: Nondecimal Data.
@@ -32235,11 +32386,9 @@ Index
* quit debugger command: Miscellaneous Debugger Commands.
(line 99)
* QUIT signal (MS-Windows): Profiling. (line 214)
-* quoting <1>: Comments. (line 27)
-* quoting <2>: Long. (line 26)
-* quoting: Read Terminal. (line 25)
-* quoting, rules for: Quoting. (line 6)
-* quoting, tricks for: Quoting. (line 71)
+* quoting in gawk command lines: Long. (line 26)
+* quoting in gawk command lines, tricks for: Quoting. (line 71)
+* quoting, for small awk programs: Comments. (line 27)
* r debugger command (alias for run): Debugger Execution Control.
(line 62)
* Rakitzis, Byron: History Sorting. (line 25)
@@ -32267,6 +32416,7 @@ Index
* readfile() extension function: Extension Sample Readfile.
(line 11)
* readfile() user-defined function: Readfile Function. (line 30)
+* reading input files: Reading Files. (line 6)
* recipe for a programming language: History. (line 6)
* record separators <1>: User-modified. (line 143)
* record separators: Records. (line 14)
@@ -32281,10 +32431,12 @@ Index
* records, terminating: Records. (line 132)
* records, treating files as: Records. (line 219)
* recursive functions: Definition Syntax. (line 73)
+* redirect gawk output, in debugger: Debugger Info. (line 72)
* redirection of input: Getline/File. (line 6)
* redirection of output: Redirection. (line 6)
* reference counting, sorting arrays: Array Sorting Functions.
(line 77)
+* regexp: Regexp. (line 6)
* regexp constants <1>: Comparison Operators.
(line 102)
* regexp constants <2>: Regexp Constants. (line 6)
@@ -32295,7 +32447,8 @@ Index
(line 28)
* regexp constants, slashes vs. quotes: Computed Regexps. (line 28)
* regexp constants, vs. string constants: Computed Regexps. (line 38)
-* regexp, See regular expressions: Regexp. (line 6)
+* register extension: Registration Functions.
+ (line 6)
* regular expressions: Regexp. (line 6)
* regular expressions as field separators: Field Separators. (line 51)
* regular expressions, anchors in: Regexp Operators. (line 22)
@@ -32330,6 +32483,7 @@ 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 406)
* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
@@ -32350,10 +32504,11 @@ Index
(line 11)
* right angle bracket (>), >> operator (I/O) <1>: Precedence. (line 65)
* right angle bracket (>), >> operator (I/O): Redirection. (line 50)
+* right shift: Bitwise Functions. (line 52)
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 55)
* RLENGTH variable: Auto-set. (line 253)
-* RLENGTH variable, match() function and: String Functions. (line 220)
+* RLENGTH variable, match() function and: String Functions. (line 221)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 32)
* Robbins, Arnold <3>: Contributors. (line 139)
@@ -32370,6 +32525,7 @@ Index
* Robbins, Miriam <2>: Getline/Pipe. (line 39)
* Robbins, Miriam: Acknowledgments. (line 78)
* Rommel, Kai Uwe: Contributors. (line 42)
+* round to nearest integer: Numeric Functions. (line 23)
* round() user-defined function: Round Function. (line 16)
* rounding mode, floating-point: Rounding Mode. (line 6)
* rounding numbers: Round Function. (line 6)
@@ -32381,11 +32537,9 @@ Index
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift() function (gawk): Bitwise Functions. (line 52)
* RSTART variable: Auto-set. (line 259)
-* RSTART variable, match() function and: String Functions. (line 220)
+* RSTART variable, match() function and: String Functions. (line 221)
* RT variable <1>: Auto-set. (line 266)
-* RT variable <2>: Getline/Variable/File.
- (line 10)
-* RT variable <3>: Multiple Line. (line 129)
+* RT variable <2>: Multiple Line. (line 129)
* RT variable: Records. (line 132)
* Rubin, Paul <1>: Contributors. (line 15)
* Rubin, Paul: History. (line 30)
@@ -32395,29 +32549,35 @@ Index
* rvalues/lvalues: Assignment Ops. (line 32)
* s debugger command (alias for step): Debugger Execution Control.
(line 68)
+* sample debugging session: Sample Debugging Session.
+ (line 6)
* sandbox mode: Options. (line 279)
+* save debugger options: Debugger Info. (line 84)
+* 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 <1>: Contributors. (line 131)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
+* search and replace in strings: String Functions. (line 82)
+* search in string: String Functions. (line 151)
* search paths <1>: VMS Running. (line 58)
* search paths <2>: PC Using. (line 10)
-* search paths <3>: Igawk Program. (line 368)
-* search paths <4>: AWKLIBPATH Variable. (line 6)
-* search paths: AWKPATH Variable. (line 6)
+* search paths: Igawk Program. (line 368)
* search paths, for shared libraries: AWKLIBPATH Variable. (line 6)
* search paths, for source files <1>: VMS Running. (line 58)
* search paths, for source files <2>: PC Using. (line 10)
* search paths, for source files <3>: Igawk Program. (line 368)
* search paths, for source files: AWKPATH Variable. (line 6)
-* searching: String Functions. (line 150)
* searching, files for regular expressions: Egrep Program. (line 6)
* searching, for words: Dupword Program. (line 6)
* sed utility <1>: Glossary. (line 12)
* sed utility <2>: Simple Sed. (line 6)
* sed utility: Field Splitting Summary.
(line 46)
+* seeding random number generator: Numeric Functions. (line 64)
* semicolon (;), AWKPATH variable and: PC Using. (line 10)
* semicolon (;), separating statements in actions <1>: Statements.
(line 10)
@@ -32434,8 +32594,18 @@ Index
* separators, for records, regular expressions as: Records. (line 132)
* separators, for statements in actions: Action Overview. (line 19)
* separators, subscript: User-modified. (line 156)
+* set breakpoint: Breakpoint Control. (line 11)
* set debugger command: Viewing And Changing Data.
(line 59)
+* set directory of message catalogs: I18N Functions. (line 12)
+* set watchpoint: Viewing And Changing Data.
+ (line 67)
+* setting rounding mode: Setting Rounding Mode.
+ (line 6)
+* setting working precision: Setting Precision. (line 6)
+* shadowing of variable values: Definition Syntax. (line 61)
+* shell quoting, double quote: Read Terminal. (line 25)
+* shell quoting, rules for: Quoting. (line 6)
* shells, piping commands into: Redirection. (line 142)
* shells, quoting: Using Shell Variables.
(line 12)
@@ -32446,6 +32616,13 @@ Index
(line 6)
* shift, bitwise: Bitwise Functions. (line 32)
* short-circuit operators: Boolean Ops. (line 57)
+* show all source files, in debugger: Debugger Info. (line 45)
+* show breakpoints: Debugger Info. (line 21)
+* show function arguments, in debugger: Debugger Info. (line 18)
+* show local variables, in debugger: Debugger Info. (line 34)
+* show name of current source file, in debugger: Debugger Info.
+ (line 37)
+* show watchpoints: Debugger Info. (line 51)
* si debugger command (alias for stepi): Debugger Execution Control.
(line 76)
* side effects <1>: Increment Ops. (line 11)
@@ -32491,31 +32668,36 @@ Index
(line 56)
* sidebar, Using close()'s Return Value: Close Files And Pipes.
(line 128)
-* SIGHUP signal: Profiling. (line 211)
+* SIGHUP signal, for dynamic profiling: Profiling. (line 211)
* SIGINT signal (MS-Windows): Profiling. (line 214)
-* signals, HUP/SIGHUP: Profiling. (line 211)
+* signals, HUP/SIGHUP, for profiling: Profiling. (line 211)
* signals, INT/SIGINT (MS-Windows): Profiling. (line 214)
* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 214)
-* signals, USR1/SIGUSR1: Profiling. (line 188)
+* signals, USR1/SIGUSR1, for profiling: Profiling. (line 188)
* signature program: Signature Program. (line 6)
* SIGQUIT signal (MS-Windows): Profiling. (line 214)
-* SIGUSR1 signal: Profiling. (line 188)
+* SIGUSR1 signal, for dynamic profiling: Profiling. (line 188)
* silent debugger command: Debugger Execution Control.
(line 10)
* sin() function: Numeric Functions. (line 75)
+* sine: Numeric Functions. (line 75)
* single precision floating-point: General Arithmetic. (line 21)
-* single quote (') <1>: Quoting. (line 31)
-* single quote (') <2>: Long. (line 33)
* single quote ('): One-shot. (line 15)
+* single quote (') in gawk command lines: Long. (line 33)
+* single quote ('), in shell commands: Quoting. (line 31)
* single quote ('), vs. apostrophe: Comments. (line 27)
* single quote ('), with double quotes: Quoting. (line 53)
* single-character fields: Single Character Fields.
(line 6)
+* single-step execution, in the debugger: Debugger Execution Control.
+ (line 43)
* Skywalker, Luke: Undocumented. (line 6)
* sleep utility: Alarm Program. (line 111)
* sleep() extension function: Extension Sample Time.
(line 23)
* Solaris, POSIX-compliant awk: Other Versions. (line 96)
+* sort array: String Functions. (line 32)
+* sort array indices: String Functions. (line 32)
* sort function, arrays, sorting: Array Sorting Functions.
(line 6)
* sort utility: Word Sorting. (line 50)
@@ -32539,18 +32721,21 @@ Index
* source files, search path for: Igawk Program. (line 368)
* sparse arrays: Array Intro. (line 70)
* Spencer, Henry: Glossary. (line 12)
+* split string into array: String Functions. (line 291)
* split utility: Split Program. (line 6)
-* split() function: String Functions. (line 312)
+* split() function: String Functions. (line 313)
* split() function, array elements, deleting: Delete. (line 61)
* split.awk program: Split Program. (line 30)
-* sprintf() function <1>: String Functions. (line 377)
+* sprintf() function <1>: String Functions. (line 378)
* sprintf() function: OFMT. (line 15)
* sprintf() function, OFMT variable and: User-modified. (line 124)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
* sqrt() function: Numeric Functions. (line 78)
-* square brackets ([]): Regexp Operators. (line 55)
+* square brackets ([]), regexp operator: Regexp Operators. (line 55)
+* square root: Numeric Functions. (line 78)
* srand() function: Numeric Functions. (line 82)
+* stack frame: Debugging Terms. (line 10)
* Stallman, Richard <1>: Glossary. (line 297)
* Stallman, Richard <2>: Contributors. (line 23)
* Stallman, Richard <3>: Acknowledgments. (line 18)
@@ -32559,6 +32744,7 @@ Index
* standard input <1>: Special FD. (line 6)
* standard input: Read Terminal. (line 6)
* standard output: Special FD. (line 6)
+* starting the debugger: Debugger Invocation. (line 6)
* stat() extension function: Extension Sample File Functions.
(line 18)
* statements, compound, control statements and: Statements. (line 10)
@@ -32568,6 +32754,8 @@ Index
(line 68)
* stepi debugger command: Debugger Execution Control.
(line 76)
+* stop automatic display, in debugger: Viewing And Changing Data.
+ (line 80)
* stream editors <1>: Simple Sed. (line 6)
* stream editors: Field Splitting Summary.
(line 46)
@@ -32576,27 +32764,32 @@ Index
* string constants, vs. regexp constants: Computed Regexps. (line 38)
* string extraction (internationalization): String Extraction.
(line 6)
+* string length: String Functions. (line 164)
* string operators: Concatenation. (line 8)
+* string, regular expression match: String Functions. (line 204)
+* 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 333)
* strings, converting <1>: Bitwise Functions. (line 109)
* strings, converting: Conversion. (line 6)
+* strings, converting letter case: String Functions. (line 520)
* strings, converting, numbers to: User-modified. (line 28)
* strings, empty, See null strings: Records. (line 122)
* strings, extracting: String Extraction. (line 6)
* strings, for localization: Programmer i18n. (line 14)
-* strings, length of: Scalar Constants. (line 20)
+* strings, length limitations: Scalar Constants. (line 20)
* strings, merging arrays into: Join Function. (line 6)
* strings, null: Regexp Field Splitting.
(line 43)
* strings, numeric: Variable Typing. (line 6)
-* strings, splitting: String Functions. (line 332)
-* strtonum() function (gawk): String Functions. (line 384)
+* strtonum() function (gawk): String Functions. (line 385)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 36)
-* sub() function <1>: String Functions. (line 405)
+* sub() function <1>: String Functions. (line 406)
* sub() function: Using Constant Regexps.
(line 43)
-* sub() function, arguments of: String Functions. (line 459)
+* sub() function, arguments of: String Functions. (line 460)
* sub() function, escape processing: Gory Details. (line 6)
* subscript separators: User-modified. (line 156)
* subscripts in arrays, multidimensional: Multidimensional. (line 10)
@@ -32607,9 +32800,13 @@ Index
* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
(line 6)
* SUBSEP variable: User-modified. (line 156)
-* SUBSEP variable, multidimensional arrays: Multidimensional. (line 16)
-* substr() function: String Functions. (line 478)
+* SUBSEP variable, and multidimensional arrays: Multidimensional.
+ (line 16)
+* substitute in string: String Functions. (line 82)
+* substr() function: String Functions. (line 479)
+* substring: String Functions. (line 479)
* Sumner, Andrew: Other Versions. (line 64)
+* supplementary groups of gawk process: Auto-set. (line 234)
* switch statement: Switch Statement. (line 6)
* SYMTAB array: Auto-set. (line 274)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
@@ -32623,6 +32820,7 @@ Index
* TCP/IP, support for: Special Network. (line 6)
* tee utility: Tee Program. (line 6)
* tee.awk program: Tee Program. (line 26)
+* temporary breakpoint: Breakpoint Control. (line 90)
* terminating records: Records. (line 132)
* testbits.awk program: Bitwise Functions. (line 70)
* testext extension: Extension Sample API Tests.
@@ -32652,6 +32850,7 @@ Index
* tilde (~), ~ operator <5>: Computed Regexps. (line 6)
* tilde (~), ~ operator <6>: Case-sensitivity. (line 26)
* tilde (~), ~ operator: Regexp Usage. (line 19)
+* time functions: Time Functions. (line 6)
* time, alarm clock example program: Alarm Program. (line 11)
* time, localization and: Explaining gettext. (line 115)
* time, managing: Getlocaltime Function.
@@ -32662,12 +32861,15 @@ Index
* timestamps, converting dates to: Time Functions. (line 75)
* timestamps, formatted: Getlocaltime Function.
(line 6)
-* tolower() function: String Functions. (line 520)
-* toupper() function: String Functions. (line 526)
+* tolower() function: String Functions. (line 521)
+* toupper() function: String Functions. (line 527)
* tr utility: Translate Program. (line 6)
* trace debugger command: Miscellaneous Debugger Commands.
(line 108)
+* traceback, display in debugger: Execution Stack. (line 13)
+* translate string: I18N Functions. (line 22)
* translate.awk program: Translate Program. (line 55)
+* treating files, as single records: Records. (line 219)
* troubleshooting, --non-decimal-data option: Options. (line 207)
* troubleshooting, == operator: Comparison Operators.
(line 37)
@@ -32686,9 +32888,9 @@ 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 469)
-* troubleshooting, match() function: String Functions. (line 285)
-* troubleshooting, patsplit() function: String Functions. (line 308)
+* troubleshooting, gsub()/sub() functions: String Functions. (line 470)
+* troubleshooting, match() function: String Functions. (line 286)
+* troubleshooting, patsplit() function: String Functions. (line 309)
* troubleshooting, print statement, omitting commas: Print Examples.
(line 31)
* troubleshooting, printing: Redirection. (line 118)
@@ -32697,7 +32899,7 @@ Index
* troubleshooting, regexp constants vs. string constants: Computed Regexps.
(line 38)
* troubleshooting, string concatenation: Concatenation. (line 26)
-* troubleshooting, substr() function: String Functions. (line 496)
+* troubleshooting, substr() function: String Functions. (line 497)
* troubleshooting, system() function: I/O Functions. (line 94)
* troubleshooting, typographical errors, global variables: Options.
(line 98)
@@ -32710,6 +32912,8 @@ Index
* type conversion: Conversion. (line 21)
* u debugger command (alias for until): Debugger Execution Control.
(line 83)
+* unassigned array elements: Reference to Elements.
+ (line 18)
* undefined functions: Pass By Value/Reference.
(line 71)
* underscore (_), C macro: Explaining gettext. (line 70)
@@ -32742,15 +32946,16 @@ Index
(line 84)
* up debugger command: Execution Stack. (line 33)
* user database, reading: Passwd Functions. (line 6)
-* user-defined, functions: User-defined. (line 6)
-* user-defined, functions, counts: Profiling. (line 137)
+* user-defined functions: User-defined. (line 6)
+* user-defined, functions, counts, in a profile: Profiling. (line 137)
* user-defined, variables: Variables. (line 6)
* 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: Profiling. (line 188)
+* USR1 signal, for dynamic profiling: Profiling. (line 188)
* values, numeric: Basic Data Typing. (line 13)
* values, string: Basic Data Typing. (line 13)
+* variable assignments and input files: Other Arguments. (line 19)
* variable typing: Typing and Comparison.
(line 9)
* variables <1>: Basic Data Typing. (line 6)
@@ -32771,7 +32976,7 @@ Index
* variables, global, for library functions: Library Names. (line 11)
* variables, global, printing list of: Options. (line 93)
* variables, initializing: Using Variables. (line 20)
-* variables, local: Variable Scope. (line 6)
+* variables, local to a function: Variable Scope. (line 6)
* variables, names of: Arrays. (line 18)
* variables, private: Library Names. (line 11)
* variables, setting: Options. (line 32)
@@ -32782,6 +32987,10 @@ Index
* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
(line 6)
* variables, user-defined: Variables. (line 6)
+* version of gawk: Auto-set. (line 204)
+* version of gawk extension API: Auto-set. (line 229)
+* version of GNU MP library: Auto-set. (line 215)
+* version of GNU MPFR library: Auto-set. (line 211)
* vertical bar (|): Regexp Operators. (line 69)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 9)
@@ -32805,12 +33014,13 @@ Index
* warnings, issuing: Options. (line 182)
* watch debugger command: Viewing And Changing Data.
(line 67)
+* watchpoint: Debugging Terms. (line 42)
* wc utility: Wc Program. (line 6)
* wc.awk program: Wc Program. (line 46)
* Weinberger, Peter <1>: Contributors. (line 11)
* Weinberger, Peter: History. (line 17)
-* while statement <1>: While Statement. (line 6)
-* while statement: Regexp Usage. (line 19)
+* while statement: While Statement. (line 6)
+* while statement, use of regexps in: Regexp Usage. (line 19)
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
@@ -32908,488 +33118,489 @@ Node: When105754
Node: Invoking Gawk107901
Node: Command Line109364
Node: Options110147
-Ref: Options-Footnote-1125542
-Node: Other Arguments125567
-Node: Naming Standard Input128225
-Node: Environment Variables129319
-Node: AWKPATH Variable129877
-Ref: AWKPATH Variable-Footnote-1132635
-Node: AWKLIBPATH Variable132895
-Node: Other Environment Variables133613
-Node: Exit Status136576
-Node: Include Files137251
-Node: Loading Shared Libraries140820
-Node: Obsolete142184
-Node: Undocumented142881
-Node: Regexp143123
-Node: Regexp Usage144512
-Node: Escape Sequences146537
-Node: Regexp Operators152206
-Ref: Regexp Operators-Footnote-1159586
-Ref: Regexp Operators-Footnote-2159733
-Node: Bracket Expressions159831
-Ref: table-char-classes161721
-Node: GNU Regexp Operators164244
-Node: Case-sensitivity167967
-Ref: Case-sensitivity-Footnote-1170935
-Ref: Case-sensitivity-Footnote-2171170
-Node: Leftmost Longest171278
-Node: Computed Regexps172479
-Node: Reading Files175816
-Node: Records177818
-Ref: Records-Footnote-1187341
-Node: Fields187378
-Ref: Fields-Footnote-1190334
-Node: Nonconstant Fields190420
-Node: Changing Fields192626
-Node: Field Separators198585
-Node: Default Field Splitting201287
-Node: Regexp Field Splitting202404
-Node: Single Character Fields205746
-Node: Command Line Field Separator206805
-Node: Full Line Fields210147
-Ref: Full Line Fields-Footnote-1210655
-Node: Field Splitting Summary210701
-Ref: Field Splitting Summary-Footnote-1213800
-Node: Constant Size213901
-Node: Splitting By Content218508
-Ref: Splitting By Content-Footnote-1222257
-Node: Multiple Line222297
-Ref: Multiple Line-Footnote-1228144
-Node: Getline228323
-Node: Plain Getline230539
-Node: Getline/Variable232634
-Node: Getline/File233781
-Node: Getline/Variable/File235122
-Ref: Getline/Variable/File-Footnote-1236721
-Node: Getline/Pipe236808
-Node: Getline/Variable/Pipe239507
-Node: Getline/Coprocess240614
-Node: Getline/Variable/Coprocess241866
-Node: Getline Notes242603
-Node: Getline Summary245390
-Ref: table-getline-variants245798
-Node: Read Timeout246710
-Ref: Read Timeout-Footnote-1250451
-Node: Command line directories250508
-Node: Printing251138
-Node: Print252769
-Node: Print Examples254106
-Node: Output Separators256890
-Node: OFMT258906
-Node: Printf260264
-Node: Basic Printf261170
-Node: Control Letters262709
-Node: Format Modifiers266521
-Node: Printf Examples272530
-Node: Redirection275242
-Node: Special Files282216
-Node: Special FD282749
-Ref: Special FD-Footnote-1286374
-Node: Special Network286448
-Node: Special Caveats287298
-Node: Close Files And Pipes288094
-Ref: Close Files And Pipes-Footnote-1295077
-Ref: Close Files And Pipes-Footnote-2295225
-Node: Expressions295375
-Node: Values296507
-Node: Constants297183
-Node: Scalar Constants297863
-Ref: Scalar Constants-Footnote-1298722
-Node: Nondecimal-numbers298904
-Node: Regexp Constants301904
-Node: Using Constant Regexps302379
-Node: Variables305434
-Node: Using Variables306089
-Node: Assignment Options307813
-Node: Conversion309688
-Ref: table-locale-affects315188
-Ref: Conversion-Footnote-1315812
-Node: All Operators315921
-Node: Arithmetic Ops316551
-Node: Concatenation319056
-Ref: Concatenation-Footnote-1321844
-Node: Assignment Ops321964
-Ref: table-assign-ops326952
-Node: Increment Ops328283
-Node: Truth Values and Conditions331717
-Node: Truth Values332800
-Node: Typing and Comparison333849
-Node: Variable Typing334642
-Ref: Variable Typing-Footnote-1338539
-Node: Comparison Operators338661
-Ref: table-relational-ops339071
-Node: POSIX String Comparison342619
-Ref: POSIX String Comparison-Footnote-1343575
-Node: Boolean Ops343713
-Ref: Boolean Ops-Footnote-1347783
-Node: Conditional Exp347874
-Node: Function Calls349606
-Node: Precedence353200
-Node: Locales356869
-Node: Patterns and Actions357958
-Node: Pattern Overview359012
-Node: Regexp Patterns360681
-Node: Expression Patterns361224
-Node: Ranges365005
-Node: BEGIN/END368109
-Node: Using BEGIN/END368871
-Ref: Using BEGIN/END-Footnote-1371607
-Node: I/O And BEGIN/END371713
-Node: BEGINFILE/ENDFILE373995
-Node: Empty376909
-Node: Using Shell Variables377226
-Node: Action Overview379511
-Node: Statements381868
-Node: If Statement383722
-Node: While Statement385221
-Node: Do Statement387265
-Node: For Statement388421
-Node: Switch Statement391573
-Node: Break Statement393727
-Node: Continue Statement395717
-Node: Next Statement397510
-Node: Nextfile Statement399900
-Node: Exit Statement402555
-Node: Built-in Variables404971
-Node: User-modified406066
-Ref: User-modified-Footnote-1414424
-Node: Auto-set414486
-Ref: Auto-set-Footnote-1427567
-Ref: Auto-set-Footnote-2427772
-Node: ARGC and ARGV427828
-Node: Arrays431682
-Node: Array Basics433187
-Node: Array Intro434013
-Node: Reference to Elements438330
-Node: Assigning Elements440600
-Node: Array Example441091
-Node: Scanning an Array442823
-Node: Controlling Scanning445137
-Ref: Controlling Scanning-Footnote-1450224
-Node: Delete450540
-Ref: Delete-Footnote-1453305
-Node: Numeric Array Subscripts453362
-Node: Uninitialized Subscripts455545
-Node: Multidimensional457172
-Node: Multiscanning460265
-Node: Arrays of Arrays461854
-Node: Functions466494
-Node: Built-in467313
-Node: Calling Built-in468391
-Node: Numeric Functions470379
-Ref: Numeric Functions-Footnote-1474211
-Ref: Numeric Functions-Footnote-2474568
-Ref: Numeric Functions-Footnote-3474616
-Node: String Functions474885
-Ref: String Functions-Footnote-1497805
-Ref: String Functions-Footnote-2497934
-Ref: String Functions-Footnote-3498182
-Node: Gory Details498269
-Ref: table-sub-escapes499948
-Ref: table-sub-posix-92501302
-Ref: table-sub-proposed502653
-Ref: table-posix-sub504007
-Ref: table-gensub-escapes505552
-Ref: Gory Details-Footnote-1506728
-Ref: Gory Details-Footnote-2506779
-Node: I/O Functions506930
-Ref: I/O Functions-Footnote-1513920
-Node: Time Functions514067
-Ref: Time Functions-Footnote-1525000
-Ref: Time Functions-Footnote-2525068
-Ref: Time Functions-Footnote-3525226
-Ref: Time Functions-Footnote-4525337
-Ref: Time Functions-Footnote-5525449
-Ref: Time Functions-Footnote-6525676
-Node: Bitwise Functions525942
-Ref: table-bitwise-ops526504
-Ref: Bitwise Functions-Footnote-1530725
-Node: Type Functions530909
-Node: I18N Functions532060
-Node: User-defined533687
-Node: Definition Syntax534491
-Ref: Definition Syntax-Footnote-1539405
-Node: Function Example539474
-Ref: Function Example-Footnote-1542123
-Node: Function Caveats542145
-Node: Calling A Function542663
-Node: Variable Scope543618
-Node: Pass By Value/Reference546581
-Node: Return Statement550089
-Node: Dynamic Typing553070
-Node: Indirect Calls554001
-Node: Library Functions563688
-Ref: Library Functions-Footnote-1567201
-Ref: Library Functions-Footnote-2567344
-Node: Library Names567515
-Ref: Library Names-Footnote-1570988
-Ref: Library Names-Footnote-2571208
-Node: General Functions571294
-Node: Strtonum Function572322
-Node: Assert Function575252
-Node: Round Function578578
-Node: Cliff Random Function580119
-Node: Ordinal Functions581135
-Ref: Ordinal Functions-Footnote-1584212
-Ref: Ordinal Functions-Footnote-2584464
-Node: Join Function584675
-Ref: Join Function-Footnote-1586446
-Node: Getlocaltime Function586646
-Node: Readfile Function590387
-Node: Data File Management592226
-Node: Filetrans Function592858
-Node: Rewind Function596927
-Node: File Checking598314
-Node: Empty Files599408
-Node: Ignoring Assigns601638
-Node: Getopt Function603192
-Ref: Getopt Function-Footnote-1614495
-Node: Passwd Functions614698
-Ref: Passwd Functions-Footnote-1623676
-Node: Group Functions623764
-Node: Walking Arrays631848
-Node: Sample Programs633984
-Node: Running Examples634658
-Node: Clones635386
-Node: Cut Program636610
-Node: Egrep Program646461
-Ref: Egrep Program-Footnote-1654234
-Node: Id Program654344
-Node: Split Program657960
-Ref: Split Program-Footnote-1661479
-Node: Tee Program661607
-Node: Uniq Program664410
-Node: Wc Program671839
-Ref: Wc Program-Footnote-1676105
-Ref: Wc Program-Footnote-2676305
-Node: Miscellaneous Programs676397
-Node: Dupword Program677585
-Node: Alarm Program679616
-Node: Translate Program684423
-Ref: Translate Program-Footnote-1688810
-Ref: Translate Program-Footnote-2689058
-Node: Labels Program689192
-Ref: Labels Program-Footnote-1692563
-Node: Word Sorting692647
-Node: History Sorting696531
-Node: Extract Program698370
-Ref: Extract Program-Footnote-1705873
-Node: Simple Sed706001
-Node: Igawk Program709063
-Ref: Igawk Program-Footnote-1724220
-Ref: Igawk Program-Footnote-2724421
-Node: Anagram Program724559
-Node: Signature Program727627
-Node: Advanced Features728727
-Node: Nondecimal Data730613
-Node: Array Sorting732196
-Node: Controlling Array Traversal732893
-Node: Array Sorting Functions741177
-Ref: Array Sorting Functions-Footnote-1745046
-Node: Two-way I/O745240
-Ref: Two-way I/O-Footnote-1750672
-Node: TCP/IP Networking750754
-Node: Profiling753598
-Node: Internationalization761101
-Node: I18N and L10N762526
-Node: Explaining gettext763212
-Ref: Explaining gettext-Footnote-1768280
-Ref: Explaining gettext-Footnote-2768464
-Node: Programmer i18n768629
-Node: Translator i18n772831
-Node: String Extraction773625
-Ref: String Extraction-Footnote-1774586
-Node: Printf Ordering774672
-Ref: Printf Ordering-Footnote-1777454
-Node: I18N Portability777518
-Ref: I18N Portability-Footnote-1779967
-Node: I18N Example780030
-Ref: I18N Example-Footnote-1782668
-Node: Gawk I18N782740
-Node: Debugger783361
-Node: Debugging784332
-Node: Debugging Concepts784765
-Node: Debugging Terms786621
-Node: Awk Debugging789218
-Node: Sample Debugging Session790110
-Node: Debugger Invocation790630
-Node: Finding The Bug791963
-Node: List of Debugger Commands798450
-Node: Breakpoint Control799784
-Node: Debugger Execution Control803448
-Node: Viewing And Changing Data806808
-Node: Execution Stack810164
-Node: Debugger Info811631
-Node: Miscellaneous Debugger Commands815613
-Node: Readline Support820789
-Node: Limitations821620
-Node: Arbitrary Precision Arithmetic823872
-Ref: Arbitrary Precision Arithmetic-Footnote-1825521
-Node: General Arithmetic825669
-Node: Floating Point Issues827389
-Node: String Conversion Precision828270
-Ref: String Conversion Precision-Footnote-1829975
-Node: Unexpected Results830084
-Node: POSIX Floating Point Problems832237
-Ref: POSIX Floating Point Problems-Footnote-1836062
-Node: Integer Programming836100
-Node: Floating-point Programming837839
-Ref: Floating-point Programming-Footnote-1844170
-Ref: Floating-point Programming-Footnote-2844440
-Node: Floating-point Representation844704
-Node: Floating-point Context845869
-Ref: table-ieee-formats846708
-Node: Rounding Mode848092
-Ref: table-rounding-modes848571
-Ref: Rounding Mode-Footnote-1851586
-Node: Gawk and MPFR851765
-Node: Arbitrary Precision Floats853020
-Ref: Arbitrary Precision Floats-Footnote-1855463
-Node: Setting Precision855779
-Ref: table-predefined-precision-strings856465
-Node: Setting Rounding Mode858610
-Ref: table-gawk-rounding-modes859014
-Node: Floating-point Constants860201
-Node: Changing Precision861630
-Ref: Changing Precision-Footnote-1863027
-Node: Exact Arithmetic863201
-Node: Arbitrary Precision Integers866339
-Ref: Arbitrary Precision Integers-Footnote-1869354
-Node: Dynamic Extensions869501
-Node: Extension Intro870959
-Node: Plugin License872224
-Node: Extension Mechanism Outline872909
-Ref: load-extension873326
-Ref: load-new-function874804
-Ref: call-new-function875799
-Node: Extension API Description877814
-Node: Extension API Functions Introduction879101
-Node: General Data Types884028
-Ref: General Data Types-Footnote-1889723
-Node: Requesting Values890022
-Ref: table-value-types-returned890759
-Node: Memory Allocation Functions891713
-Ref: Memory Allocation Functions-Footnote-1894459
-Node: Constructor Functions894555
-Node: Registration Functions896313
-Node: Extension Functions896998
-Node: Exit Callback Functions899300
-Node: Extension Version String900549
-Node: Input Parsers901199
-Node: Output Wrappers910956
-Node: Two-way processors915466
-Node: Printing Messages917674
-Ref: Printing Messages-Footnote-1918751
-Node: Updating `ERRNO'918903
-Node: Accessing Parameters919642
-Node: Symbol Table Access920872
-Node: Symbol table by name921386
-Node: Symbol table by cookie923135
-Ref: Symbol table by cookie-Footnote-1927267
-Node: Cached values927330
-Ref: Cached values-Footnote-1930820
-Node: Array Manipulation930911
-Ref: Array Manipulation-Footnote-1932009
-Node: Array Data Types932048
-Ref: Array Data Types-Footnote-1934751
-Node: Array Functions934843
-Node: Flattening Arrays938679
-Node: Creating Arrays945531
-Node: Extension API Variables950256
-Node: Extension Versioning950892
-Node: Extension API Informational Variables952793
-Node: Extension API Boilerplate953879
-Node: Finding Extensions957683
-Node: Extension Example958243
-Node: Internal File Description958973
-Node: Internal File Ops963064
-Ref: Internal File Ops-Footnote-1974573
-Node: Using Internal File Ops974713
-Ref: Using Internal File Ops-Footnote-1977066
-Node: Extension Samples977332
-Node: Extension Sample File Functions978856
-Node: Extension Sample Fnmatch987341
-Node: Extension Sample Fork989110
-Node: Extension Sample Inplace990323
-Node: Extension Sample Ord992101
-Node: Extension Sample Readdir992937
-Node: Extension Sample Revout994469
-Node: Extension Sample Rev2way995062
-Node: Extension Sample Read write array995752
-Node: Extension Sample Readfile997635
-Node: Extension Sample API Tests998453
-Node: Extension Sample Time998978
-Node: gawkextlib1000342
-Node: Language History1003123
-Node: V7/SVR3.11004716
-Node: SVR41007036
-Node: POSIX1008478
-Node: BTL1009864
-Node: POSIX/GNU1010598
-Node: Feature History1016197
-Node: Common Extensions1029173
-Node: Ranges and Locales1030485
-Ref: Ranges and Locales-Footnote-11035102
-Ref: Ranges and Locales-Footnote-21035129
-Ref: Ranges and Locales-Footnote-31035363
-Node: Contributors1035584
-Node: Installation1040965
-Node: Gawk Distribution1041859
-Node: Getting1042343
-Node: Extracting1043169
-Node: Distribution contents1044861
-Node: Unix Installation1050566
-Node: Quick Installation1051183
-Node: Additional Configuration Options1053629
-Node: Configuration Philosophy1055365
-Node: Non-Unix Installation1057719
-Node: PC Installation1058177
-Node: PC Binary Installation1059476
-Node: PC Compiling1061324
-Node: PC Testing1064268
-Node: PC Using1065444
-Node: Cygwin1069612
-Node: MSYS1070421
-Node: VMS Installation1070935
-Node: VMS Compilation1071699
-Ref: VMS Compilation-Footnote-11072951
-Node: VMS Dynamic Extensions1073009
-Node: VMS Installation Details1074382
-Node: VMS Running1076633
-Node: VMS GNV1079467
-Node: VMS Old Gawk1080190
-Node: Bugs1080660
-Node: Other Versions1084578
-Node: Notes1090662
-Node: Compatibility Mode1091462
-Node: Additions1092245
-Node: Accessing The Source1093172
-Node: Adding Code1094612
-Node: New Ports1100657
-Node: Derived Files1104792
-Ref: Derived Files-Footnote-11110113
-Ref: Derived Files-Footnote-21110147
-Ref: Derived Files-Footnote-31110747
-Node: Future Extensions1110845
-Node: Implementation Limitations1111428
-Node: Extension Design1112680
-Node: Old Extension Problems1113834
-Ref: Old Extension Problems-Footnote-11115342
-Node: Extension New Mechanism Goals1115399
-Ref: Extension New Mechanism Goals-Footnote-11118764
-Node: Extension Other Design Decisions1118950
-Node: Extension Future Growth1121056
-Node: Old Extension Mechanism1121892
-Node: Basic Concepts1123632
-Node: Basic High Level1124313
-Ref: figure-general-flow1124584
-Ref: figure-process-flow1125183
-Ref: Basic High Level-Footnote-11128412
-Node: Basic Data Typing1128597
-Node: Glossary1131952
-Node: Copying1157181
-Node: GNU Free Documentation License1194738
-Node: Index1219875
+Ref: Options-Footnote-1125525
+Node: Other Arguments125550
+Node: Naming Standard Input128208
+Node: Environment Variables129302
+Node: AWKPATH Variable129860
+Ref: AWKPATH Variable-Footnote-1132641
+Ref: AWKPATH Variable-Footnote-2132686
+Node: AWKLIBPATH Variable132946
+Node: Other Environment Variables133664
+Node: Exit Status136627
+Node: Include Files137302
+Node: Loading Shared Libraries140871
+Node: Obsolete142235
+Node: Undocumented142932
+Node: Regexp143174
+Node: Regexp Usage144563
+Node: Escape Sequences146588
+Node: Regexp Operators152257
+Ref: Regexp Operators-Footnote-1159637
+Ref: Regexp Operators-Footnote-2159784
+Node: Bracket Expressions159882
+Ref: table-char-classes161772
+Node: GNU Regexp Operators164295
+Node: Case-sensitivity168018
+Ref: Case-sensitivity-Footnote-1170986
+Ref: Case-sensitivity-Footnote-2171221
+Node: Leftmost Longest171329
+Node: Computed Regexps172530
+Node: Reading Files175867
+Node: Records177869
+Ref: Records-Footnote-1187392
+Node: Fields187429
+Ref: Fields-Footnote-1190385
+Node: Nonconstant Fields190471
+Node: Changing Fields192677
+Node: Field Separators198636
+Node: Default Field Splitting201338
+Node: Regexp Field Splitting202455
+Node: Single Character Fields205797
+Node: Command Line Field Separator206856
+Node: Full Line Fields210198
+Ref: Full Line Fields-Footnote-1210706
+Node: Field Splitting Summary210752
+Ref: Field Splitting Summary-Footnote-1213851
+Node: Constant Size213952
+Node: Splitting By Content218559
+Ref: Splitting By Content-Footnote-1222308
+Node: Multiple Line222348
+Ref: Multiple Line-Footnote-1228195
+Node: Getline228374
+Node: Plain Getline230590
+Node: Getline/Variable232685
+Node: Getline/File233832
+Node: Getline/Variable/File235173
+Ref: Getline/Variable/File-Footnote-1236772
+Node: Getline/Pipe236859
+Node: Getline/Variable/Pipe239558
+Node: Getline/Coprocess240665
+Node: Getline/Variable/Coprocess241917
+Node: Getline Notes242654
+Node: Getline Summary245441
+Ref: table-getline-variants245849
+Node: Read Timeout246761
+Ref: Read Timeout-Footnote-1250502
+Node: Command line directories250559
+Node: Printing251189
+Node: Print252820
+Node: Print Examples254157
+Node: Output Separators256941
+Node: OFMT258957
+Node: Printf260315
+Node: Basic Printf261221
+Node: Control Letters262760
+Node: Format Modifiers266572
+Node: Printf Examples272581
+Node: Redirection275293
+Node: Special Files282267
+Node: Special FD282800
+Ref: Special FD-Footnote-1286425
+Node: Special Network286499
+Node: Special Caveats287349
+Node: Close Files And Pipes288145
+Ref: Close Files And Pipes-Footnote-1295128
+Ref: Close Files And Pipes-Footnote-2295276
+Node: Expressions295426
+Node: Values296558
+Node: Constants297234
+Node: Scalar Constants297914
+Ref: Scalar Constants-Footnote-1298773
+Node: Nondecimal-numbers298955
+Node: Regexp Constants301955
+Node: Using Constant Regexps302430
+Node: Variables305485
+Node: Using Variables306140
+Node: Assignment Options307864
+Node: Conversion309739
+Ref: table-locale-affects315239
+Ref: Conversion-Footnote-1315863
+Node: All Operators315972
+Node: Arithmetic Ops316602
+Node: Concatenation319107
+Ref: Concatenation-Footnote-1321895
+Node: Assignment Ops322015
+Ref: table-assign-ops327003
+Node: Increment Ops328334
+Node: Truth Values and Conditions331768
+Node: Truth Values332851
+Node: Typing and Comparison333900
+Node: Variable Typing334693
+Ref: Variable Typing-Footnote-1338590
+Node: Comparison Operators338712
+Ref: table-relational-ops339122
+Node: POSIX String Comparison342670
+Ref: POSIX String Comparison-Footnote-1343626
+Node: Boolean Ops343764
+Ref: Boolean Ops-Footnote-1347834
+Node: Conditional Exp347925
+Node: Function Calls349657
+Node: Precedence353251
+Node: Locales356920
+Node: Patterns and Actions358009
+Node: Pattern Overview359063
+Node: Regexp Patterns360732
+Node: Expression Patterns361275
+Node: Ranges365056
+Node: BEGIN/END368160
+Node: Using BEGIN/END368922
+Ref: Using BEGIN/END-Footnote-1371658
+Node: I/O And BEGIN/END371764
+Node: BEGINFILE/ENDFILE374046
+Node: Empty376960
+Node: Using Shell Variables377277
+Node: Action Overview379562
+Node: Statements381919
+Node: If Statement383773
+Node: While Statement385272
+Node: Do Statement387316
+Node: For Statement388472
+Node: Switch Statement391624
+Node: Break Statement393778
+Node: Continue Statement395768
+Node: Next Statement397561
+Node: Nextfile Statement399951
+Node: Exit Statement402606
+Node: Built-in Variables405022
+Node: User-modified406117
+Ref: User-modified-Footnote-1414475
+Node: Auto-set414537
+Ref: Auto-set-Footnote-1427601
+Ref: Auto-set-Footnote-2427806
+Node: ARGC and ARGV427862
+Node: Arrays431716
+Node: Array Basics433221
+Node: Array Intro434047
+Node: Reference to Elements438364
+Node: Assigning Elements440634
+Node: Array Example441125
+Node: Scanning an Array442857
+Node: Controlling Scanning445171
+Ref: Controlling Scanning-Footnote-1450258
+Node: Delete450574
+Ref: Delete-Footnote-1453339
+Node: Numeric Array Subscripts453396
+Node: Uninitialized Subscripts455579
+Node: Multidimensional457206
+Node: Multiscanning460299
+Node: Arrays of Arrays461888
+Node: Functions466528
+Node: Built-in467347
+Node: Calling Built-in468425
+Node: Numeric Functions470413
+Ref: Numeric Functions-Footnote-1474245
+Ref: Numeric Functions-Footnote-2474602
+Ref: Numeric Functions-Footnote-3474650
+Node: String Functions474919
+Ref: String Functions-Footnote-1497877
+Ref: String Functions-Footnote-2498006
+Ref: String Functions-Footnote-3498254
+Node: Gory Details498341
+Ref: table-sub-escapes500020
+Ref: table-sub-posix-92501374
+Ref: table-sub-proposed502725
+Ref: table-posix-sub504079
+Ref: table-gensub-escapes505624
+Ref: Gory Details-Footnote-1506800
+Ref: Gory Details-Footnote-2506851
+Node: I/O Functions507002
+Ref: I/O Functions-Footnote-1513992
+Node: Time Functions514139
+Ref: Time Functions-Footnote-1525072
+Ref: Time Functions-Footnote-2525140
+Ref: Time Functions-Footnote-3525298
+Ref: Time Functions-Footnote-4525409
+Ref: Time Functions-Footnote-5525521
+Ref: Time Functions-Footnote-6525748
+Node: Bitwise Functions526014
+Ref: table-bitwise-ops526576
+Ref: Bitwise Functions-Footnote-1530797
+Node: Type Functions530981
+Node: I18N Functions532132
+Node: User-defined533759
+Node: Definition Syntax534563
+Ref: Definition Syntax-Footnote-1539477
+Node: Function Example539546
+Ref: Function Example-Footnote-1542195
+Node: Function Caveats542217
+Node: Calling A Function542735
+Node: Variable Scope543690
+Node: Pass By Value/Reference546653
+Node: Return Statement550161
+Node: Dynamic Typing553142
+Node: Indirect Calls554073
+Node: Library Functions563760
+Ref: Library Functions-Footnote-1567273
+Ref: Library Functions-Footnote-2567416
+Node: Library Names567587
+Ref: Library Names-Footnote-1571060
+Ref: Library Names-Footnote-2571280
+Node: General Functions571366
+Node: Strtonum Function572394
+Node: Assert Function575324
+Node: Round Function578650
+Node: Cliff Random Function580191
+Node: Ordinal Functions581207
+Ref: Ordinal Functions-Footnote-1584284
+Ref: Ordinal Functions-Footnote-2584536
+Node: Join Function584747
+Ref: Join Function-Footnote-1586518
+Node: Getlocaltime Function586718
+Node: Readfile Function590459
+Node: Data File Management592298
+Node: Filetrans Function592930
+Node: Rewind Function596999
+Node: File Checking598386
+Node: Empty Files599480
+Node: Ignoring Assigns601710
+Node: Getopt Function603264
+Ref: Getopt Function-Footnote-1614567
+Node: Passwd Functions614770
+Ref: Passwd Functions-Footnote-1623748
+Node: Group Functions623836
+Node: Walking Arrays631920
+Node: Sample Programs634056
+Node: Running Examples634730
+Node: Clones635458
+Node: Cut Program636682
+Node: Egrep Program646533
+Ref: Egrep Program-Footnote-1654306
+Node: Id Program654416
+Node: Split Program658065
+Ref: Split Program-Footnote-1661584
+Node: Tee Program661712
+Node: Uniq Program664515
+Node: Wc Program671944
+Ref: Wc Program-Footnote-1676210
+Ref: Wc Program-Footnote-2676410
+Node: Miscellaneous Programs676502
+Node: Dupword Program677690
+Node: Alarm Program679721
+Node: Translate Program684528
+Ref: Translate Program-Footnote-1688915
+Ref: Translate Program-Footnote-2689163
+Node: Labels Program689297
+Ref: Labels Program-Footnote-1692668
+Node: Word Sorting692752
+Node: History Sorting696636
+Node: Extract Program698475
+Ref: Extract Program-Footnote-1705978
+Node: Simple Sed706106
+Node: Igawk Program709168
+Ref: Igawk Program-Footnote-1724325
+Ref: Igawk Program-Footnote-2724526
+Node: Anagram Program724664
+Node: Signature Program727732
+Node: Advanced Features728832
+Node: Nondecimal Data730718
+Node: Array Sorting732301
+Node: Controlling Array Traversal732998
+Node: Array Sorting Functions741282
+Ref: Array Sorting Functions-Footnote-1745151
+Node: Two-way I/O745345
+Ref: Two-way I/O-Footnote-1750777
+Node: TCP/IP Networking750859
+Node: Profiling753703
+Node: Internationalization761206
+Node: I18N and L10N762631
+Node: Explaining gettext763317
+Ref: Explaining gettext-Footnote-1768385
+Ref: Explaining gettext-Footnote-2768569
+Node: Programmer i18n768734
+Node: Translator i18n772936
+Node: String Extraction773730
+Ref: String Extraction-Footnote-1774691
+Node: Printf Ordering774777
+Ref: Printf Ordering-Footnote-1777559
+Node: I18N Portability777623
+Ref: I18N Portability-Footnote-1780072
+Node: I18N Example780135
+Ref: I18N Example-Footnote-1782773
+Node: Gawk I18N782845
+Node: Debugger783466
+Node: Debugging784437
+Node: Debugging Concepts784870
+Node: Debugging Terms786726
+Node: Awk Debugging789323
+Node: Sample Debugging Session790215
+Node: Debugger Invocation790735
+Node: Finding The Bug792068
+Node: List of Debugger Commands798555
+Node: Breakpoint Control799889
+Node: Debugger Execution Control803553
+Node: Viewing And Changing Data806913
+Node: Execution Stack810269
+Node: Debugger Info811736
+Node: Miscellaneous Debugger Commands815718
+Node: Readline Support820894
+Node: Limitations821725
+Node: Arbitrary Precision Arithmetic823977
+Ref: Arbitrary Precision Arithmetic-Footnote-1825626
+Node: General Arithmetic825774
+Node: Floating Point Issues827494
+Node: String Conversion Precision828375
+Ref: String Conversion Precision-Footnote-1830080
+Node: Unexpected Results830189
+Node: POSIX Floating Point Problems832342
+Ref: POSIX Floating Point Problems-Footnote-1836167
+Node: Integer Programming836205
+Node: Floating-point Programming837944
+Ref: Floating-point Programming-Footnote-1844275
+Ref: Floating-point Programming-Footnote-2844545
+Node: Floating-point Representation844809
+Node: Floating-point Context845974
+Ref: table-ieee-formats846813
+Node: Rounding Mode848197
+Ref: table-rounding-modes848676
+Ref: Rounding Mode-Footnote-1851691
+Node: Gawk and MPFR851870
+Node: Arbitrary Precision Floats853125
+Ref: Arbitrary Precision Floats-Footnote-1855568
+Node: Setting Precision855884
+Ref: table-predefined-precision-strings856570
+Node: Setting Rounding Mode858715
+Ref: table-gawk-rounding-modes859119
+Node: Floating-point Constants860306
+Node: Changing Precision861735
+Ref: Changing Precision-Footnote-1863132
+Node: Exact Arithmetic863306
+Node: Arbitrary Precision Integers866444
+Ref: Arbitrary Precision Integers-Footnote-1869459
+Node: Dynamic Extensions869606
+Node: Extension Intro871064
+Node: Plugin License872329
+Node: Extension Mechanism Outline873014
+Ref: load-extension873431
+Ref: load-new-function874909
+Ref: call-new-function875904
+Node: Extension API Description877919
+Node: Extension API Functions Introduction879206
+Node: General Data Types884133
+Ref: General Data Types-Footnote-1889828
+Node: Requesting Values890127
+Ref: table-value-types-returned890864
+Node: Memory Allocation Functions891818
+Ref: Memory Allocation Functions-Footnote-1894564
+Node: Constructor Functions894660
+Node: Registration Functions896418
+Node: Extension Functions897103
+Node: Exit Callback Functions899405
+Node: Extension Version String900654
+Node: Input Parsers901304
+Node: Output Wrappers911061
+Node: Two-way processors915571
+Node: Printing Messages917779
+Ref: Printing Messages-Footnote-1918856
+Node: Updating `ERRNO'919008
+Node: Accessing Parameters919747
+Node: Symbol Table Access920977
+Node: Symbol table by name921491
+Node: Symbol table by cookie923240
+Ref: Symbol table by cookie-Footnote-1927372
+Node: Cached values927435
+Ref: Cached values-Footnote-1930925
+Node: Array Manipulation931016
+Ref: Array Manipulation-Footnote-1932114
+Node: Array Data Types932153
+Ref: Array Data Types-Footnote-1934856
+Node: Array Functions934948
+Node: Flattening Arrays938784
+Node: Creating Arrays945636
+Node: Extension API Variables950361
+Node: Extension Versioning950997
+Node: Extension API Informational Variables952898
+Node: Extension API Boilerplate953984
+Node: Finding Extensions957788
+Node: Extension Example958348
+Node: Internal File Description959078
+Node: Internal File Ops963169
+Ref: Internal File Ops-Footnote-1974678
+Node: Using Internal File Ops974818
+Ref: Using Internal File Ops-Footnote-1977171
+Node: Extension Samples977437
+Node: Extension Sample File Functions978961
+Node: Extension Sample Fnmatch987446
+Node: Extension Sample Fork989215
+Node: Extension Sample Inplace990428
+Node: Extension Sample Ord992206
+Node: Extension Sample Readdir993042
+Node: Extension Sample Revout994574
+Node: Extension Sample Rev2way995167
+Node: Extension Sample Read write array995857
+Node: Extension Sample Readfile997740
+Node: Extension Sample API Tests998558
+Node: Extension Sample Time999083
+Node: gawkextlib1000447
+Node: Language History1003228
+Node: V7/SVR3.11004821
+Node: SVR41007141
+Node: POSIX1008583
+Node: BTL1009969
+Node: POSIX/GNU1010703
+Node: Feature History1016302
+Node: Common Extensions1029278
+Node: Ranges and Locales1030590
+Ref: Ranges and Locales-Footnote-11035207
+Ref: Ranges and Locales-Footnote-21035234
+Ref: Ranges and Locales-Footnote-31035468
+Node: Contributors1035689
+Node: Installation1041070
+Node: Gawk Distribution1041964
+Node: Getting1042448
+Node: Extracting1043274
+Node: Distribution contents1044966
+Node: Unix Installation1050671
+Node: Quick Installation1051288
+Node: Additional Configuration Options1053734
+Node: Configuration Philosophy1055470
+Node: Non-Unix Installation1057824
+Node: PC Installation1058282
+Node: PC Binary Installation1059581
+Node: PC Compiling1061429
+Node: PC Testing1064373
+Node: PC Using1065549
+Node: Cygwin1069717
+Node: MSYS1070526
+Node: VMS Installation1071040
+Node: VMS Compilation1071804
+Ref: VMS Compilation-Footnote-11073056
+Node: VMS Dynamic Extensions1073114
+Node: VMS Installation Details1074487
+Node: VMS Running1076738
+Node: VMS GNV1079572
+Node: VMS Old Gawk1080295
+Node: Bugs1080765
+Node: Other Versions1084683
+Node: Notes1090767
+Node: Compatibility Mode1091567
+Node: Additions1092350
+Node: Accessing The Source1093277
+Node: Adding Code1094717
+Node: New Ports1100762
+Node: Derived Files1104897
+Ref: Derived Files-Footnote-11110218
+Ref: Derived Files-Footnote-21110252
+Ref: Derived Files-Footnote-31110852
+Node: Future Extensions1110950
+Node: Implementation Limitations1111533
+Node: Extension Design1112785
+Node: Old Extension Problems1113939
+Ref: Old Extension Problems-Footnote-11115447
+Node: Extension New Mechanism Goals1115504
+Ref: Extension New Mechanism Goals-Footnote-11118869
+Node: Extension Other Design Decisions1119055
+Node: Extension Future Growth1121161
+Node: Old Extension Mechanism1121997
+Node: Basic Concepts1123737
+Node: Basic High Level1124418
+Ref: figure-general-flow1124689
+Ref: figure-process-flow1125288
+Ref: Basic High Level-Footnote-11128517
+Node: Basic Data Typing1128702
+Node: Glossary1132057
+Node: Copying1157286
+Node: GNU Free Documentation License1194843
+Node: Index1219980

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 30ba377b..aa9e3ee4 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -2070,11 +2070,11 @@ $ @kbd{awk "BEGIN @{ print \"Don't Panic!\" @}"}
@print{} Don't Panic!
@end example
-@cindex quoting
-@cindex double quote (@code{"})
-@cindex @code{"} (double quote)
-@cindex @code{\} (backslash)
-@cindex backslash (@code{\})
+@cindex shell quoting, double quote
+@cindex double quote (@code{"}) in shell commands
+@cindex @code{"} (double quote) in shell commands
+@cindex @code{\} (backslash) in shell commands
+@cindex backslash (@code{\}) in shell commands
This program does not read any input. The @samp{\} before each of the
inner double quotes is necessary because of the shell's quoting
rules---in particular because it mixes both single quotes and
@@ -2114,8 +2114,7 @@ awk -f @var{source-file} @var{input-file1} @var{input-file2} @dots{}
@end example
@cindex @option{-f} option
-@cindex command line, options
-@cindex options, command-line
+@cindex command line, option @option{-f}
The @option{-f} instructs the @command{awk} utility to get the @command{awk} program
from the file @var{source-file}. Any file name can be used for
@var{source-file}. For example, you could put the program:
@@ -2138,7 +2137,7 @@ does the same thing as this one:
awk "BEGIN @{ print \"Don't Panic!\" @}"
@end example
-@cindex quoting
+@cindex quoting in @command{gawk} command lines
@noindent
This was explained earlier
(@pxref{Read Terminal}).
@@ -2149,9 +2148,9 @@ program did not have single quotes around it. The quotes are only needed
for programs that are provided on the @command{awk} command line.
@c STARTOFRANGE sq1x
-@cindex single quote (@code{'})
+@cindex single quote (@code{'}) in @command{gawk} command lines
@c STARTOFRANGE qs2x
-@cindex @code{'} (single quote)
+@cindex @code{'} (single quote) in @command{gawk} command lines
If you want to clearly identify your @command{awk} program files as such,
you can add the extension @file{.awk} to the file name. This doesn't
affect the execution of the @command{awk} program but it does make
@@ -2300,7 +2299,7 @@ programs, but this usually isn't very useful; the purpose of a
comment is to help you or another person understand the program
when reading it at a later time.
-@cindex quoting
+@cindex quoting, for small awk programs
@cindex single quote (@code{'}), vs.@: apostrophe
@cindex @code{'} (single quote), vs.@: apostrophe
@quotation CAUTION
@@ -2341,7 +2340,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules.
@node Quoting
@subsection Shell-Quoting Issues
-@cindex quoting, rules for
+@cindex shell quoting, rules for
@menu
* DOS Quoting:: Quoting in Windows Batch Files.
@@ -2376,10 +2375,10 @@ that character. The shell removes the backslash and passes the quoted
character on to the command.
@item
-@cindex @code{\} (backslash)
-@cindex backslash (@code{\})
-@cindex single quote (@code{'})
-@cindex @code{'} (single quote)
+@cindex @code{\} (backslash), in shell commands
+@cindex backslash (@code{\}), in shell commands
+@cindex single quote (@code{'}), in shell commands
+@cindex @code{'} (single quote), in shell commands
Single quotes protect everything between the opening and closing quotes.
The shell does no interpretation of the quoted text, passing it on verbatim
to the command.
@@ -2389,8 +2388,8 @@ Refer back to
for an example of what happens if you try.
@item
-@cindex double quote (@code{"})
-@cindex @code{"} (double quote)
+@cindex double quote (@code{"}), in shell commands
+@cindex @code{"} (double quote), in shell commands
Double quotes protect most things between the opening and closing quotes.
The shell does at least variable and command substitution on the quoted text.
Different shells may do additional kinds of processing on double-quoted text.
@@ -2427,7 +2426,7 @@ awk -F "" '@var{program}' @var{files} # correct
@end example
@noindent
-@cindex null strings, quoting and
+@cindex null strings in @command{gawk} arguments, quoting and
Don't use this:
@example
@@ -2440,7 +2439,7 @@ as the value of @code{FS}, and the first file name as the text of the program!
This results in syntax errors at best, and confusing behavior at worst.
@end itemize
-@cindex quoting, tricks for
+@cindex quoting in @command{gawk} command lines, tricks for
Mixing single and double quotes is difficult. You have to resort
to shell quoting tricks, like this:
@@ -3322,6 +3321,7 @@ Print the short version of the General Public License and then exit.
@itemx --dump-variables@r{[}=@var{file}@r{]}
@cindex @option{-d} option
@cindex @option{--dump-variables} option
+@cindex dump all variables of a program
@cindex @file{awkvars.out} file
@cindex files, @file{awkvars.out}
@cindex variables, global, printing list of
@@ -3475,7 +3475,7 @@ care to search for all occurrences of each inappropriate construct. As
@cindex @option{--bignum} option
Force arbitrary precision arithmetic on numbers. This option has no effect
if @command{gawk} is not compiled to use the GNU MPFR and MP libraries
-(@pxref{Arbitrary Precision Arithmetic}).
+(@pxref{Gawk and MPFR}).
@item -n
@itemx --non-decimal-data
@@ -3728,6 +3728,7 @@ file at all.
@cindex @command{gawk}, @code{ARGIND} variable in
@cindex @code{ARGIND} variable, command-line arguments
+@cindex @code{ARGV} array, indexing into
@cindex @code{ARGC}/@code{ARGV} variables, command-line arguments
All these arguments are made available to your @command{awk} program in the
@code{ARGV} array (@pxref{Built-in Variables}). Command-line options
@@ -3738,6 +3739,7 @@ sets the variable @code{ARGIND} to the index in @code{ARGV} of the
current element.
@cindex input files, variable assignments and
+@cindex variable assignments and input files
The distinction between file name arguments and variable-assignment
arguments is made when @command{awk} is about to open the next input file.
At that point in execution, it checks the file name to see whether
@@ -3815,6 +3817,7 @@ this file name itself.)
@node Environment Variables
@section The Environment Variables @command{gawk} Uses
+@cindex environment variables used by @command{gawk}
A number of environment variables influence how @command{gawk}
behaves.
@@ -3830,8 +3833,7 @@ behaves.
@node AWKPATH Variable
@subsection The @env{AWKPATH} Environment Variable
@cindex @env{AWKPATH} environment variable
-@cindex directories, searching
-@cindex search paths
+@cindex directories, searching for source files
@cindex search paths, for source files
@cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable
@ifinfo
@@ -3843,12 +3845,12 @@ implementations, you must supply a precise path name for each program
file, unless the file is in the current directory.
But in @command{gawk}, if the file name supplied to the @option{-f}
or @option{-i} options
-does not contain a @samp{/}, then @command{gawk} searches a list of
+does not contain a directory separator @samp{/}, then @command{gawk} searches a list of
directories (called the @dfn{search path}), one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
-separated by colons. @command{gawk} gets its search path from the
+separated by colons@footnote{Semicolons on MS-Windows and MS-DOS.}. @command{gawk} gets its search path from the
@env{AWKPATH} environment variable. If that variable does not exist,
@command{gawk} uses a default path,
@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk}
@@ -3906,8 +3908,7 @@ found, and @command{gawk} no longer needs to use @env{AWKPATH}.
@node AWKLIBPATH Variable
@subsection The @env{AWKLIBPATH} Environment Variable
@cindex @env{AWKLIBPATH} environment variable
-@cindex directories, searching
-@cindex search paths
+@cindex directories, searching for shared libraries
@cindex search paths, for shared libraries
@cindex differences in @command{awk} and @command{gawk}, @code{AWKLIBPATH} environment variable
@@ -4192,7 +4193,6 @@ they will @emph{not} be in the next release).
@c update this section for each release!
-@cindex @code{PROCINFO} array
The process-related special files @file{/dev/pid}, @file{/dev/ppid},
@file{/dev/pgrpid}, and @file{/dev/user} were deprecated in @command{gawk}
3.1, but still worked. As of version 4.0, they are no longer
@@ -4277,7 +4277,7 @@ long-undocumented ``feature'' of Unix @code{awk}.
@node Regexp
@chapter Regular Expressions
-@cindex regexp, See regular expressions
+@cindex regexp
@c STARTOFRANGE regexp
@cindex regular expressions
@@ -4286,8 +4286,8 @@ set of strings.
Because regular expressions are such a fundamental part of @command{awk}
programming, their format and use deserve a separate @value{CHAPTER}.
-@cindex forward slash (@code{/})
-@cindex @code{/} (forward slash)
+@cindex forward slash (@code{/}) to enclose regular expressions
+@cindex @code{/} (forward slash) to enclose regular expressions
A regular expression enclosed in slashes (@samp{/})
is an @command{awk} pattern that matches every input record whose text
belongs to that set.
@@ -4343,9 +4343,9 @@ $ @kbd{awk '/li/ @{ print $2 @}' mail-list}
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
@c @cindex operators, @code{!~}
-@cindex @code{if} statement
-@cindex @code{while} statement
-@cindex @code{do}-@code{while} statement
+@cindex @code{if} statement, use of regexps in
+@cindex @code{while} statement, use of regexps in
+@cindex @code{do}-@code{while} statement, use of regexps in
@c @cindex statements, @code{if}
@c @cindex statements, @code{while}
@c @cindex statements, @code{do}
@@ -4404,6 +4404,7 @@ $ @kbd{awk '$1 !~ /J/' inventory-shipped}
@end example
@cindex regexp constants
+@cindex constant regexps
@cindex regular expressions, constants, See regexp constants
When a regexp is enclosed in slashes, such as @code{/foo/}, we call it
a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
@@ -4412,7 +4413,7 @@ a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
@node Escape Sequences
@section Escape Sequences
-@cindex escape sequences
+@cindex escape sequences, in strings
@cindex backslash (@code{\}), in escape sequences
@cindex @code{\} (backslash), in escape sequences
Some characters cannot be included literally in string constants
@@ -4706,6 +4707,7 @@ escape sequences literally when used in regexp constants. Thus,
@section Regular Expression Operators
@c STARTOFRANGE regexpo
@cindex regular expressions, operators
+@cindex metacharacters in regular expressions
You can combine regular expressions with special characters,
called @dfn{regular expression operators} or @dfn{metacharacters}, to
@@ -4724,8 +4726,8 @@ Here is a list of metacharacters. All characters that are not escape
sequences and that are not listed in the table stand for themselves:
@table @code
-@cindex backslash (@code{\})
-@cindex @code{\} (backslash)
+@cindex backslash (@code{\}), regexp operator
+@cindex @code{\} (backslash), regexp operator
@item \
This is used to suppress the special meaning of a character when
matching. For example, @samp{\$}
@@ -4763,8 +4765,8 @@ The condition in the following example is not true:
if ("line1\nLINE 2" ~ /1$/) @dots{}
@end example
-@cindex @code{.} (period)
-@cindex period (@code{.})
+@cindex @code{.} (period), regexp operator
+@cindex period (@code{.}), regexp operator
@item . @r{(period)}
This matches any single character,
@emph{including} the newline character. For example, @samp{.P}
@@ -4780,8 +4782,8 @@ character, which is a character with all bits equal to zero.
Otherwise, @sc{nul} is just another character. Other versions of @command{awk}
may not be able to match the @sc{nul} character.
-@cindex @code{[]} (square brackets)
-@cindex square brackets (@code{[]})
+@cindex @code{[]} (square brackets), regexp operator
+@cindex square brackets (@code{[]}), regexp operator
@cindex bracket expressions
@cindex character sets, See Also bracket expressions
@cindex character lists, See bracket expressions
@@ -4868,7 +4870,7 @@ This symbol is similar to @samp{*}, except that the preceding expression can be
matched either once or not at all. For example, @samp{fe?d}
matches @samp{fed} and @samp{fd}, but nothing else.
-@cindex interval expressions
+@cindex interval expressions, regexp operator
@item @{@var{n}@}
@itemx @{@var{n},@}
@itemx @{@var{n},@var{m}@}
@@ -4945,6 +4947,7 @@ expressions are not available in regular expressions.
@cindex bracket expressions
@cindex bracket expressions, range expressions
@cindex range expressions (regexps)
+@cindex character lists in regular expression
As mentioned earlier, a bracket expression matches any character amongst
those listed between the opening and closing square brackets.
@@ -5208,7 +5211,7 @@ lesser of two evils.
@c
@c Should really do this with file inclusion.
@cindex regular expressions, @command{gawk}, command-line options
-@cindex @command{gawk}, command-line options
+@cindex @command{gawk}, command-line options, and regular expressions
The various command-line options
(@pxref{Options})
control how @command{gawk} interprets characters in regexps:
@@ -5287,7 +5290,7 @@ This works in any POSIX-compliant @command{awk}.
@cindex tilde (@code{~}), @code{~} operator
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
-@cindex @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, @code{~} and @code{!~} operators
@cindex @command{gawk}, @code{IGNORECASE} variable in
@c @cindex variables, @code{IGNORECASE}
Another method, specific to @command{gawk}, is to set the variable
@@ -5552,6 +5555,7 @@ occur often in practice, but it's worth noting for future reference.
@chapter Reading Input Files
@c STARTOFRANGE infir
+@cindex reading input files
@cindex input files, reading
@cindex input files
@cindex @code{FILENAME} variable
@@ -5638,7 +5642,6 @@ To do this, use the special @code{BEGIN} pattern
(@pxref{BEGIN/END}).
For example:
-@cindex @code{BEGIN} pattern
@example
awk 'BEGIN @{ RS = "u" @}
@{ print $0 @}' mail-list
@@ -5754,6 +5757,7 @@ Reaching the end of an input file terminates the current input record,
even if the last character in the file is not the character in @code{RS}.
@value{DARKCORNER}
+@cindex empty strings
@cindex null strings
@cindex strings, empty, See null strings
The empty string @code{""} (a string without any characters)
@@ -5890,7 +5894,7 @@ character as a record separator. However, this is a special case:
@command{mawk} does not allow embedded @sc{nul} characters in strings.
@cindex records, treating files as
-@cindex files, as single records
+@cindex treating files, as single records
The best way to treat a whole file as a single record is to
simply read the file in, one record at a time, concatenating each
record onto the end of the previous ones.
@@ -5941,7 +5945,7 @@ character as a record separator. However, this is a special case:
@command{mawk} does not allow embedded @sc{nul} characters in strings.
@cindex records, treating files as
-@cindex files, as single records
+@cindex treating files, as single records
The best way to treat a whole file as a single record is to
simply read the file in, one record at a time, concatenating each
record onto the end of the previous ones.
@@ -6588,10 +6592,8 @@ behaves this way.
@node Command Line Field Separator
@subsection Setting @code{FS} from the Command Line
-@cindex @option{-F} option
-@cindex options, command-line
-@cindex command line, options
-@cindex field separators, on command line
+@cindex @option{-F} option, command line
+@cindex field separator, on command line
@cindex command line, @code{FS} on@comma{} setting
@cindex @code{FS} variable, setting from command line
@@ -6756,7 +6758,7 @@ POSIX standard.)
@cindex POSIX @command{awk}, field separators and
-@cindex field separators, POSIX and
+@cindex field separator, POSIX and
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
@@ -6809,7 +6811,7 @@ root:nSijPlPhZZwgE:0:0:Root:/:
@cindex POSIX @command{awk}, field separators and
-@cindex field separators, POSIX and
+@cindex field separator, POSIX and
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
@@ -7169,6 +7171,7 @@ available for splitting regular strings (@pxref{String Functions}).
@node Multiple Line
@section Multiple-Line Records
+@cindex multiple-line records
@c STARTOFRANGE recm
@cindex records, multiline
@c STARTOFRANGE imr
@@ -7220,7 +7223,8 @@ after the last record, the final newline is removed from the record.
In the second case, this special processing is not done.
@value{DARKCORNER}
-@cindex field separators, in multiline records
+@cindex field separator, in multiline records
+@cindex @code{FS}, in multiline records
Now that the input is separated into records, the second step is to
separate the fields in the record. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
@@ -7368,7 +7372,7 @@ and study the @code{getline} command @emph{after} you have reviewed the
rest of this @value{DOCUMENT} and have a good knowledge of how @command{awk} works.
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @command{getline} command
@cindex differences in @command{awk} and @command{gawk}, @code{getline} command
@cindex @code{getline} command, return values
@cindex @option{--sandbox} option, input redirection with @code{getline}
@@ -7464,6 +7468,7 @@ rule in the program. @xref{Next Statement}.
@node Getline/Variable
@subsection Using @code{getline} into a Variable
+@cindex @code{getline} into a variable
@cindex variables, @code{getline} command into@comma{} using
You can use @samp{getline @var{var}} to read the next record from
@@ -7515,6 +7520,7 @@ the value of @code{NF} do not change.
@node Getline/File
@subsection Using @code{getline} from a File
+@cindex @code{getline} from a file
@cindex input redirection
@cindex redirection of input
@cindex @code{<} (left angle bracket), @code{<} operator (I/O)
@@ -7563,8 +7569,6 @@ from the file
@var{file}, and put it in the variable @var{var}. As above, @var{file}
is a string-valued expression that specifies the file from which to read.
-@cindex @command{gawk}, @code{RT} variable in
-@cindex @code{RT} variable
In this version of @code{getline}, none of the built-in variables are
changed and the record is not split into fields. The only variable
changed is @var{var}.@footnote{This is not quite true. @code{RT} could
@@ -7589,7 +7593,6 @@ Note here how the name of the extra input file is not built into
the program; it is taken directly from the data, specifically from the second field on
the @samp{@@include} line.
-@cindex @code{close()} function
The @code{close()} function is called to ensure that if two identical
@samp{@@include} lines appear in the input, the entire specified file is
included twice.
@@ -7616,7 +7619,7 @@ Failing that, attention to details would be useful.}
@cindex @code{|} (vertical bar), @code{|} operator (I/O)
@cindex vertical bar (@code{|}), @code{|} operator (I/O)
@cindex input pipeline
-@cindex pipes, input
+@cindex pipe, input
@cindex operators, input/output
The output of a command can also be piped into @code{getline}, using
@samp{@var{command} | getline}. In
@@ -7640,7 +7643,6 @@ produced by running the rest of the line as a shell command:
@end example
@noindent
-@cindex @code{close()} function
The @code{close()} function is called to ensure that if two identical
@samp{@@execute} lines appear in the input, the command is run for
each one.
@@ -8917,7 +8919,7 @@ appended to the file.
If @var{output-file} does not exist, then it is created.
@cindex @code{|} (vertical bar), @code{|} operator (I/O)
-@cindex pipes, output
+@cindex pipe, output
@cindex output, pipes
@item print @var{items} | @var{command}
It is possible to send output to another program through a pipe
@@ -9292,7 +9294,7 @@ Doing so results in unpredictable behavior.
@c STARTOFRANGE ofc
@cindex output, files@comma{} closing
@c STARTOFRANGE pc
-@cindex pipes, closing
+@cindex pipe, closing
@c STARTOFRANGE cc
@cindex coprocesses, closing
@cindex @code{getline} command, coprocesses@comma{} using from
@@ -9395,6 +9397,7 @@ a separate message.
@cindex differences in @command{awk} and @command{gawk}, @code{close()} function
@cindex portability, @code{close()} function and
+@cindex @code{close()} function, portability
If you use more files than the system allows you to have open,
@command{gawk} attempts to multiplex the available open files among
your data files. @command{gawk}'s ability to do this depends upon the
@@ -9479,7 +9482,7 @@ retval = close(command) # syntax error in many Unix awks
@end example
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @command{close()} function
@command{gawk} treats @code{close()} as a function.
The return value is @minus{}1 if the argument names something
that was never opened with a redirection, or if there is
@@ -9535,7 +9538,7 @@ retval = close(command) # syntax error in many Unix awks
@end example
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @command{close()} function
@command{gawk} treats @code{close()} as a function.
The return value is @minus{}1 if the argument names something
that was never opened with a redirection, or if there is
@@ -9635,7 +9638,8 @@ have different forms, but are stored identically internally.
@node Scalar Constants
@subsubsection Numeric and String Constants
-@cindex numeric, constants
+@cindex constants, numeric
+@cindex numeric constants
A @dfn{numeric constant} stands for a number. This number can be an
integer, a decimal fraction, or a number in scientific (exponential)
notation.@footnote{The internal representation of all numbers,
@@ -9661,7 +9665,7 @@ double-quotation marks. For example:
@noindent
@cindex differences in @command{awk} and @command{gawk}, strings
-@cindex strings, length of
+@cindex strings, length limitations
represents the string whose contents are @samp{parrot}. Strings in
@command{gawk} can be of any length, and they can contain any of the possible
eight-bit ASCII characters including ASCII @sc{nul} (character code zero).
@@ -12249,6 +12253,8 @@ programmers.
@node Using BEGIN/END
@subsubsection Startup and Cleanup Actions
+@cindex @code{BEGIN} pattern
+@cindex @code{END} pattern
A @code{BEGIN} rule is executed once only, before the first input record
is read. Likewise, an @code{END} rule is executed once only, after all the
input is read. For example:
@@ -12392,7 +12398,7 @@ you can bypass the fatal error and move on to the next file on the
command line.
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @code{BEGINFILE} pattern
@cindex @code{nextfile} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and
You do this by checking if the @code{ERRNO} variable is not the empty
string; if so, then @command{gawk} was not able to open the file. In
@@ -13501,8 +13507,8 @@ is to simply say @samp{FS = FS}, perhaps with an explanatory comment.
@cindex @command{gawk}, @code{IGNORECASE} variable in
@cindex @code{IGNORECASE} variable
@cindex differences in @command{awk} and @command{gawk}, @code{IGNORECASE} variable
-@cindex case sensitivity, string comparisons and
-@cindex case sensitivity, regexps and
+@cindex case sensitivity, and string comparisons
+@cindex case sensitivity, and regexps
@cindex regular expressions, case sensitivity
@item IGNORECASE #
If @code{IGNORECASE} is nonzero or non-null, then all string comparisons
@@ -13719,7 +13725,7 @@ or if @command{gawk} is in compatibility mode
it is not special.
@cindex @code{ENVIRON} array
-@cindex environment variables
+@cindex environment variables, in @code{ENVIRON} array
@item ENVIRON
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
@@ -13834,10 +13840,12 @@ The following elements (listed alphabetically)
are guaranteed to be available:
@table @code
+@cindex effective group id of @command{gawk} user
@item PROCINFO["egid"]
The value of the @code{getegid()} system call.
@item PROCINFO["euid"]
+@cindex effective user id of @command{gawk} user
The value of the @code{geteuid()} system call.
@item PROCINFO["FS"]
@@ -13847,6 +13855,7 @@ This is
or @code{"FPAT"} if field matching with @code{FPAT} is in effect.
@item PROCINFO["identifiers"]
+@cindex program identifiers
A subarray, indexed by the names of all identifiers used in the
text of the AWK program. For each identifier, the value of the element is one of the following:
@@ -13875,15 +13884,19 @@ after it has finished parsing the program; they are @emph{not} updated
while the program runs.
@item PROCINFO["gid"]
+@cindex group id of @command{gawk} user
The value of the @code{getgid()} system call.
@item PROCINFO["pgrpid"]
+@cindex process group id of @command{gawk} process
The process group ID of the current process.
@item PROCINFO["pid"]
+@cindex process id of @command{gawk} process
The process ID of the current process.
@item PROCINFO["ppid"]
+@cindex parent process id of @command{gawk} process
The parent process ID of the current process.
@item PROCINFO["sorted_in"]
@@ -13903,25 +13916,31 @@ Assigning a new value to this element changes the default.
The value of the @code{getuid()} system call.
@item PROCINFO["version"]
+@cindex version of @command{gawk}
+@cindex @command{gawk} version
The version of @command{gawk}.
@end table
The following additional elements in the array
are available to provide information about the MPFR and GMP libraries
if your version of @command{gawk} supports arbitrary precision numbers
-(@pxref{Arbitrary Precision Arithmetic}):
+(@pxref{Gawk and MPFR}):
@table @code
+@cindex version of GNU MPFR library
@item PROCINFO["mpfr_version"]
The version of the GNU MPFR library.
@item PROCINFO["gmp_version"]
+@cindex version of GNU MP library
The version of the GNU MP library.
@item PROCINFO["prec_max"]
+@cindex maximum precision supported by MPFR library
The maximum precision supported by MPFR.
@item PROCINFO["prec_min"]
+@cindex minimum precision supported by MPFR library
The minimum precision required by MPFR.
@end table
@@ -13932,12 +13951,15 @@ of @command{gawk} supports dynamic loading of extension functions
@table @code
@item PROCINFO["api_major"]
+@cindex version of @command{gawk} extension API
+@cindex extension API, version number
The major version of the extension API.
@item PROCINFO["api_minor"]
The minor version of the extension API.
@end table
+@cindex supplementary groups of @command{gawk} process
On some systems, there may be elements in the array, @code{"group1"}
through @code{"group@var{N}"} for some @var{N}. @var{N} is the number of
supplementary groups that the process has. Use the @code{in} operator
@@ -13945,7 +13967,7 @@ to test for these elements
(@pxref{Reference to Elements}).
@cindex @command{gawk}, @code{PROCINFO} array in
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, uses
The @code{PROCINFO} array has the following additional uses:
@itemize @bullet
@@ -14131,7 +14153,7 @@ changed.
@node ARGC and ARGV
@subsection Using @code{ARGC} and @code{ARGV}
-@cindex @code{ARGC}/@code{ARGV} variables
+@cindex @code{ARGC}/@code{ARGV} variables, how to use
@cindex arguments, command-line
@cindex command line, arguments
@@ -14276,7 +14298,7 @@ ability to support true multidimensional arrays.
@cindex variables, names of
@cindex functions, names of
-@cindex arrays, names of
+@cindex arrays, names of, and names of functions/variables
@cindex names, arrays/variables
@cindex namespace issues
@command{awk} maintains a single set
@@ -14452,10 +14474,9 @@ Here, the number @code{1} isn't double-quoted, since @command{awk}
automatically converts it to a string.
@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
@cindex case sensitivity, array indices and
-@cindex arrays, @code{IGNORECASE} variable and
-@cindex @code{IGNORECASE} variable, array subscripts and
+@cindex arrays, and @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, and array indices
The value of @code{IGNORECASE} has no effect upon array subscripting.
The identical string value used to store an array element must be used
to retrieve it.
@@ -14471,8 +14492,9 @@ is independent of the number of elements in the array.
@node Reference to Elements
@subsection Referring to an Array Element
-@cindex arrays, elements, referencing
-@cindex elements in arrays
+@cindex arrays, referencing elements
+@cindex array members
+@cindex elements of arrays
The principal way to use an array is to refer to one of its elements.
An array reference is an expression as follows:
@@ -14489,11 +14511,16 @@ The value of the array reference is the current value of that array
element. For example, @code{foo[4.3]} is an expression for the element
of array @code{foo} at index @samp{4.3}.
+@cindex arrays, unassigned elements
+@cindex unassigned array elements
+@cindex empty array elements
A reference to an array element that has no recorded value yields a value of
@code{""}, the null string. This includes elements
that have not been assigned any value as well as elements that have been
deleted (@pxref{Delete}).
+@cindex non-existent array elements
+@cindex arrays, elements that don't exist
@quotation NOTE
A reference to an element that does not exist @emph{automatically} creates
that array element, with the null string as its value. (In some cases,
@@ -14513,7 +14540,7 @@ if it didn't exist before!
@end quotation
@c @cindex arrays, @code{in} operator and
-@cindex @code{in} operator
+@cindex @code{in} operator, testing if array element exists
To determine whether an element exists in an array at a certain index, use
the following expression:
@@ -14548,8 +14575,8 @@ if (frequencies[2] != "")
@node Assigning Elements
@subsection Assigning Array Elements
-@cindex arrays, elements, assigning
-@cindex elements in arrays, assigning
+@cindex arrays, elements, assigning values
+@cindex elements in arrays, assigning values
Array elements can be assigned values just like
@command{awk} variables:
@@ -14566,6 +14593,7 @@ assign to that element of the array.
@node Array Example
@subsection Basic Array Example
+@cindex arrays, an example of using
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
@@ -14635,6 +14663,7 @@ END @{
@node Scanning an Array
@subsection Scanning All Elements of an Array
@cindex elements in arrays, scanning
+@cindex scanning arrays
@cindex arrays, scanning
@cindex loops, @code{for}, array scanning
@@ -14653,7 +14682,7 @@ for (@var{var} in @var{array})
@end example
@noindent
-@cindex @code{in} operator
+@cindex @code{in} operator, use in loops
This loop executes @var{body} once for each index in @var{array} that the
program has previously used, with the variable @var{var} set to that index.
@@ -14692,8 +14721,9 @@ END @{
@xref{Word Sorting},
for a more detailed example of this type.
-@cindex arrays, elements, order of
-@cindex elements in arrays, order of
+@cindex arrays, elements, order of access by @code{in} operator
+@cindex elements in arrays, order of access by @code{in} operator
+@cindex @code{in} operator, order of array access
The order in which elements of the array are accessed by this statement
is determined by the internal arrangement of the array elements within
@command{awk} and normally cannot be controlled or changed. This can lead to
@@ -14711,6 +14741,8 @@ determines the order in which the array is traversed.
This order is usually based on the internal implementation of arrays
and will vary from one version of @command{awk} to the next.
+@cindex array scanning order, controlling
+@cindex controlling array scanning order
Often, though, you may wish to do something simple, such as
``traverse the array by comparing the indices in ascending order,''
or ``traverse the array by comparing the values in descending order.''
@@ -14727,6 +14759,7 @@ to use for comparison of array elements. This advanced feature
is described later, in @ref{Array Sorting}.
@end itemize
+@cindex @code{PROCINFO}, values of @code{sorted_in}
The following special values for @code{PROCINFO["sorted_in"]} are available:
@table @code
@@ -14887,7 +14920,7 @@ if (4 in foo)
print "This will never be printed"
@end example
-@cindex null strings, array elements and
+@cindex null strings, and deleting array elements
It is important to note that deleting an element is @emph{not} the
same as assigning it a null value (the empty string, @code{""}).
For example:
@@ -14909,6 +14942,7 @@ is not in the array is deleted.
@cindex extensions, common@comma{} @code{delete} to delete entire arrays
@cindex arrays, deleting entire contents
@cindex deleting entire arrays
+@cindex @code{delete} @var{array}
@cindex differences in @command{awk} and @command{gawk}, array elements, deleting
All the elements of an array may be deleted with a single statement
by leaving off the subscript in the @code{delete} statement,
@@ -14966,9 +15000,9 @@ a = 3
@section Using Numbers to Subscript Arrays
@cindex numbers, as array subscripts
-@cindex arrays, subscripts
+@cindex arrays, numeric subscripts
@cindex subscripts in arrays, numbers as
-@cindex @code{CONVFMT} variable, array subscripts and
+@cindex @code{CONVFMT} variable, and array subscripts
An important aspect to remember about arrays is that @emph{array subscripts
are always strings}. When a numeric value is used as a subscript,
it is converted to a string value before being used for subscripting
@@ -14998,7 +15032,8 @@ string value from @code{xyz}---this time @code{"12.15"}---because the value of
@code{CONVFMT} only allows two significant digits. This test fails,
since @code{"12.15"} is different from @code{"12.153"}.
-@cindex converting, during subscripting
+@cindex converting integer array subscripts
+@cindex integer array indices
According to the rules for conversions
(@pxref{Conversion}), integer
values are always converted to strings as integers, no matter what the
@@ -15104,7 +15139,7 @@ languages, including @command{awk}) to refer to an element of a
two-dimensional array named @code{grid} is with
@code{grid[@var{x},@var{y}]}.
-@cindex @code{SUBSEP} variable, multidimensional arrays
+@cindex @code{SUBSEP} variable, and multidimensional arrays
Multidimensional arrays are supported in @command{awk} through
concatenation of indices into one string.
@command{awk} converts the indices into strings
@@ -15136,6 +15171,7 @@ combined strings that are ambiguous. Suppose that @code{SUBSEP} is
"b@@c"]}} are indistinguishable because both are actually
stored as @samp{foo["a@@b@@c"]}.
+@cindex @code{in} operator, index existence in multidimensional arrays
To test whether a particular index sequence exists in a
multidimensional array, use the same operator (@code{in}) that is
used for single dimensional arrays. Write the whole sequence of indices
@@ -15201,6 +15237,7 @@ multidimensional @emph{way of accessing} an array.
@cindex subscripts in arrays, multidimensional, scanning
@cindex arrays, multidimensional, scanning
+@cindex scanning multidimensional arrays
However, if your program has an array that is always accessed as
multidimensional, you can get the effect of scanning it by combining
the scanning @code{for} statement
@@ -15242,6 +15279,7 @@ separate indices is recovered.
@node Arrays of Arrays
@section Arrays of Arrays
+@cindex arrays of arrays
@command{gawk} goes beyond standard @command{awk}'s multidimensional
array access and provides true arrays of
@@ -15501,6 +15539,7 @@ two arguments 11 and 10.
@node Numeric Functions
@subsection Numeric Functions
+@cindex numeric functions
The following list describes all of
the built-in functions that work with numbers.
@@ -15509,21 +15548,25 @@ Optional parameters are enclosed in square brackets@w{ ([ ]):}
@table @code
@item atan2(@var{y}, @var{x})
@cindex @code{atan2()} function
+@cindex arctangent
Return the arctangent of @code{@var{y} / @var{x}} in radians.
You can use @samp{pi = atan2(0, -1)} to retrieve the value of @value{PI}.
@item cos(@var{x})
@cindex @code{cos()} function
+@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
@item exp(@var{x})
@cindex @code{exp()} function
+@cindex exponent
Return the exponential of @var{x} (@code{e ^ @var{x}}) or report
an error if @var{x} is out of range. The range of values @var{x} can have
depends on your machine's floating-point representation.
@item int(@var{x})
@cindex @code{int()} function
+@cindex round to nearest integer
Return the nearest integer to @var{x}, located between @var{x} and zero and
truncated toward zero.
@@ -15532,6 +15575,7 @@ is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
@item log(@var{x})
@cindex @code{log()} function
+@cindex logarithm
Return the natural logarithm of @var{x}, if @var{x} is positive;
otherwise, report an error.
@@ -15578,7 +15622,7 @@ function roll(n) @{ return 1 + int(rand() * n) @}
@}
@end example
-@cindex numbers, random
+@cindex seeding random number generator
@cindex random numbers, seed of
@quotation CAUTION
In most @command{awk} implementations, including @command{gawk},
@@ -15595,10 +15639,12 @@ use @code{srand()}.
@item sin(@var{x})
@cindex @code{sin()} function
+@cindex sine
Return the sine of @var{x}, with @var{x} in radians.
@item sqrt(@var{x})
@cindex @code{sqrt()} function
+@cindex square root
Return the positive square root of @var{x}.
@command{gawk} prints a warning message
if @var{x} is negative. Thus, @code{sqrt(4)} is 2.
@@ -15634,6 +15680,7 @@ sequences of random numbers.
@node String Functions
@subsection String-Manipulation Functions
+@cindex string-manipulation functions
The functions in this @value{SECTION} look at or change the text of one
or more strings.
@@ -15663,10 +15710,10 @@ pound sign@w{ (@samp{#}):}
@item asort(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) #
@itemx asorti(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) #
@cindex @code{asorti()} function (@command{gawk})
+@cindex sort array
@cindex arrays, elements, retrieving number of
@cindex @code{asort()} function (@command{gawk})
-@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
+@cindex sort array indices
These two functions are similar in behavior, so they are described
together.
@@ -15684,7 +15731,9 @@ sequential integers starting with one. If the optional array @var{dest}
is specified, then @var{source} is duplicated into @var{dest}. @var{dest}
is then sorted, leaving the indices of @var{source} unchanged.
-When comparing strings, @code{IGNORECASE} affects the sorting. If the
+@cindex @command{gawk}, @code{IGNORECASE} variable in
+When comparing strings, @code{IGNORECASE} affects the sorting
+(@pxref{Array Sorting Functions}). If the
@var{source} array contains subarrays as values (@pxref{Arrays of
Arrays}), they will come last, after all scalar values.
@@ -15728,6 +15777,8 @@ are not available in compatibility mode (@pxref{Options}).
@item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) #
@cindex @code{gensub()} function (@command{gawk})
+@cindex search and replace in strings
+@cindex substitute in string
Search the target string @var{target} for matches of the regular
expression @var{regexp}. If @var{how} is a string beginning with
@samp{g} or @samp{G} (short for ``global''), then replace all matches of @var{regexp} with
@@ -15736,7 +15787,7 @@ which match of @var{regexp} to replace. If no @var{target} is supplied,
use @code{$0}. It returns the modified string as the result
of the function and the original target string is @emph{not} changed.
-@code{gensub()} is a general substitution function. It's purpose is
+@code{gensub()} is a general substitution function. Its purpose is
to provide more features than the standard @code{sub()} and @code{gsub()}
functions.
@@ -15813,7 +15864,8 @@ and the third argument must be assignable.
@item index(@var{in}, @var{find})
@cindex @code{index()} function
-@cindex searching
+@cindex search in string
+@cindex find substring in string
Search the string @var{in} for the first occurrence of the string
@var{find}, and return the position in characters where that occurrence
begins in the string @var{in}. Consider the following example:
@@ -15831,6 +15883,8 @@ It is a fatal error to use a regexp constant for @var{find}.
@item length(@r{[}@var{string}@r{]})
@cindex @code{length()} function
+@cindex string length
+@cindex length of string
Return the number of characters in @var{string}. If
@var{string} is a number, the length of the digit string representing
that number is returned. For example, @code{length("abcde")} is five. By
@@ -15838,6 +15892,8 @@ contrast, @code{length(15 * 35)} works out to three. In this example, 15 * 35 =
525, and 525 is then converted to the string @code{"525"}, which has
three characters.
+@cindex length of input record
+@cindex input record, length of
If no argument is supplied, @code{length()} returns the length of @code{$0}.
@c @cindex historical features
@@ -15876,6 +15932,8 @@ warning about this.
@cindex common extensions, @code{length()} applied to an array
@cindex extensions, common@comma{} @code{length()} applied to an array
@cindex differences between @command{gawk} and @command{awk}
+@cindex number of array elements
+@cindex array, number of elements
With @command{gawk} and several other @command{awk} implementations, when given an
array argument, the @code{length()} function returns the number of elements
in the array. @value{COMMONEXT}
@@ -15890,6 +15948,8 @@ If @option{--posix} is supplied, using an array argument is a fatal error
@item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]})
@cindex @code{match()} function
+@cindex string, regular expression match
+@cindex match regexp in string
Search @var{string} for the
longest, leftmost substring matched by the regular expression,
@var{regexp} and return the character position, or @dfn{index},
@@ -16005,6 +16065,7 @@ using a third argument is a fatal error.
@item patsplit(@var{string}, @var{array} @r{[}, @var{fieldpat} @r{[}, @var{seps} @r{]} @r{]}) #
@cindex @code{patsplit()} function (@command{gawk})
+@cindex split string into array
Divide
@var{string} into pieces defined by @var{fieldpat}
and store the pieces in @var{array} and the separator strings in the
@@ -16064,7 +16125,7 @@ split("cul-de-sac", a, "-", seps)
@end example
@noindent
-@cindex strings, splitting
+@cindex strings splitting, example
splits the string @samp{cul-de-sac} into three fields using @samp{-} as the
separator. It sets the contents of the array @code{a} as follows:
@@ -16121,6 +16182,7 @@ If @var{string} does not match @var{fieldsep} at all (but is not null),
@item sprintf(@var{format}, @var{expression1}, @dots{})
@cindex @code{sprintf()} function
+@cindex formatting strings
Return (without printing) the string that @code{printf} would
have printed out with the same arguments
(@pxref{Printf}).
@@ -16134,6 +16196,7 @@ pival = sprintf("pi = %.2f (approx.)", 22/7)
assigns the string @w{@samp{pi = 3.14 (approx.)}} to the variable @code{pival}.
@cindex @code{strtonum()} function (@command{gawk})
+@cindex convert string to number
@item strtonum(@var{str}) #
Examine @var{str} and return its numeric value. If @var{str}
begins with a leading @samp{0}, @code{strtonum()} assumes that @var{str}
@@ -16161,6 +16224,7 @@ in compatibility mode (@pxref{Options}).
@item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]})
@cindex @code{sub()} function
+@cindex replace in string
Search @var{target}, which is treated as a string, for the
leftmost, longest substring matched by the regular expression @var{regexp}.
Modify the entire string
@@ -16261,6 +16325,7 @@ string, and then the value of that string is treated as the regexp to match.
@item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]})
@cindex @code{substr()} function
+@cindex substring
Return a @var{length}-character-long substring of @var{string},
starting at character number @var{start}. The first character of a
string is character number one.@footnote{This is different from
@@ -16317,9 +16382,10 @@ string = substr(string, 1, 2) "CDE" substr(string, 6)
@end example
@cindex case sensitivity, converting case
-@cindex converting, case
+@cindex strings, converting letter case
@item tolower(@var{string})
@cindex @code{tolower()} function
+@cindex convert string to lower case
Return a copy of @var{string}, with each uppercase character
in the string replaced with its corresponding lowercase character.
Nonalphabetic characters are left unchanged. For example,
@@ -16327,6 +16393,7 @@ Nonalphabetic characters are left unchanged. For example,
@item toupper(@var{string})
@cindex @code{toupper()} function
+@cindex convert string to upper case
Return a copy of @var{string}, with each lowercase character
in the string replaced with its corresponding uppercase character.
Nonalphabetic characters are left unchanged. For example,
@@ -16752,6 +16819,7 @@ Although this makes a certain amount of sense, it can be surprising.
@node I/O Functions
@subsection Input/Output Functions
+@cindex input/output functions
The following functions relate to input/output (I/O).
Optional parameters are enclosed in square brackets ([ ]):
@@ -16760,6 +16828,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@item close(@var{filename} @r{[}, @var{how}@r{]})
@cindex @code{close()} function
@cindex files, closing
+@cindex close file or coprocess
Close the file @var{filename} for input or output. Alternatively, the
argument may be a shell command that was used for creating a coprocess, or
for redirecting to or from a pipe; then the coprocess or pipe is closed.
@@ -16777,6 +16846,7 @@ which discusses this feature in more detail and gives an example.
@item fflush(@r{[}@var{filename}@r{]})
@cindex @code{fflush()} function
+@cindex flush buffered output
Flush any buffered output associated with @var{filename}, which is either a
file opened for writing or a shell command for redirecting output to
a pipe or coprocess.
@@ -16836,6 +16906,7 @@ In such a case, @code{fflush()} returns @minus{}1, as well.
@item system(@var{command})
@cindex @code{system()} function
+@cindex invoke shell command
@cindex interacting with other programs
Execute the operating-system
command @var{command} and then return to the @command{awk} program.
@@ -17110,6 +17181,7 @@ you would see the latter (undesirable) output.
@node Time Functions
@subsection Time Functions
+@cindex time functions
@c STARTOFRANGE tst
@cindex timestamps
@@ -17149,6 +17221,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@table @code
@item mktime(@var{datespec})
@cindex @code{mktime()} function (@command{gawk})
+@cindex generate time values
Turn @var{datespec} into a timestamp in the same form
as is returned by @code{systime()}. It is similar to the function of the
same name in ISO C. The argument, @var{datespec}, is a string of the form
@@ -17179,6 +17252,7 @@ is out of range, @code{mktime()} returns @minus{}1.
@item strftime(@r{[}@var{format} @r{[}, @var{timestamp} @r{[}, @var{utc-flag}@r{]]]})
@c STARTOFRANGE strf
@cindex @code{strftime()} function (@command{gawk})
+@cindex format time string
Format the time specified by @var{timestamp}
based on the contents of the @var{format} string and return the result.
It is similar to the function of the same name in ISO C.
@@ -17200,6 +17274,7 @@ change the default format.
@item systime()
@cindex @code{systime()} function (@command{gawk})
@cindex timestamps
+@cindex current system time
Return the current time as the number of seconds since
the system epoch. On POSIX systems, this is the number of seconds
since 1970-01-01 00:00:00 UTC, not counting leap seconds.
@@ -17493,6 +17568,7 @@ gawk 'BEGIN @{
@node Bitwise Functions
@subsection Bit-Manipulation Functions
+@cindex bit-manipulation functions
@c STARTOFRANGE bit
@cindex bitwise, operations
@c STARTOFRANGE and
@@ -17656,26 +17732,32 @@ bitwise operations just described. They are:
@cindex @command{gawk}, bitwise operations in
@table @code
@cindex @code{and()} function (@command{gawk})
+@cindex bitwise AND
@item and(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise AND of the arguments. There must be at least two.
@cindex @code{compl()} function (@command{gawk})
+@cindex bitwise complement
@item compl(@var{val})
Return the bitwise complement of @var{val}.
@cindex @code{lshift()} function (@command{gawk})
+@cindex left shift
@item lshift(@var{val}, @var{count})
Return the value of @var{val}, shifted left by @var{count} bits.
@cindex @code{or()} function (@command{gawk})
+@cindex bitwise OR
@item or(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise OR of the arguments. There must be at least two.
@cindex @code{rshift()} function (@command{gawk})
+@cindex right shift
@item rshift(@var{val}, @var{count})
Return the value of @var{val}, shifted right by @var{count} bits.
@cindex @code{xor()} function (@command{gawk})
+@cindex bitwise XOR
@item xor(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise XOR of the arguments. There must be at least two.
@end table
@@ -17767,6 +17849,7 @@ $ @kbd{gawk -f testbits.awk}
@cindex strings, converting
@cindex numbers, converting
@cindex converting, numbers to strings
+@cindex number as string of bits
The @code{bits2str()} function turns a binary number into a string.
The number @code{1} represents a binary value where the rightmost bit
is set to 1. Using this mask,
@@ -17803,6 +17886,7 @@ that traverses every element of a true multidimensional array
@table @code
@cindex @code{isarray()} function (@command{gawk})
+@cindex scalar or array
@item isarray(@var{x})
Return a true value if @var{x} is an array. Otherwise return false.
@end table
@@ -17824,6 +17908,7 @@ will end up turning it into a scalar.
@subsection String-Translation Functions
@cindex @command{gawk}, string-translation functions
@cindex functions, string-translation
+@cindex string-translation functions
@cindex internationalization
@cindex @command{awk} programs, internationalizing
@@ -17836,6 +17921,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@table @code
@cindex @code{bindtextdomain()} function (@command{gawk})
+@cindex set directory of message catalogs
@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]})
Set the directory in which
@command{gawk} will look for message translation files, in case they
@@ -17849,6 +17935,7 @@ If @var{directory} is the null string (@code{""}), then
given @var{domain}.
@cindex @code{dcgettext()} function (@command{gawk})
+@cindex translate string
@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
Return the translation of @var{string} in
text domain @var{domain} for locale category @var{category}.
@@ -17872,7 +17959,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}.
@section User-Defined Functions
@c STARTOFRANGE udfunc
-@cindex user-defined, functions
+@cindex user-defined functions
@c STARTOFRANGE funcud
@cindex functions, user-defined
Complicated @command{awk} programs can often be simplified by defining
@@ -17958,6 +18045,7 @@ conventional to place some extra space between the arguments and
the local variables, in order to document how your function is supposed to be used.
@cindex variables, shadowing
+@cindex shadowing of variable values
During execution of the function body, the arguments and local variable
values hide, or @dfn{shadow}, any variables of the same names used in the
rest of the program. The shadowed variables are not accessible in the
@@ -18016,6 +18104,7 @@ keyword @code{function} when defining a function.
@node Function Example
@subsection Function Definition Examples
+@cindex function definition example
Here is an example of a user-defined function, called @code{myprint()}, that
takes a number and prints it in a specific format:
@@ -18164,8 +18253,8 @@ an error.
@node Variable Scope
@subsubsection Controlling Variable Scope
-@cindex local variables
-@cindex variables, local
+@cindex local variables, in a function
+@cindex variables, local to a function
There is no way to make a variable local to a @code{@{ @dots{} @}} block in
@command{awk}, but you can make a variable local to a function. It is
good practice to do so whenever a variable is needed only in that
@@ -19094,7 +19183,7 @@ The leading capital letter indicates that it is global, while the fact that
the variable name is not all capital letters indicates that the variable is
not one of @command{awk}'s built-in variables, such as @code{FS}.
-@cindex @option{--dump-variables} option
+@cindex @option{--dump-variables} option, using for library functions
It is also important that @emph{all} variables in library
functions that do not need to save state are, in fact, declared
local.@footnote{@command{gawk}'s @option{--dump-variables} command-line
@@ -20911,7 +21000,7 @@ from anywhere within a user's program, and the user may have his
or her
own way of splitting records and fields.
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, testing the field splitting
The @code{using_fw} variable checks @code{PROCINFO["FS"]}, which
is @code{"FIELDWIDTHS"} if field splitting is being done with
@code{FIELDWIDTHS}. This makes it possible to restore the correct
@@ -21034,7 +21123,7 @@ uses these functions.
@cindex group database, reading
@c STARTOFRANGE datagr
@cindex database, group, reading
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and group membership
@cindex @code{getgrent()} function (C library)
@cindex @code{getgrent()} user-defined function
@cindex groups@comma{} information about
@@ -22213,7 +22302,7 @@ $ @kbd{id}
@print{} uid=500(arnold) gid=500(arnold) groups=6(disk),7(lp),19(floppy)
@end example
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and user and group ID numbers
This information is part of what is provided by @command{gawk}'s
@code{PROCINFO} array (@pxref{Built-in Variables}).
However, the @command{id} utility provides a more palatable output than just
@@ -22314,7 +22403,6 @@ BEGIN \
@c endfile
@end example
-@cindex @code{in} operator
The test in the @code{for} loop is worth noting.
Any supplementary groups in the @code{PROCINFO} array have the
indices @code{"group1"} through @code{"group@var{N}"} for some
@@ -22324,7 +22412,7 @@ there are.
This loop works by starting at one, concatenating the value with
@code{"group"}, and then using @code{in} to see if that value is
-in the array. Eventually, @code{i} is incremented past
+in the array (@pxref{Reference to Elements}). Eventually, @code{i} is incremented past
the last group in the array and the loop exits.
The loop is also correct if there are @emph{no} supplementary
@@ -25533,9 +25621,8 @@ both arrays use the values.
@c Document It And Call It A Feature. Sigh.
@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
-@cindex arrays, sorting, @code{IGNORECASE} variable and
-@cindex @code{IGNORECASE} variable, array sorting and
+@cindex arrays, sorting, and @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, and array sorting functions
Because @code{IGNORECASE} affects string comparisons, the value
of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}.
Note also that the locale's sorting order does @emph{not}
@@ -25704,7 +25791,7 @@ As a side note, the assignment @samp{LC_ALL=C} in the @command{sort}
command ensures traditional Unix (ASCII) sorting from @command{sort}.
@cindex @command{gawk}, @code{PROCINFO} array in
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and communications via ptys
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 basis, by setting a special element
@@ -25907,8 +25994,8 @@ Here is the @file{awkprof.out} that results from running the
illustrates that @command{awk} programmers sometimes get up very early
in the morning to work.)
-@cindex @code{BEGIN} pattern
-@cindex @code{END} pattern
+@cindex @code{BEGIN} pattern, and profiling
+@cindex @code{END} pattern, and profiling
@example
# gawk profile, created Thu Feb 27 05:16:21 2014
@@ -25972,7 +26059,7 @@ Multiple @code{BEGIN} and @code{END} rules retain their
separate identities, as do
multiple @code{BEGINFILE} and @code{ENDFILE} rules.
-@cindex patterns, counts
+@cindex patterns, counts, in a profile
@item
Pattern-action rules have two counts.
The first count, to the left of the rule, shows how many times
@@ -25992,7 +26079,7 @@ is a count showing how many times the condition was true.
The count for the @code{else}
indicates how many times the test failed.
-@cindex loops, count for header
+@cindex loops, count for header, in a profile
@item
The count for a loop header (such as @code{for}
or @code{while}) shows how many times the loop test was executed.
@@ -26000,8 +26087,8 @@ or @code{while}) shows how many times the loop test was executed.
statement in a rule to determine how many times the rule was executed.
If the first statement is a loop, the count is misleading.)
-@cindex functions, user-defined, counts
-@cindex user-defined, functions, counts
+@cindex functions, user-defined, counts, in a profile
+@cindex user-defined, functions, counts, in a profile
@item
For user-defined functions, the count next to the @code{function}
keyword indicates how many times the function was called.
@@ -26015,8 +26102,8 @@ The layout uses ``K&R'' style with TABs.
Braces are used everywhere, even when
the body of an @code{if}, @code{else}, or loop is only a single statement.
-@cindex @code{()} (parentheses)
-@cindex parentheses @code{()}
+@cindex @code{()} (parentheses), in a profile
+@cindex parentheses @code{()}, in a profile
@item
Parentheses are used only where needed, as indicated by the structure
of the program and the precedence rules.
@@ -26072,6 +26159,7 @@ which is correct, but possibly surprising.
@cindex profiling @command{awk} programs, dynamically
@cindex @command{gawk} program, dynamic profiling
+@cindex dynamic profiling
Besides creating profiles when a program has completed,
@command{gawk} can produce a profile while it is running.
This is useful if your @command{awk} program goes into an
@@ -26085,9 +26173,9 @@ $ @kbd{gawk --profile -f myprog &}
@end example
@cindex @command{kill} command@comma{} dynamic profiling
-@cindex @code{USR1} signal
-@cindex @code{SIGUSR1} signal
-@cindex signals, @code{USR1}/@code{SIGUSR1}
+@cindex @code{USR1} signal, for dynamic profiling
+@cindex @code{SIGUSR1} signal, for dynamic profiling
+@cindex signals, @code{USR1}/@code{SIGUSR1}, for profiling
@noindent
The shell prints a job number and process ID number; in this case, 13992.
Use the @command{kill} command to send the @code{USR1} signal
@@ -26118,9 +26206,9 @@ You may send @command{gawk} the @code{USR1} signal as many times as you like.
Each time, the profile and function call trace are appended to the output
profile file.
-@cindex @code{HUP} signal
-@cindex @code{SIGHUP} signal
-@cindex signals, @code{HUP}/@code{SIGHUP}
+@cindex @code{HUP} signal, for dynamic profiling
+@cindex @code{SIGHUP} signal, for dynamic profiling
+@cindex signals, @code{HUP}/@code{SIGHUP}, for profiling
If you use the @code{HUP} signal instead of the @code{USR1} signal,
@command{gawk} produces the profile and the function call trace and then exits.
@@ -27034,6 +27122,7 @@ The following list defines terms used throughout the rest of
this @value{CHAPTER}.
@table @dfn
+@cindex stack frame
@item Stack Frame
Programs generally call functions during the course of their execution.
One function can call another, or a function can call itself (recursion).
@@ -27055,6 +27144,7 @@ invoked. Commands that print the call stack print information about
each stack frame (as detailed later on).
@item Breakpoint
+@cindex breakpoint
During debugging, you often wish to let the program run until it
reaches a certain point, and then continue execution from there one
statement (or instruction) at a time. The way to do this is to set
@@ -27064,6 +27154,7 @@ take over control of the program's execution. You can add and remove
as many breakpoints as you like.
@item Watchpoint
+@cindex watchpoint
A watchpoint is similar to a breakpoint. The difference is that
breakpoints are oriented around the code: stop when a certain point in the
code is reached. A watchpoint, however, specifies that program execution
@@ -27095,6 +27186,7 @@ by the higher-level @command{awk} commands.
@node Sample Debugging Session
@section Sample Debugging Session
+@cindex sample debugging session
In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample
debugging session. We will use the @command{awk} implementation of the
@@ -27108,6 +27200,8 @@ as our example.
@node Debugger Invocation
@subsection How to Start the Debugger
+@cindex starting the debugger
+@cindex debugger, how to start
Starting the debugger is almost exactly like running @command{gawk},
except you have to pass an additional option @option{--debug} or the
@@ -27448,6 +27542,8 @@ controlling breakpoints are:
@cindex debugger commands, @code{break}
@cindex @code{break} debugger command
@cindex @code{b} debugger command (alias for @code{break})
+@cindex set breakpoint
+@cindex breakpoint, setting
@item @code{break} [[@var{filename}@code{:}]@var{n} | @var{function}] [@code{"@var{expression}"}]
@itemx @code{b} [[@var{filename}@code{:}]@var{n} | @var{function}] [@code{"@var{expression}"}]
Without any argument, set a breakpoint at the next instruction
@@ -27478,6 +27574,8 @@ it continues executing the program.
@cindex debugger commands, @code{clear}
@cindex @code{clear} debugger command
+@cindex delete breakpoint at location
+@cindex breakpoint at location, how to delete
@item @code{clear} [[@var{filename}@code{:}]@var{n} | @var{function}]
Without any argument, delete any breakpoint at the next instruction
to be executed in the selected stack frame. If the program stops at
@@ -27498,6 +27596,7 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex debugger commands, @code{condition}
@cindex @code{condition} debugger command
+@cindex breakpoint condition
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
condition is an @command{awk} expression that the debugger evaluates
@@ -27511,6 +27610,8 @@ watchpoint is made unconditional.
@cindex debugger commands, @code{delete}
@cindex @code{delete} debugger command
@cindex @code{d} debugger command (alias for @code{delete})
+@cindex delete breakpoint by number
+@cindex breakpoint, delete by number
@item @code{delete} [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
@itemx @code{d} [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
Delete specified breakpoints or a range of breakpoints. Deletes
@@ -27518,6 +27619,8 @@ all defined breakpoints if no argument is supplied.
@cindex debugger commands, @code{disable}
@cindex @code{disable} debugger command
+@cindex disable breakpoint
+@cindex breakpoint, how to disable or enable
@item @code{disable} [@var{n1 n2} @dots{} | @var{n}--@var{m}]
Disable specified breakpoints or a range of breakpoints. Without
any argument, disables all breakpoints.
@@ -27526,6 +27629,7 @@ any argument, disables all breakpoints.
@cindex debugger commands, @code{enable}
@cindex @code{enable} debugger command
@cindex @code{e} debugger command (alias for @code{enable})
+@cindex enable breakpoint
@item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
@itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
Enable specified breakpoints or a range of breakpoints. Without
@@ -27545,6 +27649,7 @@ the program stops at the breakpoint.
@cindex debugger commands, @code{ignore}
@cindex @code{ignore} debugger command
+@cindex ignore breakpoint
@item @code{ignore} @var{n} @var{count}
Ignore breakpoint number @var{n} the next @var{count} times it is
hit.
@@ -27553,6 +27658,7 @@ hit.
@cindex debugger commands, @code{tbreak}
@cindex @code{tbreak} debugger command
@cindex @code{t} debugger command (alias for @code{tbreak})
+@cindex temporary breakpoint
@item @code{tbreak} [[@var{filename}@code{:}]@var{n} | @var{function}]
@itemx @code{t} [[@var{filename}@code{:}]@var{n} | @var{function}]
Set a temporary breakpoint (enabled for only one stop).
@@ -27573,6 +27679,8 @@ execution of the program than we saw in our earlier example:
@cindex @code{silent} debugger command
@cindex debugger commands, @code{end}
@cindex @code{end} debugger command
+@cindex breakpoint commands
+@cindex commands to execute at breakpoint
@item @code{commands} [@var{n}]
@itemx @code{silent}
@itemx @dots{}
@@ -27600,6 +27708,7 @@ gawk>
@cindex debugger commands, @code{c} (@code{continue})
@cindex debugger commands, @code{continue}
+@cindex continue program, in debugger
@item @code{continue} [@var{count}]
@itemx @code{c} [@var{count}]
Resume program execution. If continued from a breakpoint and @var{count} is
@@ -27616,6 +27725,7 @@ Print the returned value.
@cindex debugger commands, @code{next}
@cindex @code{next} debugger command
@cindex @code{n} debugger command (alias for @code{next})
+@cindex single-step execution, in the debugger
@item @code{next} [@var{count}]
@itemx @code{n} [@var{count}]
Continue execution to the next source line, stepping over function calls.
@@ -27710,6 +27820,7 @@ items on the list.
@cindex debugger commands, @code{eval}
@cindex @code{eval} debugger command
+@cindex evaluate expressions, in debugger
@item @code{eval "@var{awk statements}"}
Evaluate @var{awk statements} in the context of the running program.
You can do anything that an @command{awk} program would do: assign
@@ -27727,6 +27838,7 @@ parameters defined by the program.
@cindex debugger commands, @code{print}
@cindex @code{print} debugger command
@cindex @code{p} debugger command (alias for @code{print})
+@cindex print variables, in debugger
@item @code{print} @var{var1}[@code{,} @var{var2} @dots{}]
@itemx @code{p} @var{var1}[@code{,} @var{var2} @dots{}]
Print the value of a @command{gawk} variable or field.
@@ -27760,6 +27872,7 @@ No newline is printed unless one is specified.
@cindex debugger commands, @code{set}
@cindex @code{set} debugger command
+@cindex assign values to variables, in debugger
@item @code{set} @var{var}@code{=}@var{value}
Assign a constant (number or string) value to an @command{awk} variable
or field.
@@ -27772,6 +27885,7 @@ You can also set special @command{awk} variables, such as @code{FS},
@cindex debugger commands, @code{watch}
@cindex @code{watch} debugger command
@cindex @code{w} debugger command (alias for @code{watch})
+@cindex set watchpoint
@item @code{watch} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
@itemx @code{w} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
Add variable @var{var} (or field @code{$@var{n}}) to the watch list.
@@ -27788,12 +27902,14 @@ then the debugger stops execution and prompts for a command. Otherwise,
@cindex debugger commands, @code{undisplay}
@cindex @code{undisplay} debugger command
+@cindex stop automatic display, in debugger
@item @code{undisplay} [@var{n}]
Remove item number @var{n} (or all items, if no argument) from the
automatic display list.
@cindex debugger commands, @code{unwatch}
@cindex @code{unwatch} debugger command
+@cindex delete watchpoint
@item @code{unwatch} [@var{n}]
Remove item number @var{n} (or all items, if no argument) from the
watch list.
@@ -27814,6 +27930,8 @@ functions which called the one you are in. The commands for doing this are:
@cindex debugger commands, @code{backtrace}
@cindex @code{backtrace} debugger command
@cindex @code{bt} debugger command (alias for @code{backtrace})
+@cindex call stack, display in debugger
+@cindex traceback, display in debugger
@item @code{backtrace} [@var{count}]
@itemx @code{bt} [@var{count}]
Print a backtrace of all function calls (stack frames), or innermost @var{count}
@@ -27867,25 +27985,32 @@ The value for @var{what} should be one of the following:
@c nested table
@table @code
@item args
+@cindex show function arguments, in debugger
Arguments of the selected frame.
@item break
+@cindex show breakpoints
List all currently set breakpoints.
@item display
+@cindex automatic displays, in debugger
List all items in the automatic display list.
@item frame
+@cindex describe call stack frame, in debugger
Description of the selected stack frame.
@item functions
+@cindex list function definitions, in debugger
List all function definitions including source file names and
line numbers.
@item locals
+@cindex show local variables, in debugger
Local variables of the selected frame.
@item source
+@cindex show name of current source file, in debugger
The name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
When the debugger first starts, the current source file is the first file
@@ -27894,12 +28019,15 @@ included via the @option{-f} option. The
be used at any time to change the current source.
@item sources
+@cindex show all source files, in debugger
List all program sources.
@item variables
+@cindex list all global variables, in debugger
List all global variables.
@item watch
+@cindex show watchpoints
List all items in the watch list.
@end table
@end table
@@ -27913,6 +28041,8 @@ from a file. The commands are:
@cindex debugger commands, @code{option}
@cindex @code{option} debugger command
@cindex @code{o} debugger command (alias for @code{option})
+@cindex display debugger options
+@cindex debugger options
@item @code{option} [@var{name}[@code{=}@var{value}]]
@itemx @code{o} [@var{name}[@code{=}@var{value}]]
Without an argument, display the available debugger options
@@ -27924,6 +28054,7 @@ The available options are:
@c nested table
@table @code
@item history_size
+@cindex debugger history size
The maximum number of lines to keep in the history file @file{./.gawk_history}.
The default is 100.
@@ -27931,23 +28062,28 @@ The default is 100.
The number of lines that @code{list} prints. The default is 15.
@item outfile
+@cindex redirect @command{gawk} output, in debugger
Send @command{gawk} output to a file; debugger output still goes
to standard output. An empty string (@code{""}) resets output to
standard output.
@item prompt
+@cindex debugger prompt
The debugger prompt. The default is @samp{@w{gawk> }}.
@item save_history @r{[}on @r{|} off@r{]}
+@cindex debugger history file
Save command history to file @file{./.gawk_history}.
The default is @code{on}.
@item save_options @r{[}on @r{|} off@r{]}
+@cindex save debugger options
Save current options to file @file{./.gawkrc} upon exit.
The default is @code{on}.
Options are read back in to the next session upon startup.
@item trace @r{[}on @r{|} off@r{]}
+@cindex instruction tracing, in debugger
Turn instruction tracing on or off. The default is @code{off}.
@end table
@@ -27956,6 +28092,7 @@ Save the commands from the current session to the given file name,
so that they can be replayed using the @command{source} command.
@item @code{source} @var{filename}
+@cindex debugger, read commands from a file
Run command(s) from a file; an error in any command does not
terminate execution of subsequent commands. Comments (lines starting
with @samp{#}) are allowed in a command file.
@@ -28088,6 +28225,7 @@ function @var{function}. This command may change the current source file.
@cindex debugger commands, @code{quit}
@cindex @code{quit} debugger command
@cindex @code{q} debugger command (alias for @code{quit})
+@cindex exit the debugger
@item @code{quit}
@itemx @code{q}
Exit the debugger. Debugging is great fun, but sometimes we all have
@@ -28111,6 +28249,8 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while
@node Readline Support
@section Readline Support
+@cindex command completion, in debugger
+@cindex history expansion, in debugger
If @command{gawk} is compiled with the @code{readline} library, you
can take advantage of that library's command completion and history expansion
@@ -28199,8 +28339,6 @@ be added, and of course feel free to try to add them yourself!
@cindex multiple precision
@cindex infinite precision
@cindex floating-point, numbers@comma{} arbitrary precision
-@cindex MPFR
-@cindex GMP
@cindex Knuth, Donald
@quotation
@@ -28964,6 +29102,8 @@ when you change the rounding mode.
@node Gawk and MPFR
@section @command{gawk} + MPFR = Powerful Arithmetic
+@cindex MPFR
+@cindex GMP
The rest of this @value{CHAPTER} describes how to use the arbitrary precision
(also known as @dfn{multiple precision} or @dfn{infinite precision}) numeric
@@ -29068,6 +29208,7 @@ your program.
@node Setting Precision
@subsection Setting the Working Precision
@cindex @code{PREC} variable
+@cindex setting working precision
@command{gawk} uses a global working precision; it does not keep track of
the precision or accuracy of individual numbers. Performing an arithmetic
@@ -29143,6 +29284,7 @@ issues that occur because numbers are stored internally in binary.
@node Setting Rounding Mode
@subsection Setting the Rounding Mode
@cindex @code{ROUNDMODE} variable
+@cindex setting rounding mode
The @code{ROUNDMODE} variable provides
program level control over the rounding mode.
@@ -29210,6 +29352,7 @@ In the first case, the number is stored with the default precision of 53 bits.
@node Changing Precision
@subsection Changing the Precision of a Number
+@cindex changing precision of a number
@cindex Laurie, Dirk
@quotation
@@ -29328,6 +29471,7 @@ the problem at hand is often the correct approach in such situations.
@node Arbitrary Precision Integers
@section Arbitrary Precision Integer Arithmetic with @command{gawk}
@cindex integers, arbitrary precision
+@cindex arbitrary precision integers
If one of the options @option{--bignum} or @option{-M} is specified,
@command{gawk} performs all
@@ -29424,6 +29568,7 @@ gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@node Dynamic Extensions
@chapter Writing Extensions for @command{gawk}
+@cindex dynamically loaded extensions
It is possible to add new functions written in C or C++ to @command{gawk} using
dynamically loaded libraries. This facility is available on systems
@@ -29458,6 +29603,7 @@ When @option{--sandbox} is specified, extensions are disabled
@node Extension Intro
@section Introduction
+@cindex plug-in
An @dfn{extension} (sometimes called a @dfn{plug-in}) is a piece of
external compiled code that @command{gawk} can load at runtime to
provide additional functionality, over and above the built-in capabilities
@@ -29586,6 +29732,7 @@ happen, but we all know how @emph{that} goes.)
@node Extension API Description
@section API Description
+@cindex extension API
This (rather large) @value{SECTION} describes the API in detail.
@@ -29970,6 +30117,8 @@ value type, as appropriate. This behavior is summarized in
@node Memory Allocation Functions
@subsection Memory Allocation Functions and Convenience Macros
+@cindex allocating memory for extensions
+@cindex extensions, allocating memory
The API provides a number of @dfn{memory allocation} functions for
allocating memory that can be passed to @command{gawk}, as well as a number of
@@ -30084,6 +30233,8 @@ pointed to by @code{result}.
@node Registration Functions
@subsection Registration Functions
+@cindex register extension
+@cindex extension registration
This @value{SECTION} describes the API functions for
registering parts of your extension with @command{gawk}.
@@ -30205,6 +30356,7 @@ is invoked with the @option{--version} option.
@node Input Parsers
@subsubsection Customized Input Parsers
+@cindex customized input parser
By default, @command{gawk} reads text files as its input. It uses the value
of @code{RS} to find the end of the record, and then uses @code{FS}
@@ -30452,7 +30604,9 @@ Register the input parser pointed to by @code{input_parser} with
@node Output Wrappers
@subsubsection Customized Output Wrappers
+@cindex customized output wrapper
+@cindex output wrapper
An @dfn{output wrapper} is the mirror image of an input parser.
It allows an extension to take over the output to a file opened
with the @samp{>} or @samp{>>} I/O redirection operators (@pxref{Redirection}).
@@ -30566,6 +30720,7 @@ Register the output wrapper pointed to by @code{output_wrapper} with
@node Two-way processors
@subsubsection Customized Two-way Processors
+@cindex customized two-way processor
A @dfn{two-way processor} combines an input parser and an output wrapper for
two-way I/O with the @samp{|&} operator (@pxref{Redirection}). It makes identical
@@ -30623,6 +30778,8 @@ Register the two-way processor pointed to by @code{two_way_processor} with
@node Printing Messages
@subsection Printing Messages
+@cindex printing messages from extensions
+@cindex messages from extensions
You can print different kinds of warning messages from your
extension, as described below. Note that for these functions,
@@ -30696,6 +30853,7 @@ for more information on creating arrays.
@node Symbol Table Access
@subsection Symbol Table Access
+@cindex accessing global variables from extensions
Two sets of routines provide access to global variables, and one set
allows you to create and release cached values.
@@ -30953,6 +31111,7 @@ you should release any cached values that you created, using
@node Array Manipulation
@subsection Array Manipulation
+@cindex array manipulation in extensions
The primary data structure@footnote{Okay, the only data structure.} in @command{awk}
is the associative array (@pxref{Arrays}).
@@ -31532,6 +31691,8 @@ information about how @command{gawk} was invoked.
@node Extension Versioning
@subsubsection API Version Constants and Variables
+@cindex API version
+@cindex extension API version
The API provides both a ``major'' and a ``minor'' version number.
The API versions are available at compile time as constants:
@@ -31585,6 +31746,8 @@ provided in @file{gawkapi.h} (discussed later, in
@node Extension API Informational Variables
@subsubsection Informational Variables
+@cindex API informational variables
+@cindex extension API informational variables
The API provides access to several variables that describe
whether the corresponding command-line options were enabled when
@@ -31730,6 +31893,8 @@ the version string with @command{gawk}.
@node Finding Extensions
@section How @command{gawk} Finds Extensions
+@cindex extension search path
+@cindex finding extensions
Compiled extensions have to be installed in a directory where
@command{gawk} can find them. If @command{gawk} is configured and
@@ -31740,6 +31905,7 @@ path with a list of directories to search for compiled extensions.
@node Extension Example
@section Example: Some File Functions
+@cindex extension example
@quotation
@i{No matter where you go, there you are.}
@@ -32384,6 +32550,7 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk}
@node Extension Samples
@section The Sample Extensions In The @command{gawk} Distribution
+@cindex extensions distributed with @command{gawk}
This @value{SECTION} provides brief overviews of the sample extensions
that come in the @command{gawk} distribution. Some of them are intended
@@ -33044,6 +33211,8 @@ tries to use @code{nanosleep()} or @code{select()} to implement the delay.
@node gawkextlib
@section The @code{gawkextlib} Project
+@cindex @code{gawkextlib}
+@cindex extensions, where to find
@cindex @code{gawkextlib} project
The @uref{http://sourceforge.net/projects/gawkextlib/, @code{gawkextlib}}
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 9a5c0168..bd604300 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -2037,11 +2037,11 @@ $ @kbd{awk "BEGIN @{ print \"Don't Panic!\" @}"}
@print{} Don't Panic!
@end example
-@cindex quoting
-@cindex double quote (@code{"})
-@cindex @code{"} (double quote)
-@cindex @code{\} (backslash)
-@cindex backslash (@code{\})
+@cindex shell quoting, double quote
+@cindex double quote (@code{"}) in shell commands
+@cindex @code{"} (double quote) in shell commands
+@cindex @code{\} (backslash) in shell commands
+@cindex backslash (@code{\}) in shell commands
This program does not read any input. The @samp{\} before each of the
inner double quotes is necessary because of the shell's quoting
rules---in particular because it mixes both single quotes and
@@ -2081,8 +2081,7 @@ awk -f @var{source-file} @var{input-file1} @var{input-file2} @dots{}
@end example
@cindex @option{-f} option
-@cindex command line, options
-@cindex options, command-line
+@cindex command line, option @option{-f}
The @option{-f} instructs the @command{awk} utility to get the @command{awk} program
from the file @var{source-file}. Any file name can be used for
@var{source-file}. For example, you could put the program:
@@ -2105,7 +2104,7 @@ does the same thing as this one:
awk "BEGIN @{ print \"Don't Panic!\" @}"
@end example
-@cindex quoting
+@cindex quoting in @command{gawk} command lines
@noindent
This was explained earlier
(@pxref{Read Terminal}).
@@ -2116,9 +2115,9 @@ program did not have single quotes around it. The quotes are only needed
for programs that are provided on the @command{awk} command line.
@c STARTOFRANGE sq1x
-@cindex single quote (@code{'})
+@cindex single quote (@code{'}) in @command{gawk} command lines
@c STARTOFRANGE qs2x
-@cindex @code{'} (single quote)
+@cindex @code{'} (single quote) in @command{gawk} command lines
If you want to clearly identify your @command{awk} program files as such,
you can add the extension @file{.awk} to the file name. This doesn't
affect the execution of the @command{awk} program but it does make
@@ -2228,7 +2227,7 @@ programs, but this usually isn't very useful; the purpose of a
comment is to help you or another person understand the program
when reading it at a later time.
-@cindex quoting
+@cindex quoting, for small awk programs
@cindex single quote (@code{'}), vs.@: apostrophe
@cindex @code{'} (single quote), vs.@: apostrophe
@quotation CAUTION
@@ -2269,7 +2268,7 @@ The next @value{SUBSECTION} describes the shell's quoting rules.
@node Quoting
@subsection Shell-Quoting Issues
-@cindex quoting, rules for
+@cindex shell quoting, rules for
@menu
* DOS Quoting:: Quoting in Windows Batch Files.
@@ -2304,10 +2303,10 @@ that character. The shell removes the backslash and passes the quoted
character on to the command.
@item
-@cindex @code{\} (backslash)
-@cindex backslash (@code{\})
-@cindex single quote (@code{'})
-@cindex @code{'} (single quote)
+@cindex @code{\} (backslash), in shell commands
+@cindex backslash (@code{\}), in shell commands
+@cindex single quote (@code{'}), in shell commands
+@cindex @code{'} (single quote), in shell commands
Single quotes protect everything between the opening and closing quotes.
The shell does no interpretation of the quoted text, passing it on verbatim
to the command.
@@ -2317,8 +2316,8 @@ Refer back to
for an example of what happens if you try.
@item
-@cindex double quote (@code{"})
-@cindex @code{"} (double quote)
+@cindex double quote (@code{"}), in shell commands
+@cindex @code{"} (double quote), in shell commands
Double quotes protect most things between the opening and closing quotes.
The shell does at least variable and command substitution on the quoted text.
Different shells may do additional kinds of processing on double-quoted text.
@@ -2355,7 +2354,7 @@ awk -F "" '@var{program}' @var{files} # correct
@end example
@noindent
-@cindex null strings, quoting and
+@cindex null strings in @command{gawk} arguments, quoting and
Don't use this:
@example
@@ -2368,7 +2367,7 @@ as the value of @code{FS}, and the first file name as the text of the program!
This results in syntax errors at best, and confusing behavior at worst.
@end itemize
-@cindex quoting, tricks for
+@cindex quoting in @command{gawk} command lines, tricks for
Mixing single and double quotes is difficult. You have to resort
to shell quoting tricks, like this:
@@ -3250,6 +3249,7 @@ Print the short version of the General Public License and then exit.
@itemx --dump-variables@r{[}=@var{file}@r{]}
@cindex @option{-d} option
@cindex @option{--dump-variables} option
+@cindex dump all variables of a program
@cindex @file{awkvars.out} file
@cindex files, @file{awkvars.out}
@cindex variables, global, printing list of
@@ -3403,7 +3403,7 @@ care to search for all occurrences of each inappropriate construct. As
@cindex @option{--bignum} option
Force arbitrary precision arithmetic on numbers. This option has no effect
if @command{gawk} is not compiled to use the GNU MPFR and MP libraries
-(@pxref{Arbitrary Precision Arithmetic}).
+(@pxref{Gawk and MPFR}).
@item -n
@itemx --non-decimal-data
@@ -3656,6 +3656,7 @@ file at all.
@cindex @command{gawk}, @code{ARGIND} variable in
@cindex @code{ARGIND} variable, command-line arguments
+@cindex @code{ARGV} array, indexing into
@cindex @code{ARGC}/@code{ARGV} variables, command-line arguments
All these arguments are made available to your @command{awk} program in the
@code{ARGV} array (@pxref{Built-in Variables}). Command-line options
@@ -3666,6 +3667,7 @@ sets the variable @code{ARGIND} to the index in @code{ARGV} of the
current element.
@cindex input files, variable assignments and
+@cindex variable assignments and input files
The distinction between file name arguments and variable-assignment
arguments is made when @command{awk} is about to open the next input file.
At that point in execution, it checks the file name to see whether
@@ -3743,6 +3745,7 @@ this file name itself.)
@node Environment Variables
@section The Environment Variables @command{gawk} Uses
+@cindex environment variables used by @command{gawk}
A number of environment variables influence how @command{gawk}
behaves.
@@ -3758,8 +3761,7 @@ behaves.
@node AWKPATH Variable
@subsection The @env{AWKPATH} Environment Variable
@cindex @env{AWKPATH} environment variable
-@cindex directories, searching
-@cindex search paths
+@cindex directories, searching for source files
@cindex search paths, for source files
@cindex differences in @command{awk} and @command{gawk}, @code{AWKPATH} environment variable
@ifinfo
@@ -3771,12 +3773,12 @@ implementations, you must supply a precise path name for each program
file, unless the file is in the current directory.
But in @command{gawk}, if the file name supplied to the @option{-f}
or @option{-i} options
-does not contain a @samp{/}, then @command{gawk} searches a list of
+does not contain a directory separator @samp{/}, then @command{gawk} searches a list of
directories (called the @dfn{search path}), one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
-separated by colons. @command{gawk} gets its search path from the
+separated by colons@footnote{Semicolons on MS-Windows and MS-DOS.}. @command{gawk} gets its search path from the
@env{AWKPATH} environment variable. If that variable does not exist,
@command{gawk} uses a default path,
@samp{.:/usr/local/share/awk}.@footnote{Your version of @command{gawk}
@@ -3834,8 +3836,7 @@ found, and @command{gawk} no longer needs to use @env{AWKPATH}.
@node AWKLIBPATH Variable
@subsection The @env{AWKLIBPATH} Environment Variable
@cindex @env{AWKLIBPATH} environment variable
-@cindex directories, searching
-@cindex search paths
+@cindex directories, searching for shared libraries
@cindex search paths, for shared libraries
@cindex differences in @command{awk} and @command{gawk}, @code{AWKLIBPATH} environment variable
@@ -4120,7 +4121,6 @@ they will @emph{not} be in the next release).
@c update this section for each release!
-@cindex @code{PROCINFO} array
The process-related special files @file{/dev/pid}, @file{/dev/ppid},
@file{/dev/pgrpid}, and @file{/dev/user} were deprecated in @command{gawk}
3.1, but still worked. As of version 4.0, they are no longer
@@ -4205,7 +4205,7 @@ long-undocumented ``feature'' of Unix @code{awk}.
@node Regexp
@chapter Regular Expressions
-@cindex regexp, See regular expressions
+@cindex regexp
@c STARTOFRANGE regexp
@cindex regular expressions
@@ -4214,8 +4214,8 @@ set of strings.
Because regular expressions are such a fundamental part of @command{awk}
programming, their format and use deserve a separate @value{CHAPTER}.
-@cindex forward slash (@code{/})
-@cindex @code{/} (forward slash)
+@cindex forward slash (@code{/}) to enclose regular expressions
+@cindex @code{/} (forward slash) to enclose regular expressions
A regular expression enclosed in slashes (@samp{/})
is an @command{awk} pattern that matches every input record whose text
belongs to that set.
@@ -4271,9 +4271,9 @@ $ @kbd{awk '/li/ @{ print $2 @}' mail-list}
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
@c @cindex operators, @code{!~}
-@cindex @code{if} statement
-@cindex @code{while} statement
-@cindex @code{do}-@code{while} statement
+@cindex @code{if} statement, use of regexps in
+@cindex @code{while} statement, use of regexps in
+@cindex @code{do}-@code{while} statement, use of regexps in
@c @cindex statements, @code{if}
@c @cindex statements, @code{while}
@c @cindex statements, @code{do}
@@ -4332,6 +4332,7 @@ $ @kbd{awk '$1 !~ /J/' inventory-shipped}
@end example
@cindex regexp constants
+@cindex constant regexps
@cindex regular expressions, constants, See regexp constants
When a regexp is enclosed in slashes, such as @code{/foo/}, we call it
a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
@@ -4340,7 +4341,7 @@ a @dfn{regexp constant}, much like @code{5.27} is a numeric constant and
@node Escape Sequences
@section Escape Sequences
-@cindex escape sequences
+@cindex escape sequences, in strings
@cindex backslash (@code{\}), in escape sequences
@cindex @code{\} (backslash), in escape sequences
Some characters cannot be included literally in string constants
@@ -4551,6 +4552,7 @@ escape sequences literally when used in regexp constants. Thus,
@section Regular Expression Operators
@c STARTOFRANGE regexpo
@cindex regular expressions, operators
+@cindex metacharacters in regular expressions
You can combine regular expressions with special characters,
called @dfn{regular expression operators} or @dfn{metacharacters}, to
@@ -4569,8 +4571,8 @@ Here is a list of metacharacters. All characters that are not escape
sequences and that are not listed in the table stand for themselves:
@table @code
-@cindex backslash (@code{\})
-@cindex @code{\} (backslash)
+@cindex backslash (@code{\}), regexp operator
+@cindex @code{\} (backslash), regexp operator
@item \
This is used to suppress the special meaning of a character when
matching. For example, @samp{\$}
@@ -4608,8 +4610,8 @@ The condition in the following example is not true:
if ("line1\nLINE 2" ~ /1$/) @dots{}
@end example
-@cindex @code{.} (period)
-@cindex period (@code{.})
+@cindex @code{.} (period), regexp operator
+@cindex period (@code{.}), regexp operator
@item . @r{(period)}
This matches any single character,
@emph{including} the newline character. For example, @samp{.P}
@@ -4625,8 +4627,8 @@ character, which is a character with all bits equal to zero.
Otherwise, @sc{nul} is just another character. Other versions of @command{awk}
may not be able to match the @sc{nul} character.
-@cindex @code{[]} (square brackets)
-@cindex square brackets (@code{[]})
+@cindex @code{[]} (square brackets), regexp operator
+@cindex square brackets (@code{[]}), regexp operator
@cindex bracket expressions
@cindex character sets, See Also bracket expressions
@cindex character lists, See bracket expressions
@@ -4713,7 +4715,7 @@ This symbol is similar to @samp{*}, except that the preceding expression can be
matched either once or not at all. For example, @samp{fe?d}
matches @samp{fed} and @samp{fd}, but nothing else.
-@cindex interval expressions
+@cindex interval expressions, regexp operator
@item @{@var{n}@}
@itemx @{@var{n},@}
@itemx @{@var{n},@var{m}@}
@@ -4790,6 +4792,7 @@ expressions are not available in regular expressions.
@cindex bracket expressions
@cindex bracket expressions, range expressions
@cindex range expressions (regexps)
+@cindex character lists in regular expression
As mentioned earlier, a bracket expression matches any character amongst
those listed between the opening and closing square brackets.
@@ -5053,7 +5056,7 @@ lesser of two evils.
@c
@c Should really do this with file inclusion.
@cindex regular expressions, @command{gawk}, command-line options
-@cindex @command{gawk}, command-line options
+@cindex @command{gawk}, command-line options, and regular expressions
The various command-line options
(@pxref{Options})
control how @command{gawk} interprets characters in regexps:
@@ -5132,7 +5135,7 @@ This works in any POSIX-compliant @command{awk}.
@cindex tilde (@code{~}), @code{~} operator
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
-@cindex @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, @code{~} and @code{!~} operators
@cindex @command{gawk}, @code{IGNORECASE} variable in
@c @cindex variables, @code{IGNORECASE}
Another method, specific to @command{gawk}, is to set the variable
@@ -5353,6 +5356,7 @@ occur often in practice, but it's worth noting for future reference.
@chapter Reading Input Files
@c STARTOFRANGE infir
+@cindex reading input files
@cindex input files, reading
@cindex input files
@cindex @code{FILENAME} variable
@@ -5439,7 +5443,6 @@ To do this, use the special @code{BEGIN} pattern
(@pxref{BEGIN/END}).
For example:
-@cindex @code{BEGIN} pattern
@example
awk 'BEGIN @{ RS = "u" @}
@{ print $0 @}' mail-list
@@ -5555,6 +5558,7 @@ Reaching the end of an input file terminates the current input record,
even if the last character in the file is not the character in @code{RS}.
@value{DARKCORNER}
+@cindex empty strings
@cindex null strings
@cindex strings, empty, See null strings
The empty string @code{""} (a string without any characters)
@@ -5686,7 +5690,7 @@ character as a record separator. However, this is a special case:
@command{mawk} does not allow embedded @sc{nul} characters in strings.
@cindex records, treating files as
-@cindex files, as single records
+@cindex treating files, as single records
The best way to treat a whole file as a single record is to
simply read the file in, one record at a time, concatenating each
record onto the end of the previous ones.
@@ -6301,10 +6305,8 @@ behaves this way.
@node Command Line Field Separator
@subsection Setting @code{FS} from the Command Line
-@cindex @option{-F} option
-@cindex options, command-line
-@cindex command line, options
-@cindex field separators, on command line
+@cindex @option{-F} option, command line
+@cindex field separator, on command line
@cindex command line, @code{FS} on@comma{} setting
@cindex @code{FS} variable, setting from command line
@@ -6464,7 +6466,7 @@ POSIX standard.)
@sidebar Changing @code{FS} Does Not Affect the Fields
@cindex POSIX @command{awk}, field separators and
-@cindex field separators, POSIX and
+@cindex field separator, POSIX and
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
@@ -6787,6 +6789,7 @@ available for splitting regular strings (@pxref{String Functions}).
@node Multiple Line
@section Multiple-Line Records
+@cindex multiple-line records
@c STARTOFRANGE recm
@cindex records, multiline
@c STARTOFRANGE imr
@@ -6838,7 +6841,8 @@ after the last record, the final newline is removed from the record.
In the second case, this special processing is not done.
@value{DARKCORNER}
-@cindex field separators, in multiline records
+@cindex field separator, in multiline records
+@cindex @code{FS}, in multiline records
Now that the input is separated into records, the second step is to
separate the fields in the record. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
@@ -6986,7 +6990,7 @@ and study the @code{getline} command @emph{after} you have reviewed the
rest of this @value{DOCUMENT} and have a good knowledge of how @command{awk} works.
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @command{getline} command
@cindex differences in @command{awk} and @command{gawk}, @code{getline} command
@cindex @code{getline} command, return values
@cindex @option{--sandbox} option, input redirection with @code{getline}
@@ -7082,6 +7086,7 @@ rule in the program. @xref{Next Statement}.
@node Getline/Variable
@subsection Using @code{getline} into a Variable
+@cindex @code{getline} into a variable
@cindex variables, @code{getline} command into@comma{} using
You can use @samp{getline @var{var}} to read the next record from
@@ -7133,6 +7138,7 @@ the value of @code{NF} do not change.
@node Getline/File
@subsection Using @code{getline} from a File
+@cindex @code{getline} from a file
@cindex input redirection
@cindex redirection of input
@cindex @code{<} (left angle bracket), @code{<} operator (I/O)
@@ -7181,8 +7187,6 @@ from the file
@var{file}, and put it in the variable @var{var}. As above, @var{file}
is a string-valued expression that specifies the file from which to read.
-@cindex @command{gawk}, @code{RT} variable in
-@cindex @code{RT} variable
In this version of @code{getline}, none of the built-in variables are
changed and the record is not split into fields. The only variable
changed is @var{var}.@footnote{This is not quite true. @code{RT} could
@@ -7207,7 +7211,6 @@ Note here how the name of the extra input file is not built into
the program; it is taken directly from the data, specifically from the second field on
the @samp{@@include} line.
-@cindex @code{close()} function
The @code{close()} function is called to ensure that if two identical
@samp{@@include} lines appear in the input, the entire specified file is
included twice.
@@ -7234,7 +7237,7 @@ Failing that, attention to details would be useful.}
@cindex @code{|} (vertical bar), @code{|} operator (I/O)
@cindex vertical bar (@code{|}), @code{|} operator (I/O)
@cindex input pipeline
-@cindex pipes, input
+@cindex pipe, input
@cindex operators, input/output
The output of a command can also be piped into @code{getline}, using
@samp{@var{command} | getline}. In
@@ -7258,7 +7261,6 @@ produced by running the rest of the line as a shell command:
@end example
@noindent
-@cindex @code{close()} function
The @code{close()} function is called to ensure that if two identical
@samp{@@execute} lines appear in the input, the command is run for
each one.
@@ -8535,7 +8537,7 @@ appended to the file.
If @var{output-file} does not exist, then it is created.
@cindex @code{|} (vertical bar), @code{|} operator (I/O)
-@cindex pipes, output
+@cindex pipe, output
@cindex output, pipes
@item print @var{items} | @var{command}
It is possible to send output to another program through a pipe
@@ -8872,7 +8874,7 @@ Doing so results in unpredictable behavior.
@c STARTOFRANGE ofc
@cindex output, files@comma{} closing
@c STARTOFRANGE pc
-@cindex pipes, closing
+@cindex pipe, closing
@c STARTOFRANGE cc
@cindex coprocesses, closing
@cindex @code{getline} command, coprocesses@comma{} using from
@@ -8975,6 +8977,7 @@ a separate message.
@cindex differences in @command{awk} and @command{gawk}, @code{close()} function
@cindex portability, @code{close()} function and
+@cindex @code{close()} function, portability
If you use more files than the system allows you to have open,
@command{gawk} attempts to multiplex the available open files among
your data files. @command{gawk}'s ability to do this depends upon the
@@ -9054,7 +9057,7 @@ retval = close(command) # syntax error in many Unix awks
@end example
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @command{close()} function
@command{gawk} treats @code{close()} as a function.
The return value is @minus{}1 if the argument names something
that was never opened with a redirection, or if there is
@@ -9153,7 +9156,8 @@ have different forms, but are stored identically internally.
@node Scalar Constants
@subsubsection Numeric and String Constants
-@cindex numeric, constants
+@cindex constants, numeric
+@cindex numeric constants
A @dfn{numeric constant} stands for a number. This number can be an
integer, a decimal fraction, or a number in scientific (exponential)
notation.@footnote{The internal representation of all numbers,
@@ -9179,7 +9183,7 @@ double-quotation marks. For example:
@noindent
@cindex differences in @command{awk} and @command{gawk}, strings
-@cindex strings, length of
+@cindex strings, length limitations
represents the string whose contents are @samp{parrot}. Strings in
@command{gawk} can be of any length, and they can contain any of the possible
eight-bit ASCII characters including ASCII @sc{nul} (character code zero).
@@ -11626,6 +11630,8 @@ programmers.
@node Using BEGIN/END
@subsubsection Startup and Cleanup Actions
+@cindex @code{BEGIN} pattern
+@cindex @code{END} pattern
A @code{BEGIN} rule is executed once only, before the first input record
is read. Likewise, an @code{END} rule is executed once only, after all the
input is read. For example:
@@ -11769,7 +11775,7 @@ you can bypass the fatal error and move on to the next file on the
command line.
@cindex @command{gawk}, @code{ERRNO} variable in
-@cindex @code{ERRNO} variable
+@cindex @code{ERRNO} variable, with @code{BEGINFILE} pattern
@cindex @code{nextfile} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and
You do this by checking if the @code{ERRNO} variable is not the empty
string; if so, then @command{gawk} was not able to open the file. In
@@ -12878,8 +12884,8 @@ is to simply say @samp{FS = FS}, perhaps with an explanatory comment.
@cindex @command{gawk}, @code{IGNORECASE} variable in
@cindex @code{IGNORECASE} variable
@cindex differences in @command{awk} and @command{gawk}, @code{IGNORECASE} variable
-@cindex case sensitivity, string comparisons and
-@cindex case sensitivity, regexps and
+@cindex case sensitivity, and string comparisons
+@cindex case sensitivity, and regexps
@cindex regular expressions, case sensitivity
@item IGNORECASE #
If @code{IGNORECASE} is nonzero or non-null, then all string comparisons
@@ -13096,7 +13102,7 @@ or if @command{gawk} is in compatibility mode
it is not special.
@cindex @code{ENVIRON} array
-@cindex environment variables
+@cindex environment variables, in @code{ENVIRON} array
@item ENVIRON
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
@@ -13211,10 +13217,12 @@ The following elements (listed alphabetically)
are guaranteed to be available:
@table @code
+@cindex effective group id of @command{gawk} user
@item PROCINFO["egid"]
The value of the @code{getegid()} system call.
@item PROCINFO["euid"]
+@cindex effective user id of @command{gawk} user
The value of the @code{geteuid()} system call.
@item PROCINFO["FS"]
@@ -13224,6 +13232,7 @@ This is
or @code{"FPAT"} if field matching with @code{FPAT} is in effect.
@item PROCINFO["identifiers"]
+@cindex program identifiers
A subarray, indexed by the names of all identifiers used in the
text of the AWK program. For each identifier, the value of the element is one of the following:
@@ -13252,15 +13261,19 @@ after it has finished parsing the program; they are @emph{not} updated
while the program runs.
@item PROCINFO["gid"]
+@cindex group id of @command{gawk} user
The value of the @code{getgid()} system call.
@item PROCINFO["pgrpid"]
+@cindex process group id of @command{gawk} process
The process group ID of the current process.
@item PROCINFO["pid"]
+@cindex process id of @command{gawk} process
The process ID of the current process.
@item PROCINFO["ppid"]
+@cindex parent process id of @command{gawk} process
The parent process ID of the current process.
@item PROCINFO["sorted_in"]
@@ -13280,25 +13293,31 @@ Assigning a new value to this element changes the default.
The value of the @code{getuid()} system call.
@item PROCINFO["version"]
+@cindex version of @command{gawk}
+@cindex @command{gawk} version
The version of @command{gawk}.
@end table
The following additional elements in the array
are available to provide information about the MPFR and GMP libraries
if your version of @command{gawk} supports arbitrary precision numbers
-(@pxref{Arbitrary Precision Arithmetic}):
+(@pxref{Gawk and MPFR}):
@table @code
+@cindex version of GNU MPFR library
@item PROCINFO["mpfr_version"]
The version of the GNU MPFR library.
@item PROCINFO["gmp_version"]
+@cindex version of GNU MP library
The version of the GNU MP library.
@item PROCINFO["prec_max"]
+@cindex maximum precision supported by MPFR library
The maximum precision supported by MPFR.
@item PROCINFO["prec_min"]
+@cindex minimum precision supported by MPFR library
The minimum precision required by MPFR.
@end table
@@ -13309,12 +13328,15 @@ of @command{gawk} supports dynamic loading of extension functions
@table @code
@item PROCINFO["api_major"]
+@cindex version of @command{gawk} extension API
+@cindex extension API, version number
The major version of the extension API.
@item PROCINFO["api_minor"]
The minor version of the extension API.
@end table
+@cindex supplementary groups of @command{gawk} process
On some systems, there may be elements in the array, @code{"group1"}
through @code{"group@var{N}"} for some @var{N}. @var{N} is the number of
supplementary groups that the process has. Use the @code{in} operator
@@ -13322,7 +13344,7 @@ to test for these elements
(@pxref{Reference to Elements}).
@cindex @command{gawk}, @code{PROCINFO} array in
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, uses
The @code{PROCINFO} array has the following additional uses:
@itemize @bullet
@@ -13462,7 +13484,7 @@ changed.
@node ARGC and ARGV
@subsection Using @code{ARGC} and @code{ARGV}
-@cindex @code{ARGC}/@code{ARGV} variables
+@cindex @code{ARGC}/@code{ARGV} variables, how to use
@cindex arguments, command-line
@cindex command line, arguments
@@ -13607,7 +13629,7 @@ ability to support true multidimensional arrays.
@cindex variables, names of
@cindex functions, names of
-@cindex arrays, names of
+@cindex arrays, names of, and names of functions/variables
@cindex names, arrays/variables
@cindex namespace issues
@command{awk} maintains a single set
@@ -13783,10 +13805,9 @@ Here, the number @code{1} isn't double-quoted, since @command{awk}
automatically converts it to a string.
@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
@cindex case sensitivity, array indices and
-@cindex arrays, @code{IGNORECASE} variable and
-@cindex @code{IGNORECASE} variable, array subscripts and
+@cindex arrays, and @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, and array indices
The value of @code{IGNORECASE} has no effect upon array subscripting.
The identical string value used to store an array element must be used
to retrieve it.
@@ -13802,8 +13823,9 @@ is independent of the number of elements in the array.
@node Reference to Elements
@subsection Referring to an Array Element
-@cindex arrays, elements, referencing
-@cindex elements in arrays
+@cindex arrays, referencing elements
+@cindex array members
+@cindex elements of arrays
The principal way to use an array is to refer to one of its elements.
An array reference is an expression as follows:
@@ -13820,11 +13842,16 @@ The value of the array reference is the current value of that array
element. For example, @code{foo[4.3]} is an expression for the element
of array @code{foo} at index @samp{4.3}.
+@cindex arrays, unassigned elements
+@cindex unassigned array elements
+@cindex empty array elements
A reference to an array element that has no recorded value yields a value of
@code{""}, the null string. This includes elements
that have not been assigned any value as well as elements that have been
deleted (@pxref{Delete}).
+@cindex non-existent array elements
+@cindex arrays, elements that don't exist
@quotation NOTE
A reference to an element that does not exist @emph{automatically} creates
that array element, with the null string as its value. (In some cases,
@@ -13844,7 +13871,7 @@ if it didn't exist before!
@end quotation
@c @cindex arrays, @code{in} operator and
-@cindex @code{in} operator
+@cindex @code{in} operator, testing if array element exists
To determine whether an element exists in an array at a certain index, use
the following expression:
@@ -13879,8 +13906,8 @@ if (frequencies[2] != "")
@node Assigning Elements
@subsection Assigning Array Elements
-@cindex arrays, elements, assigning
-@cindex elements in arrays, assigning
+@cindex arrays, elements, assigning values
+@cindex elements in arrays, assigning values
Array elements can be assigned values just like
@command{awk} variables:
@@ -13897,6 +13924,7 @@ assign to that element of the array.
@node Array Example
@subsection Basic Array Example
+@cindex arrays, an example of using
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
@@ -13966,6 +13994,7 @@ END @{
@node Scanning an Array
@subsection Scanning All Elements of an Array
@cindex elements in arrays, scanning
+@cindex scanning arrays
@cindex arrays, scanning
@cindex loops, @code{for}, array scanning
@@ -13984,7 +14013,7 @@ for (@var{var} in @var{array})
@end example
@noindent
-@cindex @code{in} operator
+@cindex @code{in} operator, use in loops
This loop executes @var{body} once for each index in @var{array} that the
program has previously used, with the variable @var{var} set to that index.
@@ -14023,8 +14052,9 @@ END @{
@xref{Word Sorting},
for a more detailed example of this type.
-@cindex arrays, elements, order of
-@cindex elements in arrays, order of
+@cindex arrays, elements, order of access by @code{in} operator
+@cindex elements in arrays, order of access by @code{in} operator
+@cindex @code{in} operator, order of array access
The order in which elements of the array are accessed by this statement
is determined by the internal arrangement of the array elements within
@command{awk} and normally cannot be controlled or changed. This can lead to
@@ -14042,6 +14072,8 @@ determines the order in which the array is traversed.
This order is usually based on the internal implementation of arrays
and will vary from one version of @command{awk} to the next.
+@cindex array scanning order, controlling
+@cindex controlling array scanning order
Often, though, you may wish to do something simple, such as
``traverse the array by comparing the indices in ascending order,''
or ``traverse the array by comparing the values in descending order.''
@@ -14058,6 +14090,7 @@ to use for comparison of array elements. This advanced feature
is described later, in @ref{Array Sorting}.
@end itemize
+@cindex @code{PROCINFO}, values of @code{sorted_in}
The following special values for @code{PROCINFO["sorted_in"]} are available:
@table @code
@@ -14218,7 +14251,7 @@ if (4 in foo)
print "This will never be printed"
@end example
-@cindex null strings, array elements and
+@cindex null strings, and deleting array elements
It is important to note that deleting an element is @emph{not} the
same as assigning it a null value (the empty string, @code{""}).
For example:
@@ -14240,6 +14273,7 @@ is not in the array is deleted.
@cindex extensions, common@comma{} @code{delete} to delete entire arrays
@cindex arrays, deleting entire contents
@cindex deleting entire arrays
+@cindex @code{delete} @var{array}
@cindex differences in @command{awk} and @command{gawk}, array elements, deleting
All the elements of an array may be deleted with a single statement
by leaving off the subscript in the @code{delete} statement,
@@ -14297,9 +14331,9 @@ a = 3
@section Using Numbers to Subscript Arrays
@cindex numbers, as array subscripts
-@cindex arrays, subscripts
+@cindex arrays, numeric subscripts
@cindex subscripts in arrays, numbers as
-@cindex @code{CONVFMT} variable, array subscripts and
+@cindex @code{CONVFMT} variable, and array subscripts
An important aspect to remember about arrays is that @emph{array subscripts
are always strings}. When a numeric value is used as a subscript,
it is converted to a string value before being used for subscripting
@@ -14329,7 +14363,8 @@ string value from @code{xyz}---this time @code{"12.15"}---because the value of
@code{CONVFMT} only allows two significant digits. This test fails,
since @code{"12.15"} is different from @code{"12.153"}.
-@cindex converting, during subscripting
+@cindex converting integer array subscripts
+@cindex integer array indices
According to the rules for conversions
(@pxref{Conversion}), integer
values are always converted to strings as integers, no matter what the
@@ -14435,7 +14470,7 @@ languages, including @command{awk}) to refer to an element of a
two-dimensional array named @code{grid} is with
@code{grid[@var{x},@var{y}]}.
-@cindex @code{SUBSEP} variable, multidimensional arrays
+@cindex @code{SUBSEP} variable, and multidimensional arrays
Multidimensional arrays are supported in @command{awk} through
concatenation of indices into one string.
@command{awk} converts the indices into strings
@@ -14467,6 +14502,7 @@ combined strings that are ambiguous. Suppose that @code{SUBSEP} is
"b@@c"]}} are indistinguishable because both are actually
stored as @samp{foo["a@@b@@c"]}.
+@cindex @code{in} operator, index existence in multidimensional arrays
To test whether a particular index sequence exists in a
multidimensional array, use the same operator (@code{in}) that is
used for single dimensional arrays. Write the whole sequence of indices
@@ -14532,6 +14568,7 @@ multidimensional @emph{way of accessing} an array.
@cindex subscripts in arrays, multidimensional, scanning
@cindex arrays, multidimensional, scanning
+@cindex scanning multidimensional arrays
However, if your program has an array that is always accessed as
multidimensional, you can get the effect of scanning it by combining
the scanning @code{for} statement
@@ -14573,6 +14610,7 @@ separate indices is recovered.
@node Arrays of Arrays
@section Arrays of Arrays
+@cindex arrays of arrays
@command{gawk} goes beyond standard @command{awk}'s multidimensional
array access and provides true arrays of
@@ -14832,6 +14870,7 @@ two arguments 11 and 10.
@node Numeric Functions
@subsection Numeric Functions
+@cindex numeric functions
The following list describes all of
the built-in functions that work with numbers.
@@ -14840,21 +14879,25 @@ Optional parameters are enclosed in square brackets@w{ ([ ]):}
@table @code
@item atan2(@var{y}, @var{x})
@cindex @code{atan2()} function
+@cindex arctangent
Return the arctangent of @code{@var{y} / @var{x}} in radians.
You can use @samp{pi = atan2(0, -1)} to retrieve the value of @value{PI}.
@item cos(@var{x})
@cindex @code{cos()} function
+@cindex cosine
Return the cosine of @var{x}, with @var{x} in radians.
@item exp(@var{x})
@cindex @code{exp()} function
+@cindex exponent
Return the exponential of @var{x} (@code{e ^ @var{x}}) or report
an error if @var{x} is out of range. The range of values @var{x} can have
depends on your machine's floating-point representation.
@item int(@var{x})
@cindex @code{int()} function
+@cindex round to nearest integer
Return the nearest integer to @var{x}, located between @var{x} and zero and
truncated toward zero.
@@ -14863,6 +14906,7 @@ is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
@item log(@var{x})
@cindex @code{log()} function
+@cindex logarithm
Return the natural logarithm of @var{x}, if @var{x} is positive;
otherwise, report an error.
@@ -14909,7 +14953,7 @@ function roll(n) @{ return 1 + int(rand() * n) @}
@}
@end example
-@cindex numbers, random
+@cindex seeding random number generator
@cindex random numbers, seed of
@quotation CAUTION
In most @command{awk} implementations, including @command{gawk},
@@ -14926,10 +14970,12 @@ use @code{srand()}.
@item sin(@var{x})
@cindex @code{sin()} function
+@cindex sine
Return the sine of @var{x}, with @var{x} in radians.
@item sqrt(@var{x})
@cindex @code{sqrt()} function
+@cindex square root
Return the positive square root of @var{x}.
@command{gawk} prints a warning message
if @var{x} is negative. Thus, @code{sqrt(4)} is 2.
@@ -14965,6 +15011,7 @@ sequences of random numbers.
@node String Functions
@subsection String-Manipulation Functions
+@cindex string-manipulation functions
The functions in this @value{SECTION} look at or change the text of one
or more strings.
@@ -14994,10 +15041,10 @@ pound sign@w{ (@samp{#}):}
@item asort(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) #
@itemx asorti(@var{source} @r{[}, @var{dest} @r{[}, @var{how} @r{]} @r{]}) #
@cindex @code{asorti()} function (@command{gawk})
+@cindex sort array
@cindex arrays, elements, retrieving number of
@cindex @code{asort()} function (@command{gawk})
-@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
+@cindex sort array indices
These two functions are similar in behavior, so they are described
together.
@@ -15015,7 +15062,9 @@ sequential integers starting with one. If the optional array @var{dest}
is specified, then @var{source} is duplicated into @var{dest}. @var{dest}
is then sorted, leaving the indices of @var{source} unchanged.
-When comparing strings, @code{IGNORECASE} affects the sorting. If the
+@cindex @command{gawk}, @code{IGNORECASE} variable in
+When comparing strings, @code{IGNORECASE} affects the sorting
+(@pxref{Array Sorting Functions}). If the
@var{source} array contains subarrays as values (@pxref{Arrays of
Arrays}), they will come last, after all scalar values.
@@ -15059,6 +15108,8 @@ are not available in compatibility mode (@pxref{Options}).
@item gensub(@var{regexp}, @var{replacement}, @var{how} @r{[}, @var{target}@r{]}) #
@cindex @code{gensub()} function (@command{gawk})
+@cindex search and replace in strings
+@cindex substitute in string
Search the target string @var{target} for matches of the regular
expression @var{regexp}. If @var{how} is a string beginning with
@samp{g} or @samp{G} (short for ``global''), then replace all matches of @var{regexp} with
@@ -15067,7 +15118,7 @@ which match of @var{regexp} to replace. If no @var{target} is supplied,
use @code{$0}. It returns the modified string as the result
of the function and the original target string is @emph{not} changed.
-@code{gensub()} is a general substitution function. It's purpose is
+@code{gensub()} is a general substitution function. Its purpose is
to provide more features than the standard @code{sub()} and @code{gsub()}
functions.
@@ -15144,7 +15195,8 @@ and the third argument must be assignable.
@item index(@var{in}, @var{find})
@cindex @code{index()} function
-@cindex searching
+@cindex search in string
+@cindex find substring in string
Search the string @var{in} for the first occurrence of the string
@var{find}, and return the position in characters where that occurrence
begins in the string @var{in}. Consider the following example:
@@ -15162,6 +15214,8 @@ It is a fatal error to use a regexp constant for @var{find}.
@item length(@r{[}@var{string}@r{]})
@cindex @code{length()} function
+@cindex string length
+@cindex length of string
Return the number of characters in @var{string}. If
@var{string} is a number, the length of the digit string representing
that number is returned. For example, @code{length("abcde")} is five. By
@@ -15169,6 +15223,8 @@ contrast, @code{length(15 * 35)} works out to three. In this example, 15 * 35 =
525, and 525 is then converted to the string @code{"525"}, which has
three characters.
+@cindex length of input record
+@cindex input record, length of
If no argument is supplied, @code{length()} returns the length of @code{$0}.
@c @cindex historical features
@@ -15207,6 +15263,8 @@ warning about this.
@cindex common extensions, @code{length()} applied to an array
@cindex extensions, common@comma{} @code{length()} applied to an array
@cindex differences between @command{gawk} and @command{awk}
+@cindex number of array elements
+@cindex array, number of elements
With @command{gawk} and several other @command{awk} implementations, when given an
array argument, the @code{length()} function returns the number of elements
in the array. @value{COMMONEXT}
@@ -15221,6 +15279,8 @@ If @option{--posix} is supplied, using an array argument is a fatal error
@item match(@var{string}, @var{regexp} @r{[}, @var{array}@r{]})
@cindex @code{match()} function
+@cindex string, regular expression match
+@cindex match regexp in string
Search @var{string} for the
longest, leftmost substring matched by the regular expression,
@var{regexp} and return the character position, or @dfn{index},
@@ -15336,6 +15396,7 @@ using a third argument is a fatal error.
@item patsplit(@var{string}, @var{array} @r{[}, @var{fieldpat} @r{[}, @var{seps} @r{]} @r{]}) #
@cindex @code{patsplit()} function (@command{gawk})
+@cindex split string into array
Divide
@var{string} into pieces defined by @var{fieldpat}
and store the pieces in @var{array} and the separator strings in the
@@ -15395,7 +15456,7 @@ split("cul-de-sac", a, "-", seps)
@end example
@noindent
-@cindex strings, splitting
+@cindex strings splitting, example
splits the string @samp{cul-de-sac} into three fields using @samp{-} as the
separator. It sets the contents of the array @code{a} as follows:
@@ -15452,6 +15513,7 @@ If @var{string} does not match @var{fieldsep} at all (but is not null),
@item sprintf(@var{format}, @var{expression1}, @dots{})
@cindex @code{sprintf()} function
+@cindex formatting strings
Return (without printing) the string that @code{printf} would
have printed out with the same arguments
(@pxref{Printf}).
@@ -15465,6 +15527,7 @@ pival = sprintf("pi = %.2f (approx.)", 22/7)
assigns the string @w{@samp{pi = 3.14 (approx.)}} to the variable @code{pival}.
@cindex @code{strtonum()} function (@command{gawk})
+@cindex convert string to number
@item strtonum(@var{str}) #
Examine @var{str} and return its numeric value. If @var{str}
begins with a leading @samp{0}, @code{strtonum()} assumes that @var{str}
@@ -15492,6 +15555,7 @@ in compatibility mode (@pxref{Options}).
@item sub(@var{regexp}, @var{replacement} @r{[}, @var{target}@r{]})
@cindex @code{sub()} function
+@cindex replace in string
Search @var{target}, which is treated as a string, for the
leftmost, longest substring matched by the regular expression @var{regexp}.
Modify the entire string
@@ -15592,6 +15656,7 @@ string, and then the value of that string is treated as the regexp to match.
@item substr(@var{string}, @var{start} @r{[}, @var{length}@r{]})
@cindex @code{substr()} function
+@cindex substring
Return a @var{length}-character-long substring of @var{string},
starting at character number @var{start}. The first character of a
string is character number one.@footnote{This is different from
@@ -15648,9 +15713,10 @@ string = substr(string, 1, 2) "CDE" substr(string, 6)
@end example
@cindex case sensitivity, converting case
-@cindex converting, case
+@cindex strings, converting letter case
@item tolower(@var{string})
@cindex @code{tolower()} function
+@cindex convert string to lower case
Return a copy of @var{string}, with each uppercase character
in the string replaced with its corresponding lowercase character.
Nonalphabetic characters are left unchanged. For example,
@@ -15658,6 +15724,7 @@ Nonalphabetic characters are left unchanged. For example,
@item toupper(@var{string})
@cindex @code{toupper()} function
+@cindex convert string to upper case
Return a copy of @var{string}, with each lowercase character
in the string replaced with its corresponding uppercase character.
Nonalphabetic characters are left unchanged. For example,
@@ -16050,6 +16117,7 @@ Although this makes a certain amount of sense, it can be surprising.
@node I/O Functions
@subsection Input/Output Functions
+@cindex input/output functions
The following functions relate to input/output (I/O).
Optional parameters are enclosed in square brackets ([ ]):
@@ -16058,6 +16126,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@item close(@var{filename} @r{[}, @var{how}@r{]})
@cindex @code{close()} function
@cindex files, closing
+@cindex close file or coprocess
Close the file @var{filename} for input or output. Alternatively, the
argument may be a shell command that was used for creating a coprocess, or
for redirecting to or from a pipe; then the coprocess or pipe is closed.
@@ -16075,6 +16144,7 @@ which discusses this feature in more detail and gives an example.
@item fflush(@r{[}@var{filename}@r{]})
@cindex @code{fflush()} function
+@cindex flush buffered output
Flush any buffered output associated with @var{filename}, which is either a
file opened for writing or a shell command for redirecting output to
a pipe or coprocess.
@@ -16134,6 +16204,7 @@ In such a case, @code{fflush()} returns @minus{}1, as well.
@item system(@var{command})
@cindex @code{system()} function
+@cindex invoke shell command
@cindex interacting with other programs
Execute the operating-system
command @var{command} and then return to the @command{awk} program.
@@ -16280,6 +16351,7 @@ you would see the latter (undesirable) output.
@node Time Functions
@subsection Time Functions
+@cindex time functions
@c STARTOFRANGE tst
@cindex timestamps
@@ -16319,6 +16391,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@table @code
@item mktime(@var{datespec})
@cindex @code{mktime()} function (@command{gawk})
+@cindex generate time values
Turn @var{datespec} into a timestamp in the same form
as is returned by @code{systime()}. It is similar to the function of the
same name in ISO C. The argument, @var{datespec}, is a string of the form
@@ -16349,6 +16422,7 @@ is out of range, @code{mktime()} returns @minus{}1.
@item strftime(@r{[}@var{format} @r{[}, @var{timestamp} @r{[}, @var{utc-flag}@r{]]]})
@c STARTOFRANGE strf
@cindex @code{strftime()} function (@command{gawk})
+@cindex format time string
Format the time specified by @var{timestamp}
based on the contents of the @var{format} string and return the result.
It is similar to the function of the same name in ISO C.
@@ -16370,6 +16444,7 @@ change the default format.
@item systime()
@cindex @code{systime()} function (@command{gawk})
@cindex timestamps
+@cindex current system time
Return the current time as the number of seconds since
the system epoch. On POSIX systems, this is the number of seconds
since 1970-01-01 00:00:00 UTC, not counting leap seconds.
@@ -16663,6 +16738,7 @@ gawk 'BEGIN @{
@node Bitwise Functions
@subsection Bit-Manipulation Functions
+@cindex bit-manipulation functions
@c STARTOFRANGE bit
@cindex bitwise, operations
@c STARTOFRANGE and
@@ -16826,26 +16902,32 @@ bitwise operations just described. They are:
@cindex @command{gawk}, bitwise operations in
@table @code
@cindex @code{and()} function (@command{gawk})
+@cindex bitwise AND
@item and(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise AND of the arguments. There must be at least two.
@cindex @code{compl()} function (@command{gawk})
+@cindex bitwise complement
@item compl(@var{val})
Return the bitwise complement of @var{val}.
@cindex @code{lshift()} function (@command{gawk})
+@cindex left shift
@item lshift(@var{val}, @var{count})
Return the value of @var{val}, shifted left by @var{count} bits.
@cindex @code{or()} function (@command{gawk})
+@cindex bitwise OR
@item or(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise OR of the arguments. There must be at least two.
@cindex @code{rshift()} function (@command{gawk})
+@cindex right shift
@item rshift(@var{val}, @var{count})
Return the value of @var{val}, shifted right by @var{count} bits.
@cindex @code{xor()} function (@command{gawk})
+@cindex bitwise XOR
@item xor(@var{v1}, @var{v2} @r{[}, @r{@dots{}]})
Return the bitwise XOR of the arguments. There must be at least two.
@end table
@@ -16937,6 +17019,7 @@ $ @kbd{gawk -f testbits.awk}
@cindex strings, converting
@cindex numbers, converting
@cindex converting, numbers to strings
+@cindex number as string of bits
The @code{bits2str()} function turns a binary number into a string.
The number @code{1} represents a binary value where the rightmost bit
is set to 1. Using this mask,
@@ -16973,6 +17056,7 @@ that traverses every element of a true multidimensional array
@table @code
@cindex @code{isarray()} function (@command{gawk})
+@cindex scalar or array
@item isarray(@var{x})
Return a true value if @var{x} is an array. Otherwise return false.
@end table
@@ -16994,6 +17078,7 @@ will end up turning it into a scalar.
@subsection String-Translation Functions
@cindex @command{gawk}, string-translation functions
@cindex functions, string-translation
+@cindex string-translation functions
@cindex internationalization
@cindex @command{awk} programs, internationalizing
@@ -17006,6 +17091,7 @@ Optional parameters are enclosed in square brackets ([ ]):
@table @code
@cindex @code{bindtextdomain()} function (@command{gawk})
+@cindex set directory of message catalogs
@item bindtextdomain(@var{directory} @r{[}, @var{domain}@r{]})
Set the directory in which
@command{gawk} will look for message translation files, in case they
@@ -17019,6 +17105,7 @@ If @var{directory} is the null string (@code{""}), then
given @var{domain}.
@cindex @code{dcgettext()} function (@command{gawk})
+@cindex translate string
@item dcgettext(@var{string} @r{[}, @var{domain} @r{[}, @var{category}@r{]]})
Return the translation of @var{string} in
text domain @var{domain} for locale category @var{category}.
@@ -17042,7 +17129,7 @@ The default value for @var{category} is @code{"LC_MESSAGES"}.
@section User-Defined Functions
@c STARTOFRANGE udfunc
-@cindex user-defined, functions
+@cindex user-defined functions
@c STARTOFRANGE funcud
@cindex functions, user-defined
Complicated @command{awk} programs can often be simplified by defining
@@ -17128,6 +17215,7 @@ conventional to place some extra space between the arguments and
the local variables, in order to document how your function is supposed to be used.
@cindex variables, shadowing
+@cindex shadowing of variable values
During execution of the function body, the arguments and local variable
values hide, or @dfn{shadow}, any variables of the same names used in the
rest of the program. The shadowed variables are not accessible in the
@@ -17186,6 +17274,7 @@ keyword @code{function} when defining a function.
@node Function Example
@subsection Function Definition Examples
+@cindex function definition example
Here is an example of a user-defined function, called @code{myprint()}, that
takes a number and prints it in a specific format:
@@ -17334,8 +17423,8 @@ an error.
@node Variable Scope
@subsubsection Controlling Variable Scope
-@cindex local variables
-@cindex variables, local
+@cindex local variables, in a function
+@cindex variables, local to a function
There is no way to make a variable local to a @code{@{ @dots{} @}} block in
@command{awk}, but you can make a variable local to a function. It is
good practice to do so whenever a variable is needed only in that
@@ -18264,7 +18353,7 @@ The leading capital letter indicates that it is global, while the fact that
the variable name is not all capital letters indicates that the variable is
not one of @command{awk}'s built-in variables, such as @code{FS}.
-@cindex @option{--dump-variables} option
+@cindex @option{--dump-variables} option, using for library functions
It is also important that @emph{all} variables in library
functions that do not need to save state are, in fact, declared
local.@footnote{@command{gawk}'s @option{--dump-variables} command-line
@@ -20052,7 +20141,7 @@ from anywhere within a user's program, and the user may have his
or her
own way of splitting records and fields.
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, testing the field splitting
The @code{using_fw} variable checks @code{PROCINFO["FS"]}, which
is @code{"FIELDWIDTHS"} if field splitting is being done with
@code{FIELDWIDTHS}. This makes it possible to restore the correct
@@ -20175,7 +20264,7 @@ uses these functions.
@cindex group database, reading
@c STARTOFRANGE datagr
@cindex database, group, reading
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and group membership
@cindex @code{getgrent()} function (C library)
@cindex @code{getgrent()} user-defined function
@cindex groups@comma{} information about
@@ -21354,7 +21443,7 @@ $ @kbd{id}
@print{} uid=500(arnold) gid=500(arnold) groups=6(disk),7(lp),19(floppy)
@end example
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and user and group ID numbers
This information is part of what is provided by @command{gawk}'s
@code{PROCINFO} array (@pxref{Built-in Variables}).
However, the @command{id} utility provides a more palatable output than just
@@ -21455,7 +21544,6 @@ BEGIN \
@c endfile
@end example
-@cindex @code{in} operator
The test in the @code{for} loop is worth noting.
Any supplementary groups in the @code{PROCINFO} array have the
indices @code{"group1"} through @code{"group@var{N}"} for some
@@ -21465,7 +21553,7 @@ there are.
This loop works by starting at one, concatenating the value with
@code{"group"}, and then using @code{in} to see if that value is
-in the array. Eventually, @code{i} is incremented past
+in the array (@pxref{Reference to Elements}). Eventually, @code{i} is incremented past
the last group in the array and the loop exits.
The loop is also correct if there are @emph{no} supplementary
@@ -24674,9 +24762,8 @@ both arrays use the values.
@c Document It And Call It A Feature. Sigh.
@cindex @command{gawk}, @code{IGNORECASE} variable in
-@cindex @code{IGNORECASE} variable
-@cindex arrays, sorting, @code{IGNORECASE} variable and
-@cindex @code{IGNORECASE} variable, array sorting and
+@cindex arrays, sorting, and @code{IGNORECASE} variable
+@cindex @code{IGNORECASE} variable, and array sorting functions
Because @code{IGNORECASE} affects string comparisons, the value
of @code{IGNORECASE} also affects sorting for both @code{asort()} and @code{asorti()}.
Note also that the locale's sorting order does @emph{not}
@@ -24845,7 +24932,7 @@ As a side note, the assignment @samp{LC_ALL=C} in the @command{sort}
command ensures traditional Unix (ASCII) sorting from @command{sort}.
@cindex @command{gawk}, @code{PROCINFO} array in
-@cindex @code{PROCINFO} array
+@cindex @code{PROCINFO} array, and communications via ptys
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 basis, by setting a special element
@@ -25048,8 +25135,8 @@ Here is the @file{awkprof.out} that results from running the
illustrates that @command{awk} programmers sometimes get up very early
in the morning to work.)
-@cindex @code{BEGIN} pattern
-@cindex @code{END} pattern
+@cindex @code{BEGIN} pattern, and profiling
+@cindex @code{END} pattern, and profiling
@example
# gawk profile, created Thu Feb 27 05:16:21 2014
@@ -25113,7 +25200,7 @@ Multiple @code{BEGIN} and @code{END} rules retain their
separate identities, as do
multiple @code{BEGINFILE} and @code{ENDFILE} rules.
-@cindex patterns, counts
+@cindex patterns, counts, in a profile
@item
Pattern-action rules have two counts.
The first count, to the left of the rule, shows how many times
@@ -25133,7 +25220,7 @@ is a count showing how many times the condition was true.
The count for the @code{else}
indicates how many times the test failed.
-@cindex loops, count for header
+@cindex loops, count for header, in a profile
@item
The count for a loop header (such as @code{for}
or @code{while}) shows how many times the loop test was executed.
@@ -25141,8 +25228,8 @@ or @code{while}) shows how many times the loop test was executed.
statement in a rule to determine how many times the rule was executed.
If the first statement is a loop, the count is misleading.)
-@cindex functions, user-defined, counts
-@cindex user-defined, functions, counts
+@cindex functions, user-defined, counts, in a profile
+@cindex user-defined, functions, counts, in a profile
@item
For user-defined functions, the count next to the @code{function}
keyword indicates how many times the function was called.
@@ -25156,8 +25243,8 @@ The layout uses ``K&R'' style with TABs.
Braces are used everywhere, even when
the body of an @code{if}, @code{else}, or loop is only a single statement.
-@cindex @code{()} (parentheses)
-@cindex parentheses @code{()}
+@cindex @code{()} (parentheses), in a profile
+@cindex parentheses @code{()}, in a profile
@item
Parentheses are used only where needed, as indicated by the structure
of the program and the precedence rules.
@@ -25213,6 +25300,7 @@ which is correct, but possibly surprising.
@cindex profiling @command{awk} programs, dynamically
@cindex @command{gawk} program, dynamic profiling
+@cindex dynamic profiling
Besides creating profiles when a program has completed,
@command{gawk} can produce a profile while it is running.
This is useful if your @command{awk} program goes into an
@@ -25226,9 +25314,9 @@ $ @kbd{gawk --profile -f myprog &}
@end example
@cindex @command{kill} command@comma{} dynamic profiling
-@cindex @code{USR1} signal
-@cindex @code{SIGUSR1} signal
-@cindex signals, @code{USR1}/@code{SIGUSR1}
+@cindex @code{USR1} signal, for dynamic profiling
+@cindex @code{SIGUSR1} signal, for dynamic profiling
+@cindex signals, @code{USR1}/@code{SIGUSR1}, for profiling
@noindent
The shell prints a job number and process ID number; in this case, 13992.
Use the @command{kill} command to send the @code{USR1} signal
@@ -25259,9 +25347,9 @@ You may send @command{gawk} the @code{USR1} signal as many times as you like.
Each time, the profile and function call trace are appended to the output
profile file.
-@cindex @code{HUP} signal
-@cindex @code{SIGHUP} signal
-@cindex signals, @code{HUP}/@code{SIGHUP}
+@cindex @code{HUP} signal, for dynamic profiling
+@cindex @code{SIGHUP} signal, for dynamic profiling
+@cindex signals, @code{HUP}/@code{SIGHUP}, for profiling
If you use the @code{HUP} signal instead of the @code{USR1} signal,
@command{gawk} produces the profile and the function call trace and then exits.
@@ -26175,6 +26263,7 @@ The following list defines terms used throughout the rest of
this @value{CHAPTER}.
@table @dfn
+@cindex stack frame
@item Stack Frame
Programs generally call functions during the course of their execution.
One function can call another, or a function can call itself (recursion).
@@ -26196,6 +26285,7 @@ invoked. Commands that print the call stack print information about
each stack frame (as detailed later on).
@item Breakpoint
+@cindex breakpoint
During debugging, you often wish to let the program run until it
reaches a certain point, and then continue execution from there one
statement (or instruction) at a time. The way to do this is to set
@@ -26205,6 +26295,7 @@ take over control of the program's execution. You can add and remove
as many breakpoints as you like.
@item Watchpoint
+@cindex watchpoint
A watchpoint is similar to a breakpoint. The difference is that
breakpoints are oriented around the code: stop when a certain point in the
code is reached. A watchpoint, however, specifies that program execution
@@ -26236,6 +26327,7 @@ by the higher-level @command{awk} commands.
@node Sample Debugging Session
@section Sample Debugging Session
+@cindex sample debugging session
In order to illustrate the use of @command{gawk} as a debugger, let's look at a sample
debugging session. We will use the @command{awk} implementation of the
@@ -26249,6 +26341,8 @@ as our example.
@node Debugger Invocation
@subsection How to Start the Debugger
+@cindex starting the debugger
+@cindex debugger, how to start
Starting the debugger is almost exactly like running @command{gawk},
except you have to pass an additional option @option{--debug} or the
@@ -26589,6 +26683,8 @@ controlling breakpoints are:
@cindex debugger commands, @code{break}
@cindex @code{break} debugger command
@cindex @code{b} debugger command (alias for @code{break})
+@cindex set breakpoint
+@cindex breakpoint, setting
@item @code{break} [[@var{filename}@code{:}]@var{n} | @var{function}] [@code{"@var{expression}"}]
@itemx @code{b} [[@var{filename}@code{:}]@var{n} | @var{function}] [@code{"@var{expression}"}]
Without any argument, set a breakpoint at the next instruction
@@ -26619,6 +26715,8 @@ it continues executing the program.
@cindex debugger commands, @code{clear}
@cindex @code{clear} debugger command
+@cindex delete breakpoint at location
+@cindex breakpoint at location, how to delete
@item @code{clear} [[@var{filename}@code{:}]@var{n} | @var{function}]
Without any argument, delete any breakpoint at the next instruction
to be executed in the selected stack frame. If the program stops at
@@ -26639,6 +26737,7 @@ Delete breakpoint(s) set at entry to function @var{function}.
@cindex debugger commands, @code{condition}
@cindex @code{condition} debugger command
+@cindex breakpoint condition
@item @code{condition} @var{n} @code{"@var{expression}"}
Add a condition to existing breakpoint or watchpoint @var{n}. The
condition is an @command{awk} expression that the debugger evaluates
@@ -26652,6 +26751,8 @@ watchpoint is made unconditional.
@cindex debugger commands, @code{delete}
@cindex @code{delete} debugger command
@cindex @code{d} debugger command (alias for @code{delete})
+@cindex delete breakpoint by number
+@cindex breakpoint, delete by number
@item @code{delete} [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
@itemx @code{d} [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
Delete specified breakpoints or a range of breakpoints. Deletes
@@ -26659,6 +26760,8 @@ all defined breakpoints if no argument is supplied.
@cindex debugger commands, @code{disable}
@cindex @code{disable} debugger command
+@cindex disable breakpoint
+@cindex breakpoint, how to disable or enable
@item @code{disable} [@var{n1 n2} @dots{} | @var{n}--@var{m}]
Disable specified breakpoints or a range of breakpoints. Without
any argument, disables all breakpoints.
@@ -26667,6 +26770,7 @@ any argument, disables all breakpoints.
@cindex debugger commands, @code{enable}
@cindex @code{enable} debugger command
@cindex @code{e} debugger command (alias for @code{enable})
+@cindex enable breakpoint
@item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
@itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}]
Enable specified breakpoints or a range of breakpoints. Without
@@ -26686,6 +26790,7 @@ the program stops at the breakpoint.
@cindex debugger commands, @code{ignore}
@cindex @code{ignore} debugger command
+@cindex ignore breakpoint
@item @code{ignore} @var{n} @var{count}
Ignore breakpoint number @var{n} the next @var{count} times it is
hit.
@@ -26694,6 +26799,7 @@ hit.
@cindex debugger commands, @code{tbreak}
@cindex @code{tbreak} debugger command
@cindex @code{t} debugger command (alias for @code{tbreak})
+@cindex temporary breakpoint
@item @code{tbreak} [[@var{filename}@code{:}]@var{n} | @var{function}]
@itemx @code{t} [[@var{filename}@code{:}]@var{n} | @var{function}]
Set a temporary breakpoint (enabled for only one stop).
@@ -26714,6 +26820,8 @@ execution of the program than we saw in our earlier example:
@cindex @code{silent} debugger command
@cindex debugger commands, @code{end}
@cindex @code{end} debugger command
+@cindex breakpoint commands
+@cindex commands to execute at breakpoint
@item @code{commands} [@var{n}]
@itemx @code{silent}
@itemx @dots{}
@@ -26741,6 +26849,7 @@ gawk>
@cindex debugger commands, @code{c} (@code{continue})
@cindex debugger commands, @code{continue}
+@cindex continue program, in debugger
@item @code{continue} [@var{count}]
@itemx @code{c} [@var{count}]
Resume program execution. If continued from a breakpoint and @var{count} is
@@ -26757,6 +26866,7 @@ Print the returned value.
@cindex debugger commands, @code{next}
@cindex @code{next} debugger command
@cindex @code{n} debugger command (alias for @code{next})
+@cindex single-step execution, in the debugger
@item @code{next} [@var{count}]
@itemx @code{n} [@var{count}]
Continue execution to the next source line, stepping over function calls.
@@ -26851,6 +26961,7 @@ items on the list.
@cindex debugger commands, @code{eval}
@cindex @code{eval} debugger command
+@cindex evaluate expressions, in debugger
@item @code{eval "@var{awk statements}"}
Evaluate @var{awk statements} in the context of the running program.
You can do anything that an @command{awk} program would do: assign
@@ -26868,6 +26979,7 @@ parameters defined by the program.
@cindex debugger commands, @code{print}
@cindex @code{print} debugger command
@cindex @code{p} debugger command (alias for @code{print})
+@cindex print variables, in debugger
@item @code{print} @var{var1}[@code{,} @var{var2} @dots{}]
@itemx @code{p} @var{var1}[@code{,} @var{var2} @dots{}]
Print the value of a @command{gawk} variable or field.
@@ -26901,6 +27013,7 @@ No newline is printed unless one is specified.
@cindex debugger commands, @code{set}
@cindex @code{set} debugger command
+@cindex assign values to variables, in debugger
@item @code{set} @var{var}@code{=}@var{value}
Assign a constant (number or string) value to an @command{awk} variable
or field.
@@ -26913,6 +27026,7 @@ You can also set special @command{awk} variables, such as @code{FS},
@cindex debugger commands, @code{watch}
@cindex @code{watch} debugger command
@cindex @code{w} debugger command (alias for @code{watch})
+@cindex set watchpoint
@item @code{watch} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
@itemx @code{w} @var{var} | @code{$}@var{n} [@code{"@var{expression}"}]
Add variable @var{var} (or field @code{$@var{n}}) to the watch list.
@@ -26929,12 +27043,14 @@ then the debugger stops execution and prompts for a command. Otherwise,
@cindex debugger commands, @code{undisplay}
@cindex @code{undisplay} debugger command
+@cindex stop automatic display, in debugger
@item @code{undisplay} [@var{n}]
Remove item number @var{n} (or all items, if no argument) from the
automatic display list.
@cindex debugger commands, @code{unwatch}
@cindex @code{unwatch} debugger command
+@cindex delete watchpoint
@item @code{unwatch} [@var{n}]
Remove item number @var{n} (or all items, if no argument) from the
watch list.
@@ -26955,6 +27071,8 @@ functions which called the one you are in. The commands for doing this are:
@cindex debugger commands, @code{backtrace}
@cindex @code{backtrace} debugger command
@cindex @code{bt} debugger command (alias for @code{backtrace})
+@cindex call stack, display in debugger
+@cindex traceback, display in debugger
@item @code{backtrace} [@var{count}]
@itemx @code{bt} [@var{count}]
Print a backtrace of all function calls (stack frames), or innermost @var{count}
@@ -27008,25 +27126,32 @@ The value for @var{what} should be one of the following:
@c nested table
@table @code
@item args
+@cindex show function arguments, in debugger
Arguments of the selected frame.
@item break
+@cindex show breakpoints
List all currently set breakpoints.
@item display
+@cindex automatic displays, in debugger
List all items in the automatic display list.
@item frame
+@cindex describe call stack frame, in debugger
Description of the selected stack frame.
@item functions
+@cindex list function definitions, in debugger
List all function definitions including source file names and
line numbers.
@item locals
+@cindex show local variables, in debugger
Local variables of the selected frame.
@item source
+@cindex show name of current source file, in debugger
The name of the current source file. Each time the program stops, the
current source file is the file containing the current instruction.
When the debugger first starts, the current source file is the first file
@@ -27035,12 +27160,15 @@ included via the @option{-f} option. The
be used at any time to change the current source.
@item sources
+@cindex show all source files, in debugger
List all program sources.
@item variables
+@cindex list all global variables, in debugger
List all global variables.
@item watch
+@cindex show watchpoints
List all items in the watch list.
@end table
@end table
@@ -27054,6 +27182,8 @@ from a file. The commands are:
@cindex debugger commands, @code{option}
@cindex @code{option} debugger command
@cindex @code{o} debugger command (alias for @code{option})
+@cindex display debugger options
+@cindex debugger options
@item @code{option} [@var{name}[@code{=}@var{value}]]
@itemx @code{o} [@var{name}[@code{=}@var{value}]]
Without an argument, display the available debugger options
@@ -27065,6 +27195,7 @@ The available options are:
@c nested table
@table @code
@item history_size
+@cindex debugger history size
The maximum number of lines to keep in the history file @file{./.gawk_history}.
The default is 100.
@@ -27072,23 +27203,28 @@ The default is 100.
The number of lines that @code{list} prints. The default is 15.
@item outfile
+@cindex redirect @command{gawk} output, in debugger
Send @command{gawk} output to a file; debugger output still goes
to standard output. An empty string (@code{""}) resets output to
standard output.
@item prompt
+@cindex debugger prompt
The debugger prompt. The default is @samp{@w{gawk> }}.
@item save_history @r{[}on @r{|} off@r{]}
+@cindex debugger history file
Save command history to file @file{./.gawk_history}.
The default is @code{on}.
@item save_options @r{[}on @r{|} off@r{]}
+@cindex save debugger options
Save current options to file @file{./.gawkrc} upon exit.
The default is @code{on}.
Options are read back in to the next session upon startup.
@item trace @r{[}on @r{|} off@r{]}
+@cindex instruction tracing, in debugger
Turn instruction tracing on or off. The default is @code{off}.
@end table
@@ -27097,6 +27233,7 @@ Save the commands from the current session to the given file name,
so that they can be replayed using the @command{source} command.
@item @code{source} @var{filename}
+@cindex debugger, read commands from a file
Run command(s) from a file; an error in any command does not
terminate execution of subsequent commands. Comments (lines starting
with @samp{#}) are allowed in a command file.
@@ -27229,6 +27366,7 @@ function @var{function}. This command may change the current source file.
@cindex debugger commands, @code{quit}
@cindex @code{quit} debugger command
@cindex @code{q} debugger command (alias for @code{quit})
+@cindex exit the debugger
@item @code{quit}
@itemx @code{q}
Exit the debugger. Debugging is great fun, but sometimes we all have
@@ -27252,6 +27390,8 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while
@node Readline Support
@section Readline Support
+@cindex command completion, in debugger
+@cindex history expansion, in debugger
If @command{gawk} is compiled with the @code{readline} library, you
can take advantage of that library's command completion and history expansion
@@ -27340,8 +27480,6 @@ be added, and of course feel free to try to add them yourself!
@cindex multiple precision
@cindex infinite precision
@cindex floating-point, numbers@comma{} arbitrary precision
-@cindex MPFR
-@cindex GMP
@cindex Knuth, Donald
@quotation
@@ -28105,6 +28243,8 @@ when you change the rounding mode.
@node Gawk and MPFR
@section @command{gawk} + MPFR = Powerful Arithmetic
+@cindex MPFR
+@cindex GMP
The rest of this @value{CHAPTER} describes how to use the arbitrary precision
(also known as @dfn{multiple precision} or @dfn{infinite precision}) numeric
@@ -28209,6 +28349,7 @@ your program.
@node Setting Precision
@subsection Setting the Working Precision
@cindex @code{PREC} variable
+@cindex setting working precision
@command{gawk} uses a global working precision; it does not keep track of
the precision or accuracy of individual numbers. Performing an arithmetic
@@ -28284,6 +28425,7 @@ issues that occur because numbers are stored internally in binary.
@node Setting Rounding Mode
@subsection Setting the Rounding Mode
@cindex @code{ROUNDMODE} variable
+@cindex setting rounding mode
The @code{ROUNDMODE} variable provides
program level control over the rounding mode.
@@ -28351,6 +28493,7 @@ In the first case, the number is stored with the default precision of 53 bits.
@node Changing Precision
@subsection Changing the Precision of a Number
+@cindex changing precision of a number
@cindex Laurie, Dirk
@quotation
@@ -28469,6 +28612,7 @@ the problem at hand is often the correct approach in such situations.
@node Arbitrary Precision Integers
@section Arbitrary Precision Integer Arithmetic with @command{gawk}
@cindex integers, arbitrary precision
+@cindex arbitrary precision integers
If one of the options @option{--bignum} or @option{-M} is specified,
@command{gawk} performs all
@@ -28565,6 +28709,7 @@ gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@node Dynamic Extensions
@chapter Writing Extensions for @command{gawk}
+@cindex dynamically loaded extensions
It is possible to add new functions written in C or C++ to @command{gawk} using
dynamically loaded libraries. This facility is available on systems
@@ -28599,6 +28744,7 @@ When @option{--sandbox} is specified, extensions are disabled
@node Extension Intro
@section Introduction
+@cindex plug-in
An @dfn{extension} (sometimes called a @dfn{plug-in}) is a piece of
external compiled code that @command{gawk} can load at runtime to
provide additional functionality, over and above the built-in capabilities
@@ -28727,6 +28873,7 @@ happen, but we all know how @emph{that} goes.)
@node Extension API Description
@section API Description
+@cindex extension API
This (rather large) @value{SECTION} describes the API in detail.
@@ -29111,6 +29258,8 @@ value type, as appropriate. This behavior is summarized in
@node Memory Allocation Functions
@subsection Memory Allocation Functions and Convenience Macros
+@cindex allocating memory for extensions
+@cindex extensions, allocating memory
The API provides a number of @dfn{memory allocation} functions for
allocating memory that can be passed to @command{gawk}, as well as a number of
@@ -29225,6 +29374,8 @@ pointed to by @code{result}.
@node Registration Functions
@subsection Registration Functions
+@cindex register extension
+@cindex extension registration
This @value{SECTION} describes the API functions for
registering parts of your extension with @command{gawk}.
@@ -29346,6 +29497,7 @@ is invoked with the @option{--version} option.
@node Input Parsers
@subsubsection Customized Input Parsers
+@cindex customized input parser
By default, @command{gawk} reads text files as its input. It uses the value
of @code{RS} to find the end of the record, and then uses @code{FS}
@@ -29593,7 +29745,9 @@ Register the input parser pointed to by @code{input_parser} with
@node Output Wrappers
@subsubsection Customized Output Wrappers
+@cindex customized output wrapper
+@cindex output wrapper
An @dfn{output wrapper} is the mirror image of an input parser.
It allows an extension to take over the output to a file opened
with the @samp{>} or @samp{>>} I/O redirection operators (@pxref{Redirection}).
@@ -29707,6 +29861,7 @@ Register the output wrapper pointed to by @code{output_wrapper} with
@node Two-way processors
@subsubsection Customized Two-way Processors
+@cindex customized two-way processor
A @dfn{two-way processor} combines an input parser and an output wrapper for
two-way I/O with the @samp{|&} operator (@pxref{Redirection}). It makes identical
@@ -29764,6 +29919,8 @@ Register the two-way processor pointed to by @code{two_way_processor} with
@node Printing Messages
@subsection Printing Messages
+@cindex printing messages from extensions
+@cindex messages from extensions
You can print different kinds of warning messages from your
extension, as described below. Note that for these functions,
@@ -29837,6 +29994,7 @@ for more information on creating arrays.
@node Symbol Table Access
@subsection Symbol Table Access
+@cindex accessing global variables from extensions
Two sets of routines provide access to global variables, and one set
allows you to create and release cached values.
@@ -30094,6 +30252,7 @@ you should release any cached values that you created, using
@node Array Manipulation
@subsection Array Manipulation
+@cindex array manipulation in extensions
The primary data structure@footnote{Okay, the only data structure.} in @command{awk}
is the associative array (@pxref{Arrays}).
@@ -30673,6 +30832,8 @@ information about how @command{gawk} was invoked.
@node Extension Versioning
@subsubsection API Version Constants and Variables
+@cindex API version
+@cindex extension API version
The API provides both a ``major'' and a ``minor'' version number.
The API versions are available at compile time as constants:
@@ -30726,6 +30887,8 @@ provided in @file{gawkapi.h} (discussed later, in
@node Extension API Informational Variables
@subsubsection Informational Variables
+@cindex API informational variables
+@cindex extension API informational variables
The API provides access to several variables that describe
whether the corresponding command-line options were enabled when
@@ -30871,6 +31034,8 @@ the version string with @command{gawk}.
@node Finding Extensions
@section How @command{gawk} Finds Extensions
+@cindex extension search path
+@cindex finding extensions
Compiled extensions have to be installed in a directory where
@command{gawk} can find them. If @command{gawk} is configured and
@@ -30881,6 +31046,7 @@ path with a list of directories to search for compiled extensions.
@node Extension Example
@section Example: Some File Functions
+@cindex extension example
@quotation
@i{No matter where you go, there you are.}
@@ -31525,6 +31691,7 @@ $ @kbd{AWKLIBPATH=$PWD gawk -f testff.awk}
@node Extension Samples
@section The Sample Extensions In The @command{gawk} Distribution
+@cindex extensions distributed with @command{gawk}
This @value{SECTION} provides brief overviews of the sample extensions
that come in the @command{gawk} distribution. Some of them are intended
@@ -32185,6 +32352,8 @@ tries to use @code{nanosleep()} or @code{select()} to implement the delay.
@node gawkextlib
@section The @code{gawkextlib} Project
+@cindex @code{gawkextlib}
+@cindex extensions, where to find
@cindex @code{gawkextlib} project
The @uref{http://sourceforge.net/projects/gawkextlib/, @code{gawkextlib}}