diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 999 |
1 files changed, 546 insertions, 453 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 3dd9d731..13245683 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -654,12 +654,13 @@ inconvenient. Such jobs are often easier with `awk'. The `awk' utility interprets a special-purpose programming language that makes it easy to handle simple data-reformatting jobs. - The GNU implementation of `awk' is called `gawk'; it is fully -compatible with the POSIX(1) specification of the `awk' language and -with the Unix version of `awk' maintained by Brian Kernighan. This -means that all properly written `awk' programs should work with `gawk'. -Thus, we usually don't distinguish between `gawk' and other `awk' -implementations. + The GNU implementation of `awk' is called `gawk'; if you invoke it +with the proper options or environment variables (*note Options::), it +is fully compatible with the POSIX(1) specification of the `awk' +language and with the Unix version of `awk' maintained by Brian +Kernighan. This means that all properly written `awk' programs should +work with `gawk'. Thus, we usually don't distinguish between `gawk' +and other `awk' implementations. Using `awk' allows you to: @@ -2443,12 +2444,15 @@ source code. If the environment variable `POSIXLY_CORRECT' exists, then `gawk' behaves in strict POSIX mode, exactly as if you had supplied the `--posix' command-line option. Many GNU programs look for this -environment variable to turn on strict POSIX mode. If `--lint' is -supplied on the command line and `gawk' turns on POSIX mode because of -`POSIXLY_CORRECT', then it issues a warning message indicating that -POSIX mode is in effect. You would typically set this variable in your -shell's startup file. For a Bourne-compatible shell (such as Bash), -you would add these lines to the `.profile' file in your home directory: +environment variable to suppress extensions that conflict with POSIX, +but `gawk' behaves differently: it suppresses all extensions, even +those that do not conflict with POSIX, and behaves in strict POSIX +mode. If `--lint' is supplied on the command line and `gawk' turns on +POSIX mode because of `POSIXLY_CORRECT', then it issues a warning +message indicating that POSIX mode is in effect. You would typically +set this variable in your shell's startup file. For a +Bourne-compatible shell (such as Bash), you would add these lines to +the `.profile' file in your home directory: POSIXLY_CORRECT=true export POSIXLY_CORRECT @@ -8109,6 +8113,9 @@ inside Boolean patterns. Likewise, the special patterns `BEGIN', `END', `BEGINFILE' and `ENDFILE', which never match any input record, are not expressions and cannot appear inside Boolean patterns. + The precedence of the different operators which can appear in +patterns is described in *note Precedence::. + File: gawk.info, Node: Ranges, Next: BEGIN/END, Prev: Expression Patterns, Up: Pattern Overview @@ -8336,7 +8343,8 @@ would otherwise be difficult or impossible to perform: The `ENDFILE' rule is called when `gawk' has finished processing the last record in an input file. For the last input file, it will be -called before any `END' rules. +called before any `END' rules. The `ENDFILE' rule is executed even for +empty input files. Normally, when an error occurs when reading input in the normal input processing loop, the error is fatal. However, if an `ENDFILE' rule is @@ -8960,13 +8968,16 @@ implementations, or if `gawk' is in compatibility mode (*note Options::), `nextfile' is not special. Upon execution of the `nextfile' statement, any `ENDFILE' rules are -executed, `FILENAME' is updated to the name of the next data file -listed on the command line, `FNR' is reset to one, `ARGIND' is -incremented, any `BEGINFILE' rules are executed, and processing starts -over with the first rule in the program. (`ARGIND' hasn't been -introduced yet. *Note Built-in Variables::.) If the `nextfile' -statement causes the end of the input to be reached, then the code in -any `END' rules is executed. *Note BEGIN/END::. +executed except in the case as mentioned below, `FILENAME' is updated +to the name of the next data file listed on the command line, `FNR' is +reset to one, `ARGIND' is incremented, any `BEGINFILE' rules are +executed, and processing starts over with the first rule in the program. +(`ARGIND' hasn't been introduced yet. *Note Built-in Variables::.) If +the `nextfile' statement causes the end of the input to be reached, +then the code in any `END' rules is executed. An exception to this is +when the `nextfile' is invoked during execution of any statement in an +`END' rule; In this case, it causes the program to stop immediately. +*Note BEGIN/END::. The `nextfile' statement is useful when there are many data files to process but it isn't necessary to process every record in every file. @@ -8976,7 +8987,8 @@ accomplishes this much more efficiently. In addition, `nextfile' is useful inside a `BEGINFILE' rule to skip over a file that would otherwise cause `gawk' to exit with a fatal -error. *Note BEGINFILE/ENDFILE::. +error. In this case, `ENDFILE' rules are not executed. *Note +BEGINFILE/ENDFILE::. While one might think that `close(FILENAME)' would accomplish the same as `nextfile', this isn't true. `close()' is reserved for closing @@ -11153,6 +11165,62 @@ backslashes entered at the lexical level.) The problem with the historical approach is that there is no way to get a literal `\' followed by the matched text. + The 1992 POSIX standard attempted to fix this problem. That standard +says that `sub()' and `gsub()' look for either a `\' or an `&' after +the `\'. If either one follows a `\', that character is output +literally. The interpretation of `\' and `&' then becomes as shown in +*note table-sub-posix-92::. + + You type `sub()' sees `sub()' generates + ------- --------- -------------- + `&' `&' the matched text + `\\&' `\&' a literal `&' + `\\\\&' `\\&' a literal `\', then the matched text + `\\\\\\&' `\\\&' a literal `\&' + +Table 9.2: 1992 POSIX Rules for sub and gsub Escape Sequence Processing + +This appears to solve the problem. Unfortunately, the phrasing of the +standard is unusual. It says, in effect, that `\' turns off the special +meaning of any following character, but for anything other than `\' and +`&', such special meaning is undefined. This wording leads to two +problems: + + * Backslashes must now be doubled in the REPLACEMENT string, breaking + historical `awk' programs. + + * To make sure that an `awk' program is portable, _every_ character + in the REPLACEMENT string must be preceded with a backslash.(1) + + Because of the problems just listed, in 1996, the `gawk' maintainer +submitted proposed text for a revised standard that reverts to rules +that correspond more closely to the original existing practice. The +proposed rules have special cases that make it possible to produce a +`\' preceding the matched text. This is shown in *note +table-sub-proposed::. + + You type `sub()' sees `sub()' generates + ------- --------- -------------- + `\\\\\\&' `\\\&' a literal `\&' + `\\\\&' `\\&' a literal `\', followed by the matched text + `\\&' `\&' a literal `&' + `\\q' `\q' a literal `\q' + `\\\\' `\\' `\\' + +Table 9.3: Proposed rules for sub and backslash + + In a nutshell, at the runtime level, there are now three special +sequences of characters (`\\\&', `\\&' and `\&') whereas historically +there was only one. However, as in the historical case, any `\' that +is not part of one of these three sequences is not special and appears +in the output literally. + + `gawk' 3.0 and 3.1 follow these proposed POSIX rules for `sub()' and +`gsub()'. The POSIX standard took much longer to be revised than was +expected in 1996. The 2001 standard does not follow the above rules. +Instead, the rules there are somewhat simpler. The results are similar +except for one case. + The POSIX rules state that `\&' in the replacement string produces a literal `&', `\\' produces a literal `\', and `\' followed by anything else is not special; the `\' is placed straight into the output. These @@ -11166,9 +11234,21 @@ rules are presented in *note table-posix-sub::. `\\q' `\q' a literal `\q' `\\\\' `\\' `\' -Table 9.2: POSIX rules for `sub()' and `gsub()' +Table 9.4: POSIX rules for `sub()' and `gsub()' - `gawk' follows the POSIX rules. + The only case where the difference is noticeable is the last one: +`\\\\' is seen as `\\' and produces `\' instead of `\\'. + + Starting with version 3.1.4, `gawk' followed the POSIX rules when +`--posix' is specified (*note Options::). Otherwise, it continued to +follow the 1996 proposed rules, since that had been its behavior for +many years. + + When version 4.0.0, was released, the `gawk' maintainer made the +POSIX rules the default, breaking well over a decade's worth of +backwards compatibility.(2) Needless to say, this was a bad idea, and +as of version 4.0.1, `gawk' resumed its historical behavior, and only +follows the POSIX rules when `--posix' is given. The rules for `gensub()' are considerably simpler. At the runtime level, whenever `gawk' sees a `\', if the following character is a @@ -11186,7 +11266,7 @@ the `\' does not, as shown in *note table-gensub-escapes::. `\\\\\\&' `\\\&' a literal `\&' `\\q' `\q' a literal `q' -Table 9.3: Escape Sequence Processing for `gensub()' +Table 9.5: Escape Sequence Processing for `gensub()' Because of the complexity of the lexical and runtime level processing and the special cases for `sub()' and `gsub()', we recommend the use of @@ -11204,6 +11284,14 @@ functions. For example: Although this makes a certain amount of sense, it can be surprising. + ---------- Footnotes ---------- + + (1) This consequence was certainly unintended. + + (2) This was rather naive of him, despite there being a note in this +section indicating that the next major version would move to the POSIX +rules. + File: gawk.info, Node: I/O Functions, Next: Time Functions, Prev: String Functions, Up: Built-in @@ -11727,7 +11815,7 @@ table-bitwise-ops::. 0 | 0 0 | 0 1 | 0 1 1 | 0 1 | 1 1 | 1 0 -Table 9.4: Bitwise Operations +Table 9.6: Bitwise Operations As you can see, the result of an AND operation is 1 only when _both_ bits are 1. The result of an OR operation is 1 if _either_ bit is 1. @@ -13711,7 +13799,7 @@ affect the loop. -| 4 4 -| 3 3 $ gawk 'BEGIN { - > PROCINFO["sorted_in"] = "@str_ind_asc" + > PROCINFO["sorted_in"] = "@ind_str_asc" > a[4] = 4 > a[3] = 3 > for (i in a) @@ -24621,7 +24709,7 @@ Index * * (asterisk), * operator, as regexp operator: Regexp Operators. (line 87) * * (asterisk), * operator, null strings, matching: Gory Details. - (line 96) + (line 164) * * (asterisk), ** operator <1>: Precedence. (line 49) * * (asterisk), ** operator: Arithmetic Ops. (line 81) * * (asterisk), **= operator <1>: Precedence. (line 95) @@ -24861,7 +24949,7 @@ Index (line 23) * advanced features, network connections, See Also networks, connections: Advanced Features. (line 6) -* advanced features, null strings, matching: Gory Details. (line 96) +* advanced features, null strings, matching: Gory Details. (line 164) * advanced features, operators, precedence: Increment Ops. (line 61) * advanced features, piping into sh: Redirection. (line 143) * advanced features, regexp constants: Assignment Ops. (line 148) @@ -24958,7 +25046,7 @@ Index * asterisk (*), * operator, as regexp operator: Regexp Operators. (line 87) * asterisk (*), * operator, null strings, matching: Gory Details. - (line 96) + (line 164) * asterisk (*), ** operator <1>: Precedence. (line 49) * asterisk (*), ** operator: Arithmetic Ops. (line 81) * asterisk (*), **= operator <1>: Precedence. (line 95) @@ -24992,7 +25080,7 @@ Index (line 6) * awk, function of: Getting Started. (line 6) * awk, gawk and <1>: This Manual. (line 14) -* awk, gawk and: Preface. (line 22) +* awk, gawk and: Preface. (line 23) * awk, history of: History. (line 17) * awk, implementation issues, pipes: Redirection. (line 135) * awk, implementations: Other Versions. (line 6) @@ -25000,15 +25088,15 @@ Index * awk, invoking: Command Line. (line 6) * awk, new vs. old: Names. (line 6) * awk, new vs. old, OFMT variable: Conversion. (line 55) -* awk, POSIX and: Preface. (line 22) -* awk, POSIX and, See Also POSIX awk: Preface. (line 22) +* awk, POSIX and: Preface. (line 23) +* awk, POSIX and, See Also POSIX awk: Preface. (line 23) * awk, regexp constants and: Comparison Operators. (line 103) -* awk, See Also gawk: Preface. (line 35) +* awk, See Also gawk: Preface. (line 36) * awk, terms describing: This Manual. (line 6) * awk, uses for <1>: When. (line 6) * awk, uses for <2>: Getting Started. (line 12) -* awk, uses for: Preface. (line 22) +* awk, uses for: Preface. (line 23) * awk, versions of <1>: V7/SVR3.1. (line 6) * awk, versions of: Names. (line 10) * awk, versions of, changes between SVR3.1 and SVR4: SVR4. (line 6) @@ -25323,7 +25411,7 @@ Index * cos() function: Numeric Functions. (line 14) * counting: Wc Program. (line 6) * csh utility: Statements/Lines. (line 44) -* csh utility, POSIXLY_CORRECT environment variable: Options. (line 302) +* csh utility, POSIXLY_CORRECT environment variable: Options. (line 305) * csh utility, |& operator, comparison with: Two-way I/O. (line 44) * ctime() user-defined function: Function Example. (line 72) * currency symbols, localization: Explaining gettext. (line 103) @@ -25925,14 +26013,14 @@ Index * functions, user-defined, counts: Profiling. (line 132) * functions, user-defined, library of: Library Functions. (line 6) * functions, user-defined, next/nextfile statements and <1>: Nextfile Statement. - (line 40) + (line 44) * functions, user-defined, next/nextfile statements and: Next Statement. (line 45) * G-d: Acknowledgments. (line 81) * Garfinkle, Scott: Contributors. (line 35) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) -* gawk, awk and: Preface. (line 22) +* gawk, awk and: Preface. (line 23) * gawk, bitwise operations in: Bitwise Functions. (line 39) * gawk, break statement in: Break Statement. (line 51) * gawk, built-in variables and: Built-in Variables. (line 14) @@ -26013,13 +26101,13 @@ Index (line 10) * gawk, RT variable in <3>: Multiple Line. (line 129) * gawk, RT variable in: Records. (line 112) -* gawk, See Also awk: Preface. (line 35) +* gawk, See Also awk: Preface. (line 36) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 87) * gawk, string-translation functions: I18N Functions. (line 6) * gawk, TEXTDOMAIN variable in: User-modified. (line 153) * gawk, timestamps: Time Functions. (line 6) -* gawk, uses for: Preface. (line 35) +* gawk, uses for: Preface. (line 36) * gawk, versions of, information about, printing: Options. (line 250) * gawk, VMS version of: VMS Installation. (line 6) * gawk, word-boundary operator: GNU Regexp Operators. @@ -26059,7 +26147,7 @@ Index * getline command, return values: Getline. (line 19) * getline command, variants: Getline Summary. (line 6) * getline statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE. - (line 53) + (line 54) * getopt() function (C library): Getopt Function. (line 15) * getopt() user-defined function: Getopt Function. (line 108) * getpwent() function (C library): Passwd Functions. (line 16) @@ -26074,7 +26162,7 @@ Index * gettimeofday() user-defined function: Gettimeofday Function. (line 16) * GNITS mailing list: Acknowledgments. (line 52) -* GNU awk, See gawk: Preface. (line 48) +* GNU awk, See gawk: Preface. (line 49) * GNU Free Documentation License: GNU Free Documentation License. (line 6) * GNU General Public License: Glossary. (line 310) @@ -26382,7 +26470,7 @@ Index * matching, expressions, See comparison expressions: Typing and Comparison. (line 9) * matching, leftmost longest: Multiple Line. (line 26) -* matching, null strings: Gory Details. (line 96) +* matching, null strings: Gory Details. (line 164) * mawk program: Other Versions. (line 35) * McPhee, Patrick: Contributors. (line 100) * memory, releasing: Internals. (line 101) @@ -26431,7 +26519,7 @@ Index * next statement: Boolean Ops. (line 85) * next statement, BEGIN/END patterns and: I/O And BEGIN/END. (line 37) * next statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE. - (line 48) + (line 49) * next statement, user-defined functions and: Next Statement. (line 45) * nextfile statement: Nextfile Statement. (line 6) * nextfile statement, BEGIN/END patterns and: I/O And BEGIN/END. @@ -26439,7 +26527,7 @@ Index * nextfile statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE. (line 26) * nextfile statement, user-defined functions and: Nextfile Statement. - (line 40) + (line 44) * nexti debugger command: Dgawk Execution Control. (line 49) * NF variable <1>: Auto-set. (line 107) @@ -26463,7 +26551,7 @@ Index * null strings, as array subscripts: Uninitialized Subscripts. (line 43) * null strings, converting numbers to strings: Conversion. (line 21) -* null strings, matching: Gory Details. (line 96) +* null strings, matching: Gory Details. (line 164) * null strings, quoting and: Quoting. (line 62) * number sign (#), #! (executable scripts): Executable Scripts. (line 6) @@ -26642,7 +26730,7 @@ Index * portability, NF variable, decrementing: Changing Fields. (line 115) * portability, operators: Increment Ops. (line 61) * portability, operators, not in POSIX awk: Precedence. (line 98) -* portability, POSIXLY_CORRECT environment variable: Options. (line 307) +* portability, POSIXLY_CORRECT environment variable: Options. (line 310) * portability, substr() function: String Functions. (line 512) * portable object files <1>: Translator i18n. (line 6) * portable object files: Explaining gettext. (line 36) @@ -26679,6 +26767,7 @@ Index * POSIX awk, field separators and: Fields. (line 6) * 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 175) * POSIX awk, GNU long options and: Options. (line 15) * POSIX awk, interval expressions in: Regexp Operators. (line 135) @@ -26692,7 +26781,7 @@ Index * POSIX awk, timestamps and: Time Functions. (line 6) * POSIX awk, | I/O operator and: Getline/Pipe. (line 52) * POSIX mode: Options. (line 199) -* POSIX, awk and: Preface. (line 22) +* POSIX, awk and: Preface. (line 23) * POSIX, gawk extensions not included in: POSIX/GNU. (line 6) * POSIX, programs, implementing in awk: Clones. (line 6) * POSIXLY_CORRECT environment variable: Options. (line 289) @@ -27364,411 +27453,415 @@ Tag Table: Node: Top1346 Node: Foreword33440 Node: Preface37785 -Ref: Preface-Footnote-140752 -Ref: Preface-Footnote-240858 -Node: History41090 -Node: Names43481 -Ref: Names-Footnote-144958 -Node: This Manual45030 -Ref: This Manual-Footnote-149977 -Node: Conventions50077 -Node: Manual History52211 -Ref: Manual History-Footnote-155481 -Ref: Manual History-Footnote-255522 -Node: How To Contribute55596 -Node: Acknowledgments56740 -Node: Getting Started61071 -Node: Running gawk63450 -Node: One-shot64636 -Node: Read Terminal65861 -Ref: Read Terminal-Footnote-167511 -Ref: Read Terminal-Footnote-267787 -Node: Long67958 -Node: Executable Scripts69334 -Ref: Executable Scripts-Footnote-171203 -Ref: Executable Scripts-Footnote-271305 -Node: Comments71756 -Node: Quoting74223 -Node: DOS Quoting78846 -Node: Sample Data Files79521 -Node: Very Simple82553 -Node: Two Rules87152 -Node: More Complex89299 -Ref: More Complex-Footnote-192229 -Node: Statements/Lines92314 -Ref: Statements/Lines-Footnote-196776 -Node: Other Features97041 -Node: When97969 -Node: Invoking Gawk100116 -Node: Command Line101501 -Node: Options102284 -Ref: Options-Footnote-1115562 -Node: Other Arguments115587 -Node: Naming Standard Input118245 -Node: Environment Variables119339 -Node: AWKPATH Variable119783 -Ref: AWKPATH Variable-Footnote-1122380 -Node: Other Environment Variables122640 -Node: Exit Status124980 -Node: Include Files125655 -Node: Obsolete129140 -Node: Undocumented129826 -Node: Regexp130067 -Node: Regexp Usage131456 -Node: Escape Sequences133482 -Node: Regexp Operators139245 -Ref: Regexp Operators-Footnote-1146442 -Ref: Regexp Operators-Footnote-2146589 -Node: Bracket Expressions146687 -Ref: table-char-classes148577 -Node: GNU Regexp Operators151100 -Node: Case-sensitivity154823 -Ref: Case-sensitivity-Footnote-1157791 -Ref: Case-sensitivity-Footnote-2158026 -Node: Leftmost Longest158134 -Node: Computed Regexps159335 -Node: Reading Files162745 -Node: Records164686 -Ref: Records-Footnote-1173360 -Node: Fields173397 -Ref: Fields-Footnote-1176430 -Node: Nonconstant Fields176516 -Node: Changing Fields178718 -Node: Field Separators184696 -Node: Default Field Splitting187325 -Node: Regexp Field Splitting188442 -Node: Single Character Fields191784 -Node: Command Line Field Separator192843 -Node: Field Splitting Summary196284 -Ref: Field Splitting Summary-Footnote-1199476 -Node: Constant Size199577 -Node: Splitting By Content204161 -Ref: Splitting By Content-Footnote-1207887 -Node: Multiple Line207927 -Ref: Multiple Line-Footnote-1213774 -Node: Getline213953 -Node: Plain Getline216181 -Node: Getline/Variable218270 -Node: Getline/File219411 -Node: Getline/Variable/File220733 -Ref: Getline/Variable/File-Footnote-1222332 -Node: Getline/Pipe222419 -Node: Getline/Variable/Pipe224979 -Node: Getline/Coprocess226086 -Node: Getline/Variable/Coprocess227329 -Node: Getline Notes228043 -Node: Getline Summary229985 -Ref: table-getline-variants230328 -Node: Command line directories231184 -Node: Printing231809 -Node: Print233440 -Node: Print Examples234777 -Node: Output Separators237561 -Node: OFMT239321 -Node: Printf240679 -Node: Basic Printf241585 -Node: Control Letters243124 -Node: Format Modifiers246936 -Node: Printf Examples252945 -Node: Redirection255660 -Node: Special Files262644 -Node: Special FD263177 -Ref: Special FD-Footnote-1266802 -Node: Special Network266876 -Node: Special Caveats267726 -Node: Close Files And Pipes268522 -Ref: Close Files And Pipes-Footnote-1275545 -Ref: Close Files And Pipes-Footnote-2275693 -Node: Expressions275843 -Node: Values276975 -Node: Constants277651 -Node: Scalar Constants278331 -Ref: Scalar Constants-Footnote-1279190 -Node: Nondecimal-numbers279372 -Node: Regexp Constants282431 -Node: Using Constant Regexps282906 -Node: Variables285961 -Node: Using Variables286616 -Node: Assignment Options288340 -Node: Conversion290212 -Ref: table-locale-affects295588 -Ref: Conversion-Footnote-1296212 -Node: All Operators296321 -Node: Arithmetic Ops296951 -Node: Concatenation299456 -Ref: Concatenation-Footnote-1302249 -Node: Assignment Ops302369 -Ref: table-assign-ops307357 -Node: Increment Ops308765 -Node: Truth Values and Conditions312235 -Node: Truth Values313318 -Node: Typing and Comparison314367 -Node: Variable Typing315156 -Ref: Variable Typing-Footnote-1319053 -Node: Comparison Operators319175 -Ref: table-relational-ops319585 -Node: POSIX String Comparison323134 -Ref: POSIX String Comparison-Footnote-1324090 -Node: Boolean Ops324228 -Ref: Boolean Ops-Footnote-1328306 -Node: Conditional Exp328397 -Node: Function Calls330129 -Node: Precedence333723 -Node: Locales337392 -Node: Patterns and Actions338481 -Node: Pattern Overview339535 -Node: Regexp Patterns341201 -Node: Expression Patterns341744 -Node: Ranges345318 -Node: BEGIN/END348284 -Node: Using BEGIN/END349046 -Ref: Using BEGIN/END-Footnote-1351777 -Node: I/O And BEGIN/END351883 -Node: BEGINFILE/ENDFILE354165 -Node: Empty356998 -Node: Using Shell Variables357314 -Node: Action Overview359599 -Node: Statements361956 -Node: If Statement363810 -Node: While Statement365309 -Node: Do Statement367353 -Node: For Statement368509 -Node: Switch Statement371661 -Node: Break Statement373758 -Node: Continue Statement375748 -Node: Next Statement377535 -Node: Nextfile Statement379925 -Node: Exit Statement382222 -Node: Built-in Variables384638 -Node: User-modified385733 -Ref: User-modified-Footnote-1393759 -Node: Auto-set393821 -Ref: Auto-set-Footnote-1403112 -Node: ARGC and ARGV403317 -Node: Arrays407168 -Node: Array Basics408673 -Node: Array Intro409384 -Node: Reference to Elements413702 -Node: Assigning Elements415972 -Node: Array Example416463 -Node: Scanning an Array418195 -Node: Delete420861 -Ref: Delete-Footnote-1423296 -Node: Numeric Array Subscripts423353 -Node: Uninitialized Subscripts425536 -Node: Multi-dimensional427164 -Node: Multi-scanning430258 -Node: Arrays of Arrays431842 -Node: Functions436419 -Node: Built-in437241 -Node: Calling Built-in438319 -Node: Numeric Functions440307 -Ref: Numeric Functions-Footnote-1444072 -Ref: Numeric Functions-Footnote-2444429 -Ref: Numeric Functions-Footnote-3444477 -Node: String Functions444746 -Ref: String Functions-Footnote-1468243 -Ref: String Functions-Footnote-2468372 -Ref: String Functions-Footnote-3468620 -Node: Gory Details468707 -Ref: table-sub-escapes470386 -Ref: table-posix-sub471700 -Ref: table-gensub-escapes472613 -Node: I/O Functions473784 -Ref: I/O Functions-Footnote-1480439 -Node: Time Functions480586 -Ref: Time Functions-Footnote-1491478 -Ref: Time Functions-Footnote-2491546 -Ref: Time Functions-Footnote-3491704 -Ref: Time Functions-Footnote-4491815 -Ref: Time Functions-Footnote-5491927 -Ref: Time Functions-Footnote-6492154 -Node: Bitwise Functions492420 -Ref: table-bitwise-ops492978 -Ref: Bitwise Functions-Footnote-1497138 -Node: Type Functions497322 -Node: I18N Functions497792 -Node: User-defined499419 -Node: Definition Syntax500223 -Ref: Definition Syntax-Footnote-1505133 -Node: Function Example505202 -Node: Function Caveats507796 -Node: Calling A Function508217 -Node: Variable Scope509332 -Node: Pass By Value/Reference511307 -Node: Return Statement514747 -Node: Dynamic Typing517728 -Node: Indirect Calls518463 -Node: Internationalization528148 -Node: I18N and L10N529574 -Node: Explaining gettext530260 -Ref: Explaining gettext-Footnote-1535326 -Ref: Explaining gettext-Footnote-2535510 -Node: Programmer i18n535675 -Node: Translator i18n539875 -Node: String Extraction540668 -Ref: String Extraction-Footnote-1541629 -Node: Printf Ordering541715 -Ref: Printf Ordering-Footnote-1544499 -Node: I18N Portability544563 -Ref: I18N Portability-Footnote-1547012 -Node: I18N Example547075 -Ref: I18N Example-Footnote-1549710 -Node: Gawk I18N549782 -Node: Advanced Features550399 -Node: Nondecimal Data551912 -Node: Array Sorting553495 -Node: Controlling Array Traversal554195 -Node: Controlling Scanning With A Function554942 -Node: Controlling Scanning562645 -Ref: Controlling Scanning-Footnote-1566446 -Node: Array Sorting Functions566762 -Ref: Array Sorting Functions-Footnote-1570278 -Ref: Array Sorting Functions-Footnote-2570371 -Node: Two-way I/O570565 -Ref: Two-way I/O-Footnote-1575997 -Node: TCP/IP Networking576067 -Node: Profiling578911 -Node: Library Functions586385 -Ref: Library Functions-Footnote-1589392 -Node: Library Names589563 -Ref: Library Names-Footnote-1593034 -Ref: Library Names-Footnote-2593254 -Node: General Functions593340 -Node: Strtonum Function594293 -Node: Assert Function597223 -Node: Round Function600549 -Node: Cliff Random Function602092 -Node: Ordinal Functions603108 -Ref: Ordinal Functions-Footnote-1606178 -Ref: Ordinal Functions-Footnote-2606430 -Node: Join Function606639 -Ref: Join Function-Footnote-1608410 -Node: Gettimeofday Function608610 -Node: Data File Management612325 -Node: Filetrans Function612957 -Node: Rewind Function617096 -Node: File Checking618483 -Node: Empty Files619577 -Node: Ignoring Assigns621807 -Node: Getopt Function623360 -Ref: Getopt Function-Footnote-1634664 -Node: Passwd Functions634867 -Ref: Passwd Functions-Footnote-1643842 -Node: Group Functions643930 -Node: Walking Arrays652014 -Node: Sample Programs653583 -Node: Running Examples654248 -Node: Clones654976 -Node: Cut Program656200 -Node: Egrep Program666045 -Ref: Egrep Program-Footnote-1673818 -Node: Id Program673928 -Node: Split Program677544 -Ref: Split Program-Footnote-1681063 -Node: Tee Program681191 -Node: Uniq Program683994 -Node: Wc Program691423 -Ref: Wc Program-Footnote-1695689 -Ref: Wc Program-Footnote-2695889 -Node: Miscellaneous Programs695981 -Node: Dupword Program697169 -Node: Alarm Program699200 -Node: Translate Program703949 -Ref: Translate Program-Footnote-1708336 -Ref: Translate Program-Footnote-2708564 -Node: Labels Program708698 -Ref: Labels Program-Footnote-1712069 -Node: Word Sorting712153 -Node: History Sorting716037 -Node: Extract Program717876 -Ref: Extract Program-Footnote-1725359 -Node: Simple Sed725487 -Node: Igawk Program728549 -Ref: Igawk Program-Footnote-1743706 -Ref: Igawk Program-Footnote-2743907 -Node: Anagram Program744045 -Node: Signature Program747113 -Node: Debugger748213 -Node: Debugging749124 -Node: Debugging Concepts749537 -Node: Debugging Terms751393 -Node: Awk Debugging754016 -Node: Sample dgawk session754908 -Node: dgawk invocation755400 -Node: Finding The Bug756582 -Node: List of Debugger Commands763068 -Node: Breakpoint Control764379 -Node: Dgawk Execution Control768015 -Node: Viewing And Changing Data771366 -Node: Dgawk Stack774703 -Node: Dgawk Info776163 -Node: Miscellaneous Dgawk Commands780111 -Node: Readline Support785539 -Node: Dgawk Limitations786377 -Node: Language History788566 -Node: V7/SVR3.1790078 -Node: SVR4792399 -Node: POSIX793841 -Node: BTL794849 -Node: POSIX/GNU795583 -Node: Common Extensions800734 -Node: Ranges and Locales801841 -Ref: Ranges and Locales-Footnote-1806448 -Node: Contributors806669 -Node: Installation810931 -Node: Gawk Distribution811825 -Node: Getting812309 -Node: Extracting813135 -Node: Distribution contents814827 -Node: Unix Installation820049 -Node: Quick Installation820666 -Node: Additional Configuration Options822628 -Node: Configuration Philosophy824105 -Node: Non-Unix Installation826447 -Node: PC Installation826905 -Node: PC Binary Installation828204 -Node: PC Compiling830052 -Node: PC Testing832996 -Node: PC Using834172 -Node: Cygwin838357 -Node: MSYS839357 -Node: VMS Installation839871 -Node: VMS Compilation840474 -Ref: VMS Compilation-Footnote-1841481 -Node: VMS Installation Details841539 -Node: VMS Running843174 -Node: VMS Old Gawk844781 -Node: Bugs845255 -Node: Other Versions849108 -Node: Notes854389 -Node: Compatibility Mode855081 -Node: Additions855864 -Node: Accessing The Source856676 -Node: Adding Code858101 -Node: New Ports864068 -Node: Dynamic Extensions868181 -Node: Internals869557 -Node: Plugin License878660 -Node: Sample Library879294 -Node: Internal File Description879980 -Node: Internal File Ops883695 -Ref: Internal File Ops-Footnote-1888476 -Node: Using Internal File Ops888616 -Node: Future Extensions890993 -Node: Basic Concepts893497 -Node: Basic High Level894254 -Ref: Basic High Level-Footnote-1898289 -Node: Basic Data Typing898474 -Node: Floating Point Issues902999 -Node: String Conversion Precision904082 -Ref: String Conversion Precision-Footnote-1905782 -Node: Unexpected Results905891 -Node: POSIX Floating Point Problems907717 -Ref: POSIX Floating Point Problems-Footnote-1911422 -Node: Glossary911460 -Node: Copying936436 -Node: GNU Free Documentation License973993 -Node: Index999130 +Ref: Preface-Footnote-140838 +Ref: Preface-Footnote-240944 +Node: History41176 +Node: Names43567 +Ref: Names-Footnote-145044 +Node: This Manual45116 +Ref: This Manual-Footnote-150063 +Node: Conventions50163 +Node: Manual History52297 +Ref: Manual History-Footnote-155567 +Ref: Manual History-Footnote-255608 +Node: How To Contribute55682 +Node: Acknowledgments56826 +Node: Getting Started61157 +Node: Running gawk63536 +Node: One-shot64722 +Node: Read Terminal65947 +Ref: Read Terminal-Footnote-167597 +Ref: Read Terminal-Footnote-267873 +Node: Long68044 +Node: Executable Scripts69420 +Ref: Executable Scripts-Footnote-171289 +Ref: Executable Scripts-Footnote-271391 +Node: Comments71842 +Node: Quoting74309 +Node: DOS Quoting78932 +Node: Sample Data Files79607 +Node: Very Simple82639 +Node: Two Rules87238 +Node: More Complex89385 +Ref: More Complex-Footnote-192315 +Node: Statements/Lines92400 +Ref: Statements/Lines-Footnote-196862 +Node: Other Features97127 +Node: When98055 +Node: Invoking Gawk100202 +Node: Command Line101587 +Node: Options102370 +Ref: Options-Footnote-1115807 +Node: Other Arguments115832 +Node: Naming Standard Input118490 +Node: Environment Variables119584 +Node: AWKPATH Variable120028 +Ref: AWKPATH Variable-Footnote-1122625 +Node: Other Environment Variables122885 +Node: Exit Status125225 +Node: Include Files125900 +Node: Obsolete129385 +Node: Undocumented130071 +Node: Regexp130312 +Node: Regexp Usage131701 +Node: Escape Sequences133727 +Node: Regexp Operators139490 +Ref: Regexp Operators-Footnote-1146687 +Ref: Regexp Operators-Footnote-2146834 +Node: Bracket Expressions146932 +Ref: table-char-classes148822 +Node: GNU Regexp Operators151345 +Node: Case-sensitivity155068 +Ref: Case-sensitivity-Footnote-1158036 +Ref: Case-sensitivity-Footnote-2158271 +Node: Leftmost Longest158379 +Node: Computed Regexps159580 +Node: Reading Files162990 +Node: Records164931 +Ref: Records-Footnote-1173605 +Node: Fields173642 +Ref: Fields-Footnote-1176675 +Node: Nonconstant Fields176761 +Node: Changing Fields178963 +Node: Field Separators184941 +Node: Default Field Splitting187570 +Node: Regexp Field Splitting188687 +Node: Single Character Fields192029 +Node: Command Line Field Separator193088 +Node: Field Splitting Summary196529 +Ref: Field Splitting Summary-Footnote-1199721 +Node: Constant Size199822 +Node: Splitting By Content204406 +Ref: Splitting By Content-Footnote-1208132 +Node: Multiple Line208172 +Ref: Multiple Line-Footnote-1214019 +Node: Getline214198 +Node: Plain Getline216426 +Node: Getline/Variable218515 +Node: Getline/File219656 +Node: Getline/Variable/File220978 +Ref: Getline/Variable/File-Footnote-1222577 +Node: Getline/Pipe222664 +Node: Getline/Variable/Pipe225224 +Node: Getline/Coprocess226331 +Node: Getline/Variable/Coprocess227574 +Node: Getline Notes228288 +Node: Getline Summary230230 +Ref: table-getline-variants230573 +Node: Command line directories231429 +Node: Printing232054 +Node: Print233685 +Node: Print Examples235022 +Node: Output Separators237806 +Node: OFMT239566 +Node: Printf240924 +Node: Basic Printf241830 +Node: Control Letters243369 +Node: Format Modifiers247181 +Node: Printf Examples253190 +Node: Redirection255905 +Node: Special Files262889 +Node: Special FD263422 +Ref: Special FD-Footnote-1267047 +Node: Special Network267121 +Node: Special Caveats267971 +Node: Close Files And Pipes268767 +Ref: Close Files And Pipes-Footnote-1275790 +Ref: Close Files And Pipes-Footnote-2275938 +Node: Expressions276088 +Node: Values277220 +Node: Constants277896 +Node: Scalar Constants278576 +Ref: Scalar Constants-Footnote-1279435 +Node: Nondecimal-numbers279617 +Node: Regexp Constants282676 +Node: Using Constant Regexps283151 +Node: Variables286206 +Node: Using Variables286861 +Node: Assignment Options288585 +Node: Conversion290457 +Ref: table-locale-affects295833 +Ref: Conversion-Footnote-1296457 +Node: All Operators296566 +Node: Arithmetic Ops297196 +Node: Concatenation299701 +Ref: Concatenation-Footnote-1302494 +Node: Assignment Ops302614 +Ref: table-assign-ops307602 +Node: Increment Ops309010 +Node: Truth Values and Conditions312480 +Node: Truth Values313563 +Node: Typing and Comparison314612 +Node: Variable Typing315401 +Ref: Variable Typing-Footnote-1319298 +Node: Comparison Operators319420 +Ref: table-relational-ops319830 +Node: POSIX String Comparison323379 +Ref: POSIX String Comparison-Footnote-1324335 +Node: Boolean Ops324473 +Ref: Boolean Ops-Footnote-1328551 +Node: Conditional Exp328642 +Node: Function Calls330374 +Node: Precedence333968 +Node: Locales337637 +Node: Patterns and Actions338726 +Node: Pattern Overview339780 +Node: Regexp Patterns341446 +Node: Expression Patterns341989 +Node: Ranges345674 +Node: BEGIN/END348640 +Node: Using BEGIN/END349402 +Ref: Using BEGIN/END-Footnote-1352133 +Node: I/O And BEGIN/END352239 +Node: BEGINFILE/ENDFILE354521 +Node: Empty357414 +Node: Using Shell Variables357730 +Node: Action Overview360015 +Node: Statements362372 +Node: If Statement364226 +Node: While Statement365725 +Node: Do Statement367769 +Node: For Statement368925 +Node: Switch Statement372077 +Node: Break Statement374174 +Node: Continue Statement376164 +Node: Next Statement377951 +Node: Nextfile Statement380341 +Node: Exit Statement382886 +Node: Built-in Variables385302 +Node: User-modified386397 +Ref: User-modified-Footnote-1394423 +Node: Auto-set394485 +Ref: Auto-set-Footnote-1403776 +Node: ARGC and ARGV403981 +Node: Arrays407832 +Node: Array Basics409337 +Node: Array Intro410048 +Node: Reference to Elements414366 +Node: Assigning Elements416636 +Node: Array Example417127 +Node: Scanning an Array418859 +Node: Delete421525 +Ref: Delete-Footnote-1423960 +Node: Numeric Array Subscripts424017 +Node: Uninitialized Subscripts426200 +Node: Multi-dimensional427828 +Node: Multi-scanning430922 +Node: Arrays of Arrays432506 +Node: Functions437083 +Node: Built-in437905 +Node: Calling Built-in438983 +Node: Numeric Functions440971 +Ref: Numeric Functions-Footnote-1444736 +Ref: Numeric Functions-Footnote-2445093 +Ref: Numeric Functions-Footnote-3445141 +Node: String Functions445410 +Ref: String Functions-Footnote-1468907 +Ref: String Functions-Footnote-2469036 +Ref: String Functions-Footnote-3469284 +Node: Gory Details469371 +Ref: table-sub-escapes471050 +Ref: table-sub-posix-92472404 +Ref: table-sub-proposed473747 +Ref: table-posix-sub475097 +Ref: table-gensub-escapes476643 +Ref: Gory Details-Footnote-1477850 +Ref: Gory Details-Footnote-2477901 +Node: I/O Functions478052 +Ref: I/O Functions-Footnote-1484707 +Node: Time Functions484854 +Ref: Time Functions-Footnote-1495746 +Ref: Time Functions-Footnote-2495814 +Ref: Time Functions-Footnote-3495972 +Ref: Time Functions-Footnote-4496083 +Ref: Time Functions-Footnote-5496195 +Ref: Time Functions-Footnote-6496422 +Node: Bitwise Functions496688 +Ref: table-bitwise-ops497246 +Ref: Bitwise Functions-Footnote-1501406 +Node: Type Functions501590 +Node: I18N Functions502060 +Node: User-defined503687 +Node: Definition Syntax504491 +Ref: Definition Syntax-Footnote-1509401 +Node: Function Example509470 +Node: Function Caveats512064 +Node: Calling A Function512485 +Node: Variable Scope513600 +Node: Pass By Value/Reference515575 +Node: Return Statement519015 +Node: Dynamic Typing521996 +Node: Indirect Calls522731 +Node: Internationalization532416 +Node: I18N and L10N533842 +Node: Explaining gettext534528 +Ref: Explaining gettext-Footnote-1539594 +Ref: Explaining gettext-Footnote-2539778 +Node: Programmer i18n539943 +Node: Translator i18n544143 +Node: String Extraction544936 +Ref: String Extraction-Footnote-1545897 +Node: Printf Ordering545983 +Ref: Printf Ordering-Footnote-1548767 +Node: I18N Portability548831 +Ref: I18N Portability-Footnote-1551280 +Node: I18N Example551343 +Ref: I18N Example-Footnote-1553978 +Node: Gawk I18N554050 +Node: Advanced Features554667 +Node: Nondecimal Data556180 +Node: Array Sorting557763 +Node: Controlling Array Traversal558463 +Node: Controlling Scanning With A Function559210 +Node: Controlling Scanning566913 +Ref: Controlling Scanning-Footnote-1570714 +Node: Array Sorting Functions571030 +Ref: Array Sorting Functions-Footnote-1574546 +Ref: Array Sorting Functions-Footnote-2574639 +Node: Two-way I/O574833 +Ref: Two-way I/O-Footnote-1580265 +Node: TCP/IP Networking580335 +Node: Profiling583179 +Node: Library Functions590653 +Ref: Library Functions-Footnote-1593660 +Node: Library Names593831 +Ref: Library Names-Footnote-1597302 +Ref: Library Names-Footnote-2597522 +Node: General Functions597608 +Node: Strtonum Function598561 +Node: Assert Function601491 +Node: Round Function604817 +Node: Cliff Random Function606360 +Node: Ordinal Functions607376 +Ref: Ordinal Functions-Footnote-1610446 +Ref: Ordinal Functions-Footnote-2610698 +Node: Join Function610907 +Ref: Join Function-Footnote-1612678 +Node: Gettimeofday Function612878 +Node: Data File Management616593 +Node: Filetrans Function617225 +Node: Rewind Function621364 +Node: File Checking622751 +Node: Empty Files623845 +Node: Ignoring Assigns626075 +Node: Getopt Function627628 +Ref: Getopt Function-Footnote-1638932 +Node: Passwd Functions639135 +Ref: Passwd Functions-Footnote-1648110 +Node: Group Functions648198 +Node: Walking Arrays656282 +Node: Sample Programs657851 +Node: Running Examples658516 +Node: Clones659244 +Node: Cut Program660468 +Node: Egrep Program670313 +Ref: Egrep Program-Footnote-1678086 +Node: Id Program678196 +Node: Split Program681812 +Ref: Split Program-Footnote-1685331 +Node: Tee Program685459 +Node: Uniq Program688262 +Node: Wc Program695691 +Ref: Wc Program-Footnote-1699957 +Ref: Wc Program-Footnote-2700157 +Node: Miscellaneous Programs700249 +Node: Dupword Program701437 +Node: Alarm Program703468 +Node: Translate Program708217 +Ref: Translate Program-Footnote-1712604 +Ref: Translate Program-Footnote-2712832 +Node: Labels Program712966 +Ref: Labels Program-Footnote-1716337 +Node: Word Sorting716421 +Node: History Sorting720305 +Node: Extract Program722144 +Ref: Extract Program-Footnote-1729627 +Node: Simple Sed729755 +Node: Igawk Program732817 +Ref: Igawk Program-Footnote-1747974 +Ref: Igawk Program-Footnote-2748175 +Node: Anagram Program748313 +Node: Signature Program751381 +Node: Debugger752481 +Node: Debugging753392 +Node: Debugging Concepts753805 +Node: Debugging Terms755661 +Node: Awk Debugging758284 +Node: Sample dgawk session759176 +Node: dgawk invocation759668 +Node: Finding The Bug760850 +Node: List of Debugger Commands767336 +Node: Breakpoint Control768647 +Node: Dgawk Execution Control772283 +Node: Viewing And Changing Data775634 +Node: Dgawk Stack778971 +Node: Dgawk Info780431 +Node: Miscellaneous Dgawk Commands784379 +Node: Readline Support789807 +Node: Dgawk Limitations790645 +Node: Language History792834 +Node: V7/SVR3.1794346 +Node: SVR4796667 +Node: POSIX798109 +Node: BTL799117 +Node: POSIX/GNU799851 +Node: Common Extensions805002 +Node: Ranges and Locales806109 +Ref: Ranges and Locales-Footnote-1810716 +Node: Contributors810937 +Node: Installation815199 +Node: Gawk Distribution816093 +Node: Getting816577 +Node: Extracting817403 +Node: Distribution contents819095 +Node: Unix Installation824317 +Node: Quick Installation824934 +Node: Additional Configuration Options826896 +Node: Configuration Philosophy828373 +Node: Non-Unix Installation830715 +Node: PC Installation831173 +Node: PC Binary Installation832472 +Node: PC Compiling834320 +Node: PC Testing837264 +Node: PC Using838440 +Node: Cygwin842625 +Node: MSYS843625 +Node: VMS Installation844139 +Node: VMS Compilation844742 +Ref: VMS Compilation-Footnote-1845749 +Node: VMS Installation Details845807 +Node: VMS Running847442 +Node: VMS Old Gawk849049 +Node: Bugs849523 +Node: Other Versions853376 +Node: Notes858657 +Node: Compatibility Mode859349 +Node: Additions860132 +Node: Accessing The Source860944 +Node: Adding Code862369 +Node: New Ports868336 +Node: Dynamic Extensions872449 +Node: Internals873825 +Node: Plugin License882928 +Node: Sample Library883562 +Node: Internal File Description884248 +Node: Internal File Ops887963 +Ref: Internal File Ops-Footnote-1892744 +Node: Using Internal File Ops892884 +Node: Future Extensions895261 +Node: Basic Concepts897765 +Node: Basic High Level898522 +Ref: Basic High Level-Footnote-1902557 +Node: Basic Data Typing902742 +Node: Floating Point Issues907267 +Node: String Conversion Precision908350 +Ref: String Conversion Precision-Footnote-1910050 +Node: Unexpected Results910159 +Node: POSIX Floating Point Problems911985 +Ref: POSIX Floating Point Problems-Footnote-1915690 +Node: Glossary915728 +Node: Copying940704 +Node: GNU Free Documentation License978261 +Node: Index1003398 End Tag Table |