diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 923 |
1 files changed, 471 insertions, 452 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 5deb6482..10307b39 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -9116,9 +9116,11 @@ File: gawk.info, Node: Switch Statement, Next: Break Statement, Prev: For Sta 7.4.5 The `switch' Statement ---------------------------- -The `switch' statement allows the evaluation of an expression and the -execution of statements based on a `case' match. Case statements are -checked for a match in the order they are defined. If no suitable +This minor node describes a `gawk'-specific feature. + + The `switch' statement allows the evaluation of an expression and +the execution of statements based on a `case' match. Case statements +are checked for a match in the order they are defined. If no suitable `case' is found, the `default' section is executed, if supplied. Each `case' contains a single constant, be it numeric, string, or @@ -11978,10 +11980,10 @@ parameters are enclosed in square brackets ([ ]): function--`gawk' also buffers its output and the `fflush()' function forces `gawk' to flush its buffers. - `fflush()' was added to Brian Kernighan's version of `awk' in 1994. - For over two decades, it was not part of the POSIX standard. As - of December, 2012, it was accepted for inclusion into the POSIX - standard. See the Austin Group website + `fflush()' was added to Brian Kernighan's version of `awk' in + April of 1992. For two decades, it was not part of the POSIX + standard. As of December, 2012, it was accepted for inclusion + into the POSIX standard. See the Austin Group website (http://austingroupbugs.net/view.php?id=634). POSIX standardizes `fflush()' as follows: If there is no argument, @@ -12698,7 +12700,7 @@ a parameter with the same name as the function itself. In addition, according to the POSIX standard, function parameters cannot have the same name as one of the special built-in variables (*note Built-in Variables::. Not all versions of `awk' enforce this -restriction. +restriction.) The BODY-OF-FUNCTION consists of `awk' statements. It is the most important part of the definition, because it says what the function @@ -12741,8 +12743,8 @@ function. When this happens, we say the function is "recursive". The act of a function calling itself is called "recursion". All the built-in functions return a value to their caller. -User-defined functions can do also, using the `return' statement, which -is described in detail in *note Return Statement::. Many of the +User-defined functions can do so also, using the `return' statement, +which is described in detail in *note Return Statement::. Many of the subsequent examples in this minor node use the `return' statement. In many `awk' implementations, including `gawk', the keyword @@ -12812,7 +12814,8 @@ elements in an array and start over with a new list of elements (*note Delete::). Instead of having to repeat this loop everywhere that you need to clear out an array, your program can just call `delarray'. (This guarantees portability. The use of `delete ARRAY' to delete the -contents of an entire array is a nonstandard extension.) +contents of an entire array is a recent(1) addition to the POSIX +standard.) The following is an example of a recursive function. It takes a string as an input parameter and returns the string in backwards order. @@ -12852,13 +12855,19 @@ an `awk' version of `ctime()': return strftime(format, ts) } + ---------- Footnotes ---------- + + (1) Late in 2012. + File: gawk.info, Node: Function Caveats, Next: Return Statement, Prev: Function Example, Up: User-defined 9.2.3 Calling User-Defined Functions ------------------------------------ -This section describes how to call a user-defined function. +"Calling a function" means causing the function to run and do its job. +A function call is an expression and its value is the value returned by +the function. * Menu: @@ -12872,16 +12881,12 @@ File: gawk.info, Node: Calling A Function, Next: Variable Scope, Up: Function 9.2.3.1 Writing A Function Call ............................... -"Calling a function" means causing the function to run and do its job. -A function call is an expression and its value is the value returned by -the function. - - A function call consists of the function name followed by the -arguments in parentheses. `awk' expressions are what you write in the -call for the arguments. Each time the call is executed, these -expressions are evaluated, and the values become the actual arguments. -For example, here is a call to `foo()' with three arguments (the first -being a string concatenation): +A function call consists of the function name followed by the arguments +in parentheses. `awk' expressions are what you write in the call for +the arguments. Each time the call is executed, these expressions are +evaluated, and the values become the actual arguments. For example, +here is a call to `foo()' with three arguments (the first being a +string concatenation): foo(x y, "lose", 4 * z) @@ -13276,7 +13281,7 @@ and then a closing right parenthesis, with the addition of a leading `@' character: the_func = "sum" - result = @the_func() # calls the `sum' function + result = @the_func() # calls the sum() function Here is a full program that processes the previously shown data, using indirect function calls. @@ -13427,8 +13432,8 @@ order. Next comes a sorting function. It is parameterized with the starting and ending field numbers and the comparison function. It -builds an array with the data and calls `quicksort' appropriately, and -then formats the results as a single string: +builds an array with the data and calls `quicksort()' appropriately, +and then formats the results as a single string: # do_sort --- sort the data according to `compare' # and return it as a string @@ -13628,7 +13633,7 @@ will be accidentally shared with the user's program. In addition, several of the library functions use a prefix that helps indicate what function or set of functions use the variables--for -example, `_pw_byname' in the user database routines (*note Passwd +example, `_pw_byname()' in the user database routines (*note Passwd Functions::). This convention is recommended, since it even further decreases the chance of inadvertent conflict among variable names. Note that this convention is used equally well for variable names and @@ -13879,9 +13884,9 @@ File: gawk.info, Node: Round Function, Next: Cliff Random Function, Prev: Ass The way `printf' and `sprintf()' (*note Printf::) perform rounding often depends upon the system's C `sprintf()' subroutine. On many -machines, `sprintf()' rounding is "unbiased," which means it doesn't -always round a trailing `.5' up, contrary to naive expectations. In -unbiased rounding, `.5' rounds to even, rather than always up, so 1.5 +machines, `sprintf()' rounding is "unbiased", which means it doesn't +always round a trailing .5 up, contrary to naive expectations. In +unbiased rounding, .5 rounds to even, rather than always up, so 1.5 rounds to 2 but 4.5 rounds to 4. This means that if you are using a format that does rounding (e.g., `"%.0f"'), you should check what your system does. The following function does traditional rounding; it @@ -13915,7 +13920,7 @@ might be useful if your `awk''s `printf' does unbiased rounding: } # test harness - { print $0, round($0) } + # { print $0, round($0) } File: gawk.info, Node: Cliff Random Function, Next: Ordinal Functions, Prev: Round Function, Up: General Functions @@ -13991,8 +13996,8 @@ corresponding character. Both functions are written very nicely in } } - Some explanation of the numbers used by `chr()' is worthwhile. The -most prominent character set in use today is ASCII.(1) Although an + Some explanation of the numbers used by `_ord_init()' is worthwhile. +The most prominent character set in use today is ASCII.(1) Although an 8-bit byte can hold 256 distinct values (from 0 to 255), ASCII only defines characters that use the values from 0 to 127.(2) In the now distant past, at least one minicomputer manufacturer used ASCII, but @@ -14042,7 +14047,7 @@ tests such as used here prohibitively expensive. (2) ASCII has been extended in many countries to use the values from 128 to 255 for country-specific characters. If your system uses these -extensions, you can simplify `_ord_init' to loop from 0 to 255. +extensions, you can simplify `_ord_init()' to loop from 0 to 255. File: gawk.info, Node: Join Function, Next: Getlocaltime Function, Prev: Ordinal Functions, Up: General Functions @@ -14483,7 +14488,7 @@ File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Man Occasionally, you might not want `awk' to process command-line variable assignments (*note Assignment Options::). In particular, if you have a -file name that contain an `=' character, `awk' treats the file name as +file name that contains an `=' character, `awk' treats the file name as an assignment, and does not process it. Some users have suggested an additional command-line option for @@ -14979,7 +14984,7 @@ later. The test can only be true for `gawk'. It is false if using `FS' or `FPAT', or on some other `awk' implementation. The code that checks for using `FPAT', using `using_fpat' and -`PROCINFO["FS"]' is similar. +`PROCINFO["FS"]', is similar. The main part of the function uses a loop to read database lines, split the line into fields, and then store the line into each array as @@ -14999,9 +15004,9 @@ create the element with the null string as its value: return _pw_byname[name] } - Similarly, the `getpwuid' function takes a user ID number argument. -If that user number is in the database, it returns the appropriate -line. Otherwise, it returns the null string: + Similarly, the `getpwuid()' function takes a user ID number +argument. If that user number is in the database, it returns the +appropriate line. Otherwise, it returns the null string: function getpwuid(uid) { @@ -15348,8 +15353,8 @@ index and value, use the indirect function call syntax (*note Indirect Calls::) on `process', passing it the index and the value. When calling `walk_array()', you would pass the name of a -user-defined function that expects to receive and index and a value, -and then processes the element. +user-defined function that expects to receive an index and a value, and +then processes the element. File: gawk.info, Node: Sample Programs, Next: Advanced Features, Prev: Library Functions, Up: Top @@ -15610,7 +15615,7 @@ fields to print are `$1', `$3', and `$5'. The intermediate fields are the fields to print, and `t' tracks the complete field list, including filler fields: - function set_charlist( field, i, j, f, g, t, + function set_charlist( field, i, j, f, g, n, m, t, filler, last, len) { field = 1 # count total fields @@ -18536,7 +18541,8 @@ regular pipes. ---------- Footnotes ---------- - (1) This is very different from the same operator in the C shell. + (1) This is very different from the same operator in the C shell and +in Bash. File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O, Up: Advanced Features @@ -18674,56 +18680,64 @@ First, the `awk' program: junk Here is the `awkprof.out' that results from running the `gawk' -profiler on this program and data (this example also illustrates that -`awk' programmers sometimes have to work late): +profiler on this program and data. (This example also illustrates that +`awk' programmers sometimes get up very early in the morning to work.) - # gawk profile, created Sun Aug 13 00:00:15 2000 + # gawk profile, created Thu Feb 27 05:16:21 2014 - # BEGIN block(s) + # BEGIN block(s) - BEGIN { - 1 print "First BEGIN rule" - 1 print "Second BEGIN rule" - } + BEGIN { + 1 print "First BEGIN rule" + } - # Rule(s) + BEGIN { + 1 print "Second BEGIN rule" + } - 5 /foo/ { # 2 - 2 print "matched /foo/, gosh" - 6 for (i = 1; i <= 3; i++) { - 6 sing() - } - } + # Rule(s) - 5 { - 5 if (/foo/) { # 2 - 2 print "if is true" - 3 } else { - 3 print "else is true" - } - } + 5 /foo/ { # 2 + 2 print "matched /foo/, gosh" + 6 for (i = 1; i <= 3; i++) { + 6 sing() + } + } - # END block(s) + 5 { + 5 if (/foo/) { # 2 + 2 print "if is true" + 3 } else { + 3 print "else is true" + } + } - END { - 1 print "First END rule" - 1 print "Second END rule" - } + # END block(s) - # Functions, listed alphabetically + END { + 1 print "First END rule" + } - 6 function sing(dummy) - { - 6 print "I gotta be me!" - } + END { + 1 print "Second END rule" + } + + + # Functions, listed alphabetically + + 6 function sing(dummy) + { + 6 print "I gotta be me!" + } This example illustrates many of the basic features of profiling output. They are as follows: - * The program is printed in the order `BEGIN' rule, `BEGINFILE' rule, - pattern/action rules, `ENDFILE' rule, `END' rule and functions, - listed alphabetically. Multiple `BEGIN' and `END' rules are - merged together, as are multiple `BEGINFILE' and `ENDFILE' rules. + * The program is printed in the order `BEGIN' rules, `BEGINFILE' + rules, pattern/action rules, `ENDFILE' rules, `END' rules and + functions, listed alphabetically. Multiple `BEGIN' and `END' + rules retain their separate identities, as do multiple `BEGINFILE' + and `ENDFILE' rules. * Pattern-action rules have two counts. The first count, to the left of the rule, shows how many times the rule's pattern was @@ -18774,8 +18788,7 @@ you typed when you wrote it. This is because `gawk' creates the profiled version by "pretty printing" its internal representation of the program. The advantage to this is that `gawk' can produce a standard representation. The disadvantage is that all source-code -comments are lost, as are the distinctions among multiple `BEGIN', -`END', `BEGINFILE', and `ENDFILE' rules. Also, things such as: +comments are lost. Also, things such as: /foo/ @@ -18834,6 +18847,9 @@ by the `Ctrl-<\>' key. called this way, `gawk' "pretty prints" the program into `awkprof.out', without any execution counts. + NOTE: The `--pretty-print' option still runs your program. This + will change in the next major release. + File: gawk.info, Node: Internationalization, Next: Debugger, Prev: Advanced Features, Up: Top @@ -25681,7 +25697,7 @@ as working in this fashion, and in particular, would teach that the `[A-Z]' was the "correct" way to match uppercase letters. And indeed, this was true.(1) - The 1993 POSIX standard introduced the idea of locales (*note + The 1992 POSIX standard introduced the idea of locales (*note Locales::). Since many locales include other letters besides the plain twenty-six letters of the American English alphabet, the POSIX standard added character classes (*note Bracket Expressions::) as a way to match @@ -29984,7 +30000,7 @@ Index * ' (single quote): One-shot. (line 15) * ' (single quote), vs. apostrophe: Comments. (line 27) * ' (single quote), with double quotes: Quoting. (line 53) -* () (parentheses) <1>: Profiling. (line 138) +* () (parentheses) <1>: Profiling. (line 146) * () (parentheses): Regexp Operators. (line 79) * * (asterisk), * operator, as multiplication operator: Precedence. (line 55) @@ -30490,7 +30506,7 @@ Index * Boolean expressions, as patterns: Expression Patterns. (line 41) * Boolean operators, See Boolean expressions: Boolean Ops. (line 6) * Bourne shell, quoting rules for: Quoting. (line 18) -* braces ({}): Profiling. (line 134) +* braces ({}): Profiling. (line 142) * braces ({}), actions and: Action Overview. (line 19) * braces ({}), statements, grouping: Statements. (line 10) * bracket expressions <1>: Bracket Expressions. (line 6) @@ -30697,7 +30713,7 @@ Index * 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 72) +* ctime() user-defined function: Function Example. (line 73) * currency symbols, localization: Explaining gettext. (line 103) * custom.h file: Configuration Philosophy. (line 30) @@ -31297,8 +31313,8 @@ Index * functions, undefined: Pass By Value/Reference. (line 71) * functions, user-defined: User-defined. (line 6) -* functions, user-defined, calling: Calling A Function. (line 6) -* functions, user-defined, counts: Profiling. (line 129) +* functions, user-defined, calling: Function Caveats. (line 6) +* functions, user-defined, counts: Profiling. (line 137) * functions, user-defined, library of: Library Functions. (line 6) * functions, user-defined, next/nextfile statements and <1>: Nextfile Statement. (line 47) @@ -31306,7 +31322,7 @@ Index (line 45) * G-d: Acknowledgments. (line 78) * Garfinkle, Scott: Contributors. (line 34) -* gawk program, dynamic profiling: Profiling. (line 172) +* gawk program, dynamic profiling: Profiling. (line 179) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 23) @@ -31489,7 +31505,7 @@ Index * hexadecimal values, enabling interpretation of: Options. (line 207) * histsort.awk program: History Sorting. (line 25) * Hughes, Phil: Acknowledgments. (line 43) -* HUP signal: Profiling. (line 204) +* HUP signal: Profiling. (line 211) * hyphen (-), - operator: Precedence. (line 52) * hyphen (-), -- operator <1>: Precedence. (line 46) * hyphen (-), -- operator: Increment Ops. (line 48) @@ -31565,7 +31581,7 @@ Index * insomnia, cure for: Alarm Program. (line 6) * installation, VMS: VMS Installation. (line 6) * installing gawk: Installation. (line 6) -* INT signal (MS-Windows): Profiling. (line 207) +* INT signal (MS-Windows): Profiling. (line 214) * int() function: Numeric Functions. (line 23) * integer, arbitrary precision: Arbitrary Precision Integers. (line 6) @@ -31612,11 +31628,12 @@ Index * Kernighan, Brian <2>: Other Versions. (line 13) * Kernighan, Brian <3>: Contributors. (line 11) * Kernighan, Brian <4>: BTL. (line 6) -* Kernighan, Brian <5>: Concatenation. (line 6) -* Kernighan, Brian <6>: Acknowledgments. (line 72) -* Kernighan, Brian <7>: Conventions. (line 34) +* Kernighan, Brian <5>: Library Functions. (line 12) +* Kernighan, Brian <6>: Concatenation. (line 6) +* Kernighan, Brian <7>: Acknowledgments. (line 72) +* Kernighan, Brian <8>: Conventions. (line 34) * Kernighan, Brian: History. (line 17) -* kill command, dynamic profiling: Profiling. (line 181) +* kill command, dynamic profiling: Profiling. (line 188) * Knights, jedi: Undocumented. (line 6) * Knuth, Donald: Arbitrary Precision Arithmetic. (line 6) @@ -31713,7 +31730,7 @@ Index * long options: Command Line. (line 13) * loops: While Statement. (line 6) * loops, continue statements and: For Statement. (line 64) -* loops, count for header: Profiling. (line 123) +* loops, count for header: Profiling. (line 131) * loops, exiting: Break Statement. (line 6) * loops, See Also while statement: While Statement. (line 6) * ls utility: More Complex. (line 15) @@ -31921,14 +31938,14 @@ Index * p debugger command (alias for print): Viewing And Changing Data. (line 36) * P1003.1 POSIX standard: Glossary. (line 462) -* parentheses () <1>: Profiling. (line 138) +* parentheses () <1>: Profiling. (line 146) * parentheses (): Regexp Operators. (line 79) * password file: Passwd Functions. (line 16) * patsplit() function (gawk): String Functions. (line 290) * patterns: Patterns and Actions. (line 6) * patterns, comparison expressions as: Expression Patterns. (line 14) -* patterns, counts: Profiling. (line 110) +* patterns, counts: Profiling. (line 118) * patterns, default: Very Simple. (line 34) * patterns, empty: Empty. (line 6) * patterns, expressions as: Regexp Patterns. (line 6) @@ -31953,6 +31970,7 @@ Index * pipes, output: Redirection. (line 57) * Pitts, Dave <1>: Bugs. (line 73) * Pitts, Dave: Acknowledgments. (line 60) +* Plauger, P.J.: Library Functions. (line 12) * plus sign (+): Regexp Operators. (line 102) * plus sign (+), + operator: Precedence. (line 52) * plus sign (+), ++ operator <1>: Precedence. (line 46) @@ -32089,7 +32107,7 @@ Index * PROCINFO array <6>: Auto-set. (line 142) * PROCINFO array: Obsolete. (line 11) * profiling awk programs: Profiling. (line 6) -* profiling awk programs, dynamically: Profiling. (line 172) +* profiling awk programs, dynamically: Profiling. (line 179) * program, definition of: Getting Started. (line 21) * programmers, attractiveness of: Two-way I/O. (line 6) * programming conventions, --non-decimal-data option: Nondecimal Data. @@ -32125,7 +32143,7 @@ Index * QuikTrim Awk: Other Versions. (line 134) * quit debugger command: Miscellaneous Debugger Commands. (line 99) -* QUIT signal (MS-Windows): Profiling. (line 207) +* QUIT signal (MS-Windows): Profiling. (line 214) * quoting <1>: Comments. (line 27) * quoting <2>: Long. (line 26) * quoting: Read Terminal. (line 25) @@ -32224,7 +32242,7 @@ Index * return statement, user-defined functions: Return Statement. (line 6) * return value, close() function: Close Files And Pipes. (line 130) -* rev() user-defined function: Function Example. (line 52) +* rev() user-defined function: Function Example. (line 53) * revoutput extension: Extension Sample Revout. (line 11) * revtwoway extension: Extension Sample Rev2way. @@ -32377,14 +32395,14 @@ Index (line 56) * sidebar, Using close()'s Return Value: Close Files And Pipes. (line 128) -* SIGHUP signal: Profiling. (line 204) -* SIGINT signal (MS-Windows): Profiling. (line 207) -* signals, HUP/SIGHUP: Profiling. (line 204) -* signals, INT/SIGINT (MS-Windows): Profiling. (line 207) -* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 207) -* signals, USR1/SIGUSR1: Profiling. (line 181) -* SIGQUIT signal (MS-Windows): Profiling. (line 207) -* SIGUSR1 signal: Profiling. (line 181) +* SIGHUP signal: Profiling. (line 211) +* SIGINT signal (MS-Windows): Profiling. (line 214) +* signals, HUP/SIGHUP: 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) +* SIGQUIT signal (MS-Windows): Profiling. (line 214) +* SIGUSR1 signal: Profiling. (line 188) * silent debugger command: Debugger Execution Control. (line 10) * sin() function: Numeric Functions. (line 75) @@ -32625,12 +32643,12 @@ Index * 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 129) +* user-defined, functions, counts: 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 181) +* USR1 signal: Profiling. (line 188) * values, numeric: Basic Data Typing. (line 13) * values, string: Basic Data Typing. (line 13) * variable typing: Typing and Comparison. @@ -32722,7 +32740,7 @@ Index * zero, negative vs. positive: Unexpected Results. (line 34) * zerofile.awk program: Empty Files. (line 21) * Zoulas, Christos: Contributors. (line 66) -* {} (braces): Profiling. (line 134) +* {} (braces): Profiling. (line 142) * {} (braces), actions and: Action Overview. (line 19) * {} (braces), statements, grouping: Statements. (line 10) * | (vertical bar): Regexp Operators. (line 69) @@ -32928,347 +32946,348 @@ Node: While Statement384453 Node: Do Statement386497 Node: For Statement387653 Node: Switch Statement390805 -Node: Break Statement392902 -Node: Continue Statement394892 -Node: Next Statement396685 -Node: Nextfile Statement399075 -Node: Exit Statement401718 -Node: Built-in Variables404134 -Node: User-modified405229 -Ref: User-modified-Footnote-1413587 -Node: Auto-set413649 -Ref: Auto-set-Footnote-1427119 -Ref: Auto-set-Footnote-2427324 -Node: ARGC and ARGV427380 -Node: Arrays431231 -Node: Array Basics432736 -Node: Array Intro433562 -Node: Reference to Elements437879 -Node: Assigning Elements440149 -Node: Array Example440640 -Node: Scanning an Array442372 -Node: Controlling Scanning444686 -Ref: Controlling Scanning-Footnote-1449773 -Node: Delete450089 -Ref: Delete-Footnote-1452854 -Node: Numeric Array Subscripts452911 -Node: Uninitialized Subscripts455094 -Node: Multidimensional456721 -Node: Multiscanning459814 -Node: Arrays of Arrays461403 -Node: Functions466043 -Node: Built-in466862 -Node: Calling Built-in467940 -Node: Numeric Functions469928 -Ref: Numeric Functions-Footnote-1473760 -Ref: Numeric Functions-Footnote-2474117 -Ref: Numeric Functions-Footnote-3474165 -Node: String Functions474434 -Ref: String Functions-Footnote-1497354 -Ref: String Functions-Footnote-2497483 -Ref: String Functions-Footnote-3497731 -Node: Gory Details497818 -Ref: table-sub-escapes499497 -Ref: table-sub-posix-92500851 -Ref: table-sub-proposed502202 -Ref: table-posix-sub503556 -Ref: table-gensub-escapes505101 -Ref: Gory Details-Footnote-1506277 -Ref: Gory Details-Footnote-2506328 -Node: I/O Functions506479 -Ref: I/O Functions-Footnote-1513464 -Node: Time Functions513611 -Ref: Time Functions-Footnote-1524544 -Ref: Time Functions-Footnote-2524612 -Ref: Time Functions-Footnote-3524770 -Ref: Time Functions-Footnote-4524881 -Ref: Time Functions-Footnote-5524993 -Ref: Time Functions-Footnote-6525220 -Node: Bitwise Functions525486 -Ref: table-bitwise-ops526048 -Ref: Bitwise Functions-Footnote-1530269 -Node: Type Functions530453 -Node: I18N Functions531604 -Node: User-defined533231 -Node: Definition Syntax534035 -Ref: Definition Syntax-Footnote-1538945 -Node: Function Example539014 -Node: Function Caveats541608 -Node: Calling A Function542029 -Node: Variable Scope543144 -Node: Pass By Value/Reference546107 -Node: Return Statement549615 -Node: Dynamic Typing552596 -Node: Indirect Calls553527 -Node: Library Functions563212 -Ref: Library Functions-Footnote-1566725 -Ref: Library Functions-Footnote-2566868 -Node: Library Names567039 -Ref: Library Names-Footnote-1570510 -Ref: Library Names-Footnote-2570730 -Node: General Functions570816 -Node: Strtonum Function571844 -Node: Assert Function574774 -Node: Round Function578100 -Node: Cliff Random Function579643 -Node: Ordinal Functions580659 -Ref: Ordinal Functions-Footnote-1583731 -Ref: Ordinal Functions-Footnote-2583983 -Node: Join Function584192 -Ref: Join Function-Footnote-1585963 -Node: Getlocaltime Function586163 -Node: Readfile Function589904 -Node: Data File Management591743 -Node: Filetrans Function592375 -Node: Rewind Function596444 -Node: File Checking597831 -Node: Empty Files598925 -Node: Ignoring Assigns601155 -Node: Getopt Function602708 -Ref: Getopt Function-Footnote-1614011 -Node: Passwd Functions614214 -Ref: Passwd Functions-Footnote-1623189 -Node: Group Functions623277 -Node: Walking Arrays631361 -Node: Sample Programs633498 -Node: Running Examples634172 -Node: Clones634900 -Node: Cut Program636124 -Node: Egrep Program645969 -Ref: Egrep Program-Footnote-1653742 -Node: Id Program653852 -Node: Split Program657468 -Ref: Split Program-Footnote-1660987 -Node: Tee Program661115 -Node: Uniq Program663918 -Node: Wc Program671347 -Ref: Wc Program-Footnote-1675613 -Ref: Wc Program-Footnote-2675813 -Node: Miscellaneous Programs675905 -Node: Dupword Program677093 -Node: Alarm Program679124 -Node: Translate Program683931 -Ref: Translate Program-Footnote-1688318 -Ref: Translate Program-Footnote-2688566 -Node: Labels Program688700 -Ref: Labels Program-Footnote-1692071 -Node: Word Sorting692155 -Node: History Sorting696039 -Node: Extract Program697878 -Ref: Extract Program-Footnote-1705381 -Node: Simple Sed705509 -Node: Igawk Program708571 -Ref: Igawk Program-Footnote-1723728 -Ref: Igawk Program-Footnote-2723929 -Node: Anagram Program724067 -Node: Signature Program727135 -Node: Advanced Features728235 -Node: Nondecimal Data730121 -Node: Array Sorting731704 -Node: Controlling Array Traversal732401 -Node: Array Sorting Functions740685 -Ref: Array Sorting Functions-Footnote-1744554 -Node: Two-way I/O744748 -Ref: Two-way I/O-Footnote-1750180 -Node: TCP/IP Networking750250 -Node: Profiling753094 -Node: Internationalization760591 -Node: I18N and L10N762016 -Node: Explaining gettext762702 -Ref: Explaining gettext-Footnote-1767770 -Ref: Explaining gettext-Footnote-2767954 -Node: Programmer i18n768119 -Node: Translator i18n772321 -Node: String Extraction773114 -Ref: String Extraction-Footnote-1774075 -Node: Printf Ordering774161 -Ref: Printf Ordering-Footnote-1776945 -Node: I18N Portability777009 -Ref: I18N Portability-Footnote-1779458 -Node: I18N Example779521 -Ref: I18N Example-Footnote-1782159 -Node: Gawk I18N782231 -Node: Debugger782852 -Node: Debugging783823 -Node: Debugging Concepts784256 -Node: Debugging Terms786112 -Node: Awk Debugging788709 -Node: Sample Debugging Session789601 -Node: Debugger Invocation790121 -Node: Finding The Bug791453 -Node: List of Debugger Commands797941 -Node: Breakpoint Control799275 -Node: Debugger Execution Control802939 -Node: Viewing And Changing Data806299 -Node: Execution Stack809655 -Node: Debugger Info811122 -Node: Miscellaneous Debugger Commands815104 -Node: Readline Support820280 -Node: Limitations821111 -Node: Arbitrary Precision Arithmetic823363 -Ref: Arbitrary Precision Arithmetic-Footnote-1825012 -Node: General Arithmetic825160 -Node: Floating Point Issues826880 -Node: String Conversion Precision827761 -Ref: String Conversion Precision-Footnote-1829466 -Node: Unexpected Results829575 -Node: POSIX Floating Point Problems831728 -Ref: POSIX Floating Point Problems-Footnote-1835553 -Node: Integer Programming835591 -Node: Floating-point Programming837330 -Ref: Floating-point Programming-Footnote-1843661 -Ref: Floating-point Programming-Footnote-2843931 -Node: Floating-point Representation844195 -Node: Floating-point Context845360 -Ref: table-ieee-formats846199 -Node: Rounding Mode847583 -Ref: table-rounding-modes848062 -Ref: Rounding Mode-Footnote-1851077 -Node: Gawk and MPFR851256 -Node: Arbitrary Precision Floats852511 -Ref: Arbitrary Precision Floats-Footnote-1854954 -Node: Setting Precision855270 -Ref: table-predefined-precision-strings855956 -Node: Setting Rounding Mode858101 -Ref: table-gawk-rounding-modes858505 -Node: Floating-point Constants859692 -Node: Changing Precision861121 -Ref: Changing Precision-Footnote-1862518 -Node: Exact Arithmetic862692 -Node: Arbitrary Precision Integers865830 -Ref: Arbitrary Precision Integers-Footnote-1868848 -Node: Dynamic Extensions868995 -Node: Extension Intro870453 -Node: Plugin License871718 -Node: Extension Mechanism Outline872403 -Ref: load-extension872820 -Ref: load-new-function874298 -Ref: call-new-function875293 -Node: Extension API Description877308 -Node: Extension API Functions Introduction878521 -Node: General Data Types883387 -Ref: General Data Types-Footnote-1888989 -Node: Requesting Values889288 -Ref: table-value-types-returned890019 -Node: Constructor Functions890973 -Node: Registration Functions893993 -Node: Extension Functions894678 -Node: Exit Callback Functions896903 -Node: Extension Version String898152 -Node: Input Parsers898802 -Node: Output Wrappers908559 -Node: Two-way processors913069 -Node: Printing Messages915277 -Ref: Printing Messages-Footnote-1916354 -Node: Updating `ERRNO'916506 -Node: Accessing Parameters917245 -Node: Symbol Table Access918475 -Node: Symbol table by name918987 -Node: Symbol table by cookie920734 -Ref: Symbol table by cookie-Footnote-1924864 -Node: Cached values924927 -Ref: Cached values-Footnote-1928376 -Node: Array Manipulation928467 -Ref: Array Manipulation-Footnote-1929565 -Node: Array Data Types929604 -Ref: Array Data Types-Footnote-1932307 -Node: Array Functions932399 -Node: Flattening Arrays936165 -Node: Creating Arrays943017 -Node: Extension API Variables947742 -Node: Extension Versioning948378 -Node: Extension API Informational Variables950279 -Node: Extension API Boilerplate951365 -Node: Finding Extensions955169 -Node: Extension Example955729 -Node: Internal File Description956459 -Node: Internal File Ops960550 -Ref: Internal File Ops-Footnote-1972058 -Node: Using Internal File Ops972198 -Ref: Using Internal File Ops-Footnote-1974551 -Node: Extension Samples974817 -Node: Extension Sample File Functions976341 -Node: Extension Sample Fnmatch984826 -Node: Extension Sample Fork986552 -Node: Extension Sample Inplace987770 -Node: Extension Sample Ord989548 -Node: Extension Sample Readdir990384 -Node: Extension Sample Revout991916 -Node: Extension Sample Rev2way992509 -Node: Extension Sample Read write array993199 -Node: Extension Sample Readfile995082 -Node: Extension Sample API Tests995900 -Node: Extension Sample Time996425 -Node: gawkextlib997789 -Node: Language History1000570 -Node: V7/SVR3.11002163 -Node: SVR41004483 -Node: POSIX1005925 -Node: BTL1007311 -Node: POSIX/GNU1008045 -Node: Feature History1013644 -Node: Common Extensions1026608 -Node: Ranges and Locales1027920 -Ref: Ranges and Locales-Footnote-11032538 -Ref: Ranges and Locales-Footnote-21032565 -Ref: Ranges and Locales-Footnote-31032825 -Node: Contributors1033046 -Node: Installation1038191 -Node: Gawk Distribution1039085 -Node: Getting1039569 -Node: Extracting1040395 -Node: Distribution contents1042087 -Node: Unix Installation1047792 -Node: Quick Installation1048409 -Node: Additional Configuration Options1050853 -Node: Configuration Philosophy1052589 -Node: Non-Unix Installation1054943 -Node: PC Installation1055401 -Node: PC Binary Installation1056700 -Node: PC Compiling1058548 -Node: PC Testing1061492 -Node: PC Using1062668 -Node: Cygwin1066853 -Node: MSYS1067853 -Node: VMS Installation1068367 -Node: VMS Compilation1069131 -Ref: VMS Compilation-Footnote-11070746 -Node: VMS Dynamic Extensions1070804 -Node: VMS Installation Details1072177 -Node: VMS Running1074424 -Node: VMS GNV1077258 -Node: VMS Old Gawk1077981 -Node: Bugs1078451 -Node: Other Versions1082369 -Node: Notes1088453 -Node: Compatibility Mode1089253 -Node: Additions1090036 -Node: Accessing The Source1090963 -Node: Adding Code1092403 -Node: New Ports1098448 -Node: Derived Files1102583 -Ref: Derived Files-Footnote-11107904 -Ref: Derived Files-Footnote-21107938 -Ref: Derived Files-Footnote-31108538 -Node: Future Extensions1108636 -Node: Implementation Limitations1109219 -Node: Extension Design1110471 -Node: Old Extension Problems1111625 -Ref: Old Extension Problems-Footnote-11113133 -Node: Extension New Mechanism Goals1113190 -Ref: Extension New Mechanism Goals-Footnote-11116555 -Node: Extension Other Design Decisions1116741 -Node: Extension Future Growth1118847 -Node: Old Extension Mechanism1119683 -Node: Basic Concepts1121423 -Node: Basic High Level1122104 -Ref: figure-general-flow1122375 -Ref: figure-process-flow1122974 -Ref: Basic High Level-Footnote-11126203 -Node: Basic Data Typing1126388 -Node: Glossary1129743 -Node: Copying1155205 -Node: GNU Free Documentation License1192762 -Node: Index1217899 +Node: Break Statement392959 +Node: Continue Statement394949 +Node: Next Statement396742 +Node: Nextfile Statement399132 +Node: Exit Statement401775 +Node: Built-in Variables404191 +Node: User-modified405286 +Ref: User-modified-Footnote-1413644 +Node: Auto-set413706 +Ref: Auto-set-Footnote-1427176 +Ref: Auto-set-Footnote-2427381 +Node: ARGC and ARGV427437 +Node: Arrays431288 +Node: Array Basics432793 +Node: Array Intro433619 +Node: Reference to Elements437936 +Node: Assigning Elements440206 +Node: Array Example440697 +Node: Scanning an Array442429 +Node: Controlling Scanning444743 +Ref: Controlling Scanning-Footnote-1449830 +Node: Delete450146 +Ref: Delete-Footnote-1452911 +Node: Numeric Array Subscripts452968 +Node: Uninitialized Subscripts455151 +Node: Multidimensional456778 +Node: Multiscanning459871 +Node: Arrays of Arrays461460 +Node: Functions466100 +Node: Built-in466919 +Node: Calling Built-in467997 +Node: Numeric Functions469985 +Ref: Numeric Functions-Footnote-1473817 +Ref: Numeric Functions-Footnote-2474174 +Ref: Numeric Functions-Footnote-3474222 +Node: String Functions474491 +Ref: String Functions-Footnote-1497411 +Ref: String Functions-Footnote-2497540 +Ref: String Functions-Footnote-3497788 +Node: Gory Details497875 +Ref: table-sub-escapes499554 +Ref: table-sub-posix-92500908 +Ref: table-sub-proposed502259 +Ref: table-posix-sub503613 +Ref: table-gensub-escapes505158 +Ref: Gory Details-Footnote-1506334 +Ref: Gory Details-Footnote-2506385 +Node: I/O Functions506536 +Ref: I/O Functions-Footnote-1513526 +Node: Time Functions513673 +Ref: Time Functions-Footnote-1524606 +Ref: Time Functions-Footnote-2524674 +Ref: Time Functions-Footnote-3524832 +Ref: Time Functions-Footnote-4524943 +Ref: Time Functions-Footnote-5525055 +Ref: Time Functions-Footnote-6525282 +Node: Bitwise Functions525548 +Ref: table-bitwise-ops526110 +Ref: Bitwise Functions-Footnote-1530331 +Node: Type Functions530515 +Node: I18N Functions531666 +Node: User-defined533293 +Node: Definition Syntax534097 +Ref: Definition Syntax-Footnote-1539011 +Node: Function Example539080 +Ref: Function Example-Footnote-1541729 +Node: Function Caveats541751 +Node: Calling A Function542269 +Node: Variable Scope543224 +Node: Pass By Value/Reference546187 +Node: Return Statement549695 +Node: Dynamic Typing552676 +Node: Indirect Calls553607 +Node: Library Functions563294 +Ref: Library Functions-Footnote-1566807 +Ref: Library Functions-Footnote-2566950 +Node: Library Names567121 +Ref: Library Names-Footnote-1570594 +Ref: Library Names-Footnote-2570814 +Node: General Functions570900 +Node: Strtonum Function571928 +Node: Assert Function574858 +Node: Round Function578184 +Node: Cliff Random Function579725 +Node: Ordinal Functions580741 +Ref: Ordinal Functions-Footnote-1583818 +Ref: Ordinal Functions-Footnote-2584070 +Node: Join Function584281 +Ref: Join Function-Footnote-1586052 +Node: Getlocaltime Function586252 +Node: Readfile Function589993 +Node: Data File Management591832 +Node: Filetrans Function592464 +Node: Rewind Function596533 +Node: File Checking597920 +Node: Empty Files599014 +Node: Ignoring Assigns601244 +Node: Getopt Function602798 +Ref: Getopt Function-Footnote-1614101 +Node: Passwd Functions614304 +Ref: Passwd Functions-Footnote-1623282 +Node: Group Functions623370 +Node: Walking Arrays631454 +Node: Sample Programs633590 +Node: Running Examples634264 +Node: Clones634992 +Node: Cut Program636216 +Node: Egrep Program646067 +Ref: Egrep Program-Footnote-1653840 +Node: Id Program653950 +Node: Split Program657566 +Ref: Split Program-Footnote-1661085 +Node: Tee Program661213 +Node: Uniq Program664016 +Node: Wc Program671445 +Ref: Wc Program-Footnote-1675711 +Ref: Wc Program-Footnote-2675911 +Node: Miscellaneous Programs676003 +Node: Dupword Program677191 +Node: Alarm Program679222 +Node: Translate Program684029 +Ref: Translate Program-Footnote-1688416 +Ref: Translate Program-Footnote-2688664 +Node: Labels Program688798 +Ref: Labels Program-Footnote-1692169 +Node: Word Sorting692253 +Node: History Sorting696137 +Node: Extract Program697976 +Ref: Extract Program-Footnote-1705479 +Node: Simple Sed705607 +Node: Igawk Program708669 +Ref: Igawk Program-Footnote-1723826 +Ref: Igawk Program-Footnote-2724027 +Node: Anagram Program724165 +Node: Signature Program727233 +Node: Advanced Features728333 +Node: Nondecimal Data730219 +Node: Array Sorting731802 +Node: Controlling Array Traversal732499 +Node: Array Sorting Functions740783 +Ref: Array Sorting Functions-Footnote-1744652 +Node: Two-way I/O744846 +Ref: Two-way I/O-Footnote-1750278 +Node: TCP/IP Networking750360 +Node: Profiling753204 +Node: Internationalization760707 +Node: I18N and L10N762132 +Node: Explaining gettext762818 +Ref: Explaining gettext-Footnote-1767886 +Ref: Explaining gettext-Footnote-2768070 +Node: Programmer i18n768235 +Node: Translator i18n772437 +Node: String Extraction773230 +Ref: String Extraction-Footnote-1774191 +Node: Printf Ordering774277 +Ref: Printf Ordering-Footnote-1777061 +Node: I18N Portability777125 +Ref: I18N Portability-Footnote-1779574 +Node: I18N Example779637 +Ref: I18N Example-Footnote-1782275 +Node: Gawk I18N782347 +Node: Debugger782968 +Node: Debugging783939 +Node: Debugging Concepts784372 +Node: Debugging Terms786228 +Node: Awk Debugging788825 +Node: Sample Debugging Session789717 +Node: Debugger Invocation790237 +Node: Finding The Bug791569 +Node: List of Debugger Commands798057 +Node: Breakpoint Control799391 +Node: Debugger Execution Control803055 +Node: Viewing And Changing Data806415 +Node: Execution Stack809771 +Node: Debugger Info811238 +Node: Miscellaneous Debugger Commands815220 +Node: Readline Support820396 +Node: Limitations821227 +Node: Arbitrary Precision Arithmetic823479 +Ref: Arbitrary Precision Arithmetic-Footnote-1825128 +Node: General Arithmetic825276 +Node: Floating Point Issues826996 +Node: String Conversion Precision827877 +Ref: String Conversion Precision-Footnote-1829582 +Node: Unexpected Results829691 +Node: POSIX Floating Point Problems831844 +Ref: POSIX Floating Point Problems-Footnote-1835669 +Node: Integer Programming835707 +Node: Floating-point Programming837446 +Ref: Floating-point Programming-Footnote-1843777 +Ref: Floating-point Programming-Footnote-2844047 +Node: Floating-point Representation844311 +Node: Floating-point Context845476 +Ref: table-ieee-formats846315 +Node: Rounding Mode847699 +Ref: table-rounding-modes848178 +Ref: Rounding Mode-Footnote-1851193 +Node: Gawk and MPFR851372 +Node: Arbitrary Precision Floats852627 +Ref: Arbitrary Precision Floats-Footnote-1855070 +Node: Setting Precision855386 +Ref: table-predefined-precision-strings856072 +Node: Setting Rounding Mode858217 +Ref: table-gawk-rounding-modes858621 +Node: Floating-point Constants859808 +Node: Changing Precision861237 +Ref: Changing Precision-Footnote-1862634 +Node: Exact Arithmetic862808 +Node: Arbitrary Precision Integers865946 +Ref: Arbitrary Precision Integers-Footnote-1868964 +Node: Dynamic Extensions869111 +Node: Extension Intro870569 +Node: Plugin License871834 +Node: Extension Mechanism Outline872519 +Ref: load-extension872936 +Ref: load-new-function874414 +Ref: call-new-function875409 +Node: Extension API Description877424 +Node: Extension API Functions Introduction878637 +Node: General Data Types883503 +Ref: General Data Types-Footnote-1889105 +Node: Requesting Values889404 +Ref: table-value-types-returned890135 +Node: Constructor Functions891089 +Node: Registration Functions894109 +Node: Extension Functions894794 +Node: Exit Callback Functions897019 +Node: Extension Version String898268 +Node: Input Parsers898918 +Node: Output Wrappers908675 +Node: Two-way processors913185 +Node: Printing Messages915393 +Ref: Printing Messages-Footnote-1916470 +Node: Updating `ERRNO'916622 +Node: Accessing Parameters917361 +Node: Symbol Table Access918591 +Node: Symbol table by name919103 +Node: Symbol table by cookie920850 +Ref: Symbol table by cookie-Footnote-1924980 +Node: Cached values925043 +Ref: Cached values-Footnote-1928492 +Node: Array Manipulation928583 +Ref: Array Manipulation-Footnote-1929681 +Node: Array Data Types929720 +Ref: Array Data Types-Footnote-1932423 +Node: Array Functions932515 +Node: Flattening Arrays936281 +Node: Creating Arrays943133 +Node: Extension API Variables947858 +Node: Extension Versioning948494 +Node: Extension API Informational Variables950395 +Node: Extension API Boilerplate951481 +Node: Finding Extensions955285 +Node: Extension Example955845 +Node: Internal File Description956575 +Node: Internal File Ops960666 +Ref: Internal File Ops-Footnote-1972174 +Node: Using Internal File Ops972314 +Ref: Using Internal File Ops-Footnote-1974667 +Node: Extension Samples974933 +Node: Extension Sample File Functions976457 +Node: Extension Sample Fnmatch984942 +Node: Extension Sample Fork986668 +Node: Extension Sample Inplace987886 +Node: Extension Sample Ord989664 +Node: Extension Sample Readdir990500 +Node: Extension Sample Revout992032 +Node: Extension Sample Rev2way992625 +Node: Extension Sample Read write array993315 +Node: Extension Sample Readfile995198 +Node: Extension Sample API Tests996016 +Node: Extension Sample Time996541 +Node: gawkextlib997905 +Node: Language History1000686 +Node: V7/SVR3.11002279 +Node: SVR41004599 +Node: POSIX1006041 +Node: BTL1007427 +Node: POSIX/GNU1008161 +Node: Feature History1013760 +Node: Common Extensions1026724 +Node: Ranges and Locales1028036 +Ref: Ranges and Locales-Footnote-11032654 +Ref: Ranges and Locales-Footnote-21032681 +Ref: Ranges and Locales-Footnote-31032941 +Node: Contributors1033162 +Node: Installation1038307 +Node: Gawk Distribution1039201 +Node: Getting1039685 +Node: Extracting1040511 +Node: Distribution contents1042203 +Node: Unix Installation1047908 +Node: Quick Installation1048525 +Node: Additional Configuration Options1050969 +Node: Configuration Philosophy1052705 +Node: Non-Unix Installation1055059 +Node: PC Installation1055517 +Node: PC Binary Installation1056816 +Node: PC Compiling1058664 +Node: PC Testing1061608 +Node: PC Using1062784 +Node: Cygwin1066969 +Node: MSYS1067969 +Node: VMS Installation1068483 +Node: VMS Compilation1069247 +Ref: VMS Compilation-Footnote-11070862 +Node: VMS Dynamic Extensions1070920 +Node: VMS Installation Details1072293 +Node: VMS Running1074540 +Node: VMS GNV1077374 +Node: VMS Old Gawk1078097 +Node: Bugs1078567 +Node: Other Versions1082485 +Node: Notes1088569 +Node: Compatibility Mode1089369 +Node: Additions1090152 +Node: Accessing The Source1091079 +Node: Adding Code1092519 +Node: New Ports1098564 +Node: Derived Files1102699 +Ref: Derived Files-Footnote-11108020 +Ref: Derived Files-Footnote-21108054 +Ref: Derived Files-Footnote-31108654 +Node: Future Extensions1108752 +Node: Implementation Limitations1109335 +Node: Extension Design1110587 +Node: Old Extension Problems1111741 +Ref: Old Extension Problems-Footnote-11113249 +Node: Extension New Mechanism Goals1113306 +Ref: Extension New Mechanism Goals-Footnote-11116671 +Node: Extension Other Design Decisions1116857 +Node: Extension Future Growth1118963 +Node: Old Extension Mechanism1119799 +Node: Basic Concepts1121539 +Node: Basic High Level1122220 +Ref: figure-general-flow1122491 +Ref: figure-process-flow1123090 +Ref: Basic High Level-Footnote-11126319 +Node: Basic Data Typing1126504 +Node: Glossary1129859 +Node: Copying1155321 +Node: GNU Free Documentation License1192878 +Node: Index1218015 End Tag Table |