diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 3157 |
1 files changed, 2120 insertions, 1037 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index 397daab6..68460636 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -89,12 +89,14 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Functions:: Built-in and user-defined functions. * Internationalization:: Getting `gawk' to speak your language. +* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with + `gawk'. * Advanced Features:: Stuff for advanced users, specific to `gawk'. * Library Functions:: A Library of `awk' Functions. * Sample Programs:: Many `awk' programs with complete explanations. -* Debugger:: The `dgawk' debugger. +* Debugger:: The `gawk' debugger. * Language History:: The evolution of the `awk' language. * Installation:: Installing `gawk' under various @@ -154,9 +156,12 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) uses. * AWKPATH Variable:: Searching directories for `awk' programs. +* AWKLIBPATH Variable:: Searching directories for `awk' + shared libraries. * Other Environment Variables:: The environment variables. * Exit Status:: `gawk''s exit status. * Include Files:: Including other files into your program. +* Loading Shared Libraries:: Loading shared libraries into your program. * Obsolete:: Obsolete Options and/or features. * Undocumented:: Undocumented Options and Features. * Regexp Usage:: How to Use Regular Expressions. @@ -196,6 +201,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Getline Notes:: Important things to know about `getline'. * Getline Summary:: Summary of `getline' Variants. +* Read Timeout:: Reading input with a timeout. * Command line directories:: What happens if you put a directory on the command line. * Print:: The `print' statement. @@ -353,6 +359,21 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * I18N Portability:: `awk'-level portability issues. * I18N Example:: A simple i18n example. * Gawk I18N:: `gawk' is also internationalized. +* Floating-point Programming:: Effective floating-point programming. +* Floating-point Representation:: Binary floating-point representation. +* Floating-point Context:: Floating-point context. +* Rounding Mode:: Floating-point rounding mode. +* Arbitrary Precision Floats:: Arbitrary precision floating-point + arithmetic with `gawk'. +* Setting Precision:: Setting the working precision. +* Setting Rounding Mode:: Setting the rounding mode. +* Floating-point Constants:: Representing floating-point constants. +* Changing Precision:: Changing the precision of a number. +* Exact Arithmetic:: Exact arithmetic with floating-point numbers. +* Integer Programming:: Effective integer programming. +* Arbitrary Precision Integers:: Arbitrary precision integer + arithmetic with `gawk'. +* MPFR and GMP Libraries:: Information about the MPFR and GMP libraries. * Nondecimal Data:: Allowing nondecimal input data. * Array Sorting:: Facilities for controlling array traversal and sorting arrays. @@ -417,23 +438,23 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Anagram Program:: Finding anagrams from a dictionary. * Signature Program:: People do amazing things with too much time on their hands. -* Debugging:: Introduction to `dgawk'. -* Debugging Concepts:: Debugging In General. +* Debugging:: Introduction to `gawk' Debugger. +* Debugging Concepts:: Debugging in General. * Debugging Terms:: Additional Debugging Concepts. * Awk Debugging:: Awk Debugging. -* Sample dgawk session:: Sample `dgawk' session. -* dgawk invocation:: `dgawk' Invocation. -* Finding The Bug:: Finding The Bug. -* List of Debugger Commands:: Main `dgawk' Commands. -* Breakpoint Control:: Control of breakpoints. -* Dgawk Execution Control:: Control of execution. -* Viewing And Changing Data:: Viewing and changing data. -* Dgawk Stack:: Dealing with the stack. -* Dgawk Info:: Obtaining information about the program and - the debugger state. -* Miscellaneous Dgawk Commands:: Miscellaneous Commands. +* Sample Debugging Session:: Sample Debugging Session. +* Debugger Invocation:: How to Start the Debugger. +* Finding The Bug:: Finding the Bug. +* List of Debugger Commands:: Main Commands. +* Breakpoint Control:: Control of Breakpoints. +* Debugger Execution Control:: Control of Execution. +* Viewing And Changing Data:: Viewing and Changing Data. +* Execution Stack:: Dealing with the Stack. +* Debugger Info:: Obtaining Information about the Program and + the Debugger State. +* Miscellaneous Debugger Commands:: Miscellaneous Commands. * Readline Support:: Readline Support. -* Dgawk Limitations:: Limitations and future plans. +* Limitations:: Limitations and Future Plans. * V7/SVR3.1:: The major changes between V7 and System V Release 3.1. * SVR4:: Minor changes between System V Releases 3.1 @@ -489,6 +510,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b) * Internals:: A brief look at some `gawk' internals. * Plugin License:: A note about licensing. +* Loading Extensions:: How to load dynamic extensions. * Sample Library:: A example of new functions. * Internal File Description:: What the new functions will do. * Internal File Ops:: The code for internal file operations. @@ -849,7 +871,7 @@ and profile your `awk' programs. sample `awk' programs. Reading them allows you to see `awk' solving real problems. - *note Debugger::, describes the `awk' debugger, `dgawk'. + *note Debugger::, describes the `awk' debugger. *note Language History::, describes how the `awk' language has evolved since its first release to present. It also describes how @@ -1100,10 +1122,12 @@ it is today. It has been and continues to be a pleasure working with this team of fine people. John Haque contributed the modifications to convert `gawk' into a -byte-code interpreter, including the debugger. Stephen Davies -contributed to the effort to bring the byte-code changes into the -mainstream code base. Efraim Yawitz contributed the initial text of -*note Debugger::. +byte-code interpreter, including the debugger, and the additional +modifications for support of arbitrary precision arithmetic. Stephen +Davies contributed to the effort to bring the byte-code changes into +the mainstream code base. Efraim Yawitz contributed the initial text +of *note Debugger::. John Haque contributed the initial text of *note +Arbitrary Precision Arithmetic::. I would like to thank Brian Kernighan for invaluable assistance during the testing and debugging of `gawk', and for ongoing help and @@ -2086,6 +2110,7 @@ this major node that don't interest you right now. * Environment Variables:: The environment variables `gawk' uses. * Exit Status:: `gawk''s exit status. * Include Files:: Including other files into your program. +* Loading Shared Libraries:: Loading shared libraries into your program. * Obsolete:: Obsolete Options and/or features. * Undocumented:: Undocumented Options and Features. @@ -2219,6 +2244,15 @@ The following list describes options mandated by the POSIX standard: particularly easy mistake to make with simple variable names like `i', `j', etc.) +`-D[FILE]' +`--debug=[FILE]' + Enable debugging of `awk' programs (*note Debugging::). By + default, the debugger reads commands interactively from the + terminal. The optional FILE argument allows you to specify a file + with a list of commands for the debugger to execute + non-interactively. No space is allowed between the `-D' and FILE, + if FILE is supplied. + `-e PROGRAM-TEXT' `--source PROGRAM-TEXT' Provide program source code in the PROGRAM-TEXT. This option @@ -2261,6 +2295,15 @@ The following list describes options mandated by the POSIX standard: Print a "usage" message summarizing the short and long style options that `gawk' accepts and then exit. +`-l LIB' +`--load LIB' + Load a shared library LIB. This searches for the library using the + `AWKLIBPATH' environment variable. The correct library suffix for + your platform will be supplied by default, so it need not be + specified in the library name. The library initialization routine + should be named `dlload()'. An alternative is to use the `@load' + keyword inside the program to load a shared library. + `-L [value]' `--lint[=value]' Warn about constructs that are dubious or nonportable to other @@ -2280,6 +2323,12 @@ The following list describes options mandated by the POSIX standard: inappropriate construct. As `awk' programs are usually short, doing so is not burdensome. +`-M' +`--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::). + `-n' `--non-decimal-data' Enable automatic interpretation of octal and hexadecimal values in @@ -2293,6 +2342,14 @@ The following list describes options mandated by the POSIX standard: Force the use of the locale's decimal point character when parsing numeric input data (*note Locales::). +`-o[FILE]' +`--pretty-print[=FILE]' + Enable pretty-printing of `awk' programs. By default, output + program is created in a file named `awkprof.out'. The optional + FILE argument allows you to specify a different file name for the + output. No space is allowed between the `-o' and FILE, if FILE is + supplied. + `-O' `--optimize' Enable some optimizations on the internal representation of the @@ -2308,10 +2365,9 @@ The following list describes options mandated by the POSIX standard: for the profile file. No space is allowed between the `-p' and FILE, if FILE is supplied. - When run with `gawk', the profile is just a "pretty printed" - version of the program. When run with `pgawk', the profile - contains execution counts for each statement in the program in the - left margin, and function call counts for each function. + The profile contains execution counts for each statement in the + program in the left margin, and function call counts for each + function. `-P' `--posix' @@ -2345,11 +2401,6 @@ The following list describes options mandated by the POSIX standard: remains both for backward compatibility, and for use in combination with the `--traditional' option. -`-R FILE' -`--command=FILE' - `dgawk' only. Read `dgawk' debugger options and commands from - FILE. *Note Dgawk Info::, for more information. - `-S' `--sandbox' Disable the `system()' function, input redirections with `getline', @@ -2529,10 +2580,12 @@ A number of environment variables influence how `gawk' behaves. * AWKPATH Variable:: Searching directories for `awk' programs. +* AWKLIBPATH Variable:: Searching directories for `awk' + shared libraries. * Other Environment Variables:: The environment variables. -File: gawk.info, Node: AWKPATH Variable, Next: Other Environment Variables, Up: Environment Variables +File: gawk.info, Node: AWKPATH Variable, Next: AWKLIBPATH Variable, Up: Environment Variables 2.5.1 The `AWKPATH' Environment Variable ---------------------------------------- @@ -2591,9 +2644,22 @@ the value of `$(datadir)' generated when `gawk' was configured. You probably don't need to worry about this, though. -File: gawk.info, Node: Other Environment Variables, Prev: AWKPATH Variable, Up: Environment Variables +File: gawk.info, Node: AWKLIBPATH Variable, Next: Other Environment Variables, Prev: AWKPATH Variable, Up: Environment Variables + +2.5.2 The `AWKLIBPATH' Environment Variable +------------------------------------------- + +The `AWKLIBPATH' environment variable is similar to the `AWKPATH' +variable, but it is used to search for shared libraries specified with +the `-l' option rather than for source files. If the library is not +found, the path is searched again after adding the appropriate shared +library suffix for the platform. For example, on GNU/Linux systems, +the suffix `.so' is used. -2.5.2 Other Environment Variables + +File: gawk.info, Node: Other Environment Variables, Prev: AWKLIBPATH Variable, Up: Environment Variables + +2.5.3 Other Environment Variables --------------------------------- A number of other environment variables affect `gawk''s behavior, but @@ -2614,6 +2680,10 @@ used by regular users. milliseconds. On systems that do not support the `usleep()' system call, the value is rounded up to an integral number of seconds. +`GAWK_READ_TIMEOUT' + Specifies the time, in milliseconds, for `gawk' to wait for input + before returning with an error. *Note Read Timeout::. + The environment variables in the following list are meant for use by the `gawk' developers for testing and tuning. They are subject to change. The variables are: @@ -2668,7 +2738,7 @@ with the value of the C constant `EXIT_SUCCESS'. This is usually zero. non-POSIX systems, this value may be mapped to `EXIT_FAILURE'. -File: gawk.info, Node: Include Files, Next: Obsolete, Prev: Exit Status, Up: Invoking Gawk +File: gawk.info, Node: Include Files, Next: Loading Shared Libraries, Prev: Exit Status, Up: Invoking Gawk 2.7 Including Other Files Into Your Program =========================================== @@ -2764,9 +2834,41 @@ always searched first for source files, before searching in `AWKPATH', and this also applies to files named with `@include'. -File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: Include Files, Up: Invoking Gawk +File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev: Include Files, Up: Invoking Gawk + +2.8 Loading Shared Libraries Into Your Program +============================================== + +This minor node describes a feature that is specific to `gawk'. + + The `@load' keyword can be used to read external `awk' shared +libraries. This allows you to link in compiled code that may offer +superior performance and/or give you access to extended capabilities +not supported by the `awk' language. The `AWKLIBPATH' variable is used +to search for the shared library. Using `@load' is completely +equivalent to using the `-l' command-line option. -2.8 Obsolete Options and/or Features + If the shared library is not initially found in `AWKLIBPATH', another +search is conducted after appending the platform's default shared +library suffix to the filename. For example, on GNU/Linux systems, the +suffix `.so' is used. + + $ gawk '@load "ordchr"; BEGIN {print chr(65)}' + -| A + +This is equivalent to the following example: + + $ gawk -lordchr 'BEGIN {print chr(65)}' + -| A + +For command-line usage, the `-l' option is more convenient, but `@load' +is useful for embedding inside an `awk' source file that requires +access to a shared library. + + +File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: Loading Shared Libraries, Up: Invoking Gawk + +2.9 Obsolete Options and/or Features ==================================== This minor node describes features and/or command-line options from @@ -2782,8 +2884,8 @@ worked. As of version 4.0, they are no longer interpreted specially by File: gawk.info, Node: Undocumented, Prev: Obsolete, Up: Invoking Gawk -2.9 Undocumented Options and Features -===================================== +2.10 Undocumented Options and Features +====================================== Use the Source, Luke! Obi-Wan @@ -3615,6 +3717,8 @@ have to be named on the `awk' command line (*note Getline::). * Multiple Line:: Reading multi-line records. * Getline:: Reading files under explicit program control using the `getline' function. +* Read Timeout:: Reading input with a timeout. + * Command line directories:: What happens if you put a directory on the command line. @@ -4802,7 +4906,7 @@ feature of `RS' does not apply. It does apply to the default field separator of a single space: `FS = " "'. -File: gawk.info, Node: Getline, Next: Command line directories, Prev: Multiple Line, Up: Reading Files +File: gawk.info, Node: Getline, Next: Read Timeout, Prev: Multiple Line, Up: Reading Files 4.9 Explicit Input with `getline' ================================= @@ -5227,9 +5331,101 @@ VAR Table 4.1: getline Variants and What They Set -File: gawk.info, Node: Command line directories, Prev: Getline, Up: Reading Files +File: gawk.info, Node: Read Timeout, Next: Command line directories, Prev: Getline, Up: Reading Files + +4.10 Reading Input With A Timeout +================================= -4.10 Directories On The Command Line +You may specify a timeout in milliseconds for reading input from a +terminal, pipe or two-way communication including, TCP/IP sockets. This +can be done on a per input, command or connection basis, by setting a +special element in the `PROCINFO' array: + + PROCINFO["input_name", "READ_TIMEOUT"] = TIMEOUT IN MILLISECONDS + + When set, this will cause `gawk' to time out and return failure if +no data is available to read within the specified timeout period. For +example, a TCP client can decide to give up on receiving any response +from the server after a certain amount of time: + + Service = "/inet/tcp/0/localhost/daytime" + PROCINFO[Service, "READ_TIMEOUT"] = 100 + if ((Service |& getline) > 0) + print $0 + else if (ERRNO != "") + print ERRNO + + Here is how to read interactively from the terminal(1) without +waiting for more than five seconds: + + PROCINFO["/dev/stdin", "READ_TIMEOUT"] = 5000 + while ((getline < "/dev/stdin") > 0) + print $0 + + `gawk' will terminate the read operation if input does not arrive +after waiting for the timeout period, return failure and set the +`ERRNO' variable to an appropriate string value. A negative or zero +value for the timeout is the same as specifying no timeout at all. + + A timeout can also be set for reading from the terminal in the +implicit loop that reads input records and matches them against +patterns, like so: + + $ gawk 'BEGIN { PROCINFO["-", "READ_TIMEOUT"] = 5000 } + > { print "You entered: " $0 }' + gawk + -| You entered: gawk + + In this case, failure to respond within five seconds results in the +following error message: + + error--> gawk: cmd. line:2: (FILENAME=- FNR=1) fatal: error reading input file `-': Connection timed out + + The timeout can be set or changed at any time, and will take effect +on the next attempt to read from the input device. In the following +example, we start with a timeout value of one second, and progressively +reduce it by one-tenth of a second until we wait indefinitely for the +input to arrive: + + PROCINFO[Service, "READ_TIMEOUT"] = 1000 + while ((Service |& getline) > 0) { + print $0 + PROCINFO[S, "READ_TIMEOUT"] -= 100 + } + + NOTE: You should not assume that the read operation will block + exactly after the tenth record has been printed. It is possible + that `gawk' will read and buffer more than one record's worth of + data the first time. Because of this, changing the value of + timeout like in the above example is not very useful. + + If the `PROCINFO' element is not present and the environment +variable `GAWK_READ_TIMEOUT' exists, `gawk' uses its value to +initialize the timeout value. The exclusive use of the environment +variable to specify timeout has the disadvantage of not being able to +control it on a per command or connection basis. + + `gawk' considers a timeout event to be an error even though the +attempt to read from the underlying device may succeed in a later +attempt. This is a limitation, and it also means that you cannot use +this to multiplex input from two or more sources. + + Assigning a timeout value prevents read operations from blocking +indefinitely. But bear in mind that there are other ways `gawk' can +stall waiting for an input device to be ready. A network client can +sometimes take a long time to establish a connection before it can +start reading any data, or the attempt to open a FIFO special file for +reading can block indefinitely until some other process opens it for +writing. + + ---------- Footnotes ---------- + + (1) This assumes that standard input is the keyboard + + +File: gawk.info, Node: Command line directories, Prev: Read Timeout, Up: Reading Files + +4.11 Directories On The Command Line ==================================== According to the POSIX standard, files named on the `awk' command line @@ -9188,6 +9384,15 @@ specific to `gawk' are marked with a pound sign (`#'). every `print' statement. Its default value is `"\n"', the newline character. (*Note Output Separators::.) +`PREC #' + The working precision of arbitrary precision floating-point + numbers, 53 by default (*note Setting Precision::). + +`ROUNDMODE #' + The rounding mode to use for arbitrary precision arithmetic on + numbers, by default `"N"' (`roundTiesToEven' in the IEEE-754 + standard) (*note Setting Rounding Mode::). + `RS' This is `awk''s input record separator. Its default value is a string containing a single newline character, which means that an @@ -9293,7 +9498,8 @@ with a pound sign (`#'). Some operating systems may not have environment variables. On such systems, the `ENVIRON' array is empty (except for - `ENVIRON["AWKPATH"]', *note AWKPATH Variable::). + `ENVIRON["AWKPATH"]', *note AWKPATH Variable:: and + `ENVIRON["AWKLIBPATH"]', *note AWKLIBPATH Variable::). `ERRNO #' If a system error occurs during a redirection for `getline', @@ -9393,6 +9599,23 @@ with a pound sign (`#'). `PROCINFO["version"]' The version of `gawk'. + 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::): + + `PROCINFO["mpfr_version"]' + The version of the GNU MPFR library. + + `PROCINFO["gmp_version"]' + The version of the GNU MP library. + + `PROCINFO["prec_max"]' + The maximum precision supported by MPFR. + + `PROCINFO["prec_min"]' + The minimum precision required by MPFR. + On some systems, there may be elements in the array, `"group1"' through `"groupN"' for some N. N is the number of supplementary groups that the process has. Use the `in' operator to test for @@ -12906,7 +13129,7 @@ example, in the following case: `gawk' will look up the actual function to call only once. -File: gawk.info, Node: Internationalization, Next: Advanced Features, Prev: Functions, Up: Top +File: gawk.info, Node: Internationalization, Next: Arbitrary Precision Arithmetic, Prev: Functions, Up: Top 10 Internationalization with `gawk' *********************************** @@ -13486,9 +13709,745 @@ writing, the latest version of GNU `gettext' is version 0.18.1 usage messages, warnings, and fatal errors in the local language. -File: gawk.info, Node: Advanced Features, Next: Library Functions, Prev: Internationalization, Up: Top +File: gawk.info, Node: Arbitrary Precision Arithmetic, Next: Advanced Features, Prev: Internationalization, Up: Top + +11 Arbitrary Precision Arithmetic with `gawk' +********************************************* + + There's a credibility gap: We don't know how much of the + computer's answers to believe. Novice computer users solve this + problem by implicitly trusting in the computer as an infallible + authority; they tend to believe that all digits of a printed + answer are significant. Disillusioned computer users have just the + opposite approach; they are constantly afraid that their answers + are almost meaningless. + + Donald Knuth(1) + + This minor node decsribes how to use the arbitrary precision (also +known as "multiple precision" or "infinite precision") numeric +capabilites in `gawk' to produce maximally accurate results when you +need it. But first you should check if your version of `gawk' supports +arbitrary precision arithmetic. The easiest way to find out is to look +at the output of the following command: + + $ gawk --version + -| GNU Awk 4.1.0 (GNU MPFR 3.1.0, GNU MP 5.0.3) + -| Copyright (C) 1989, 1991-2012 Free Software Foundation. + ... + + `gawk' uses the GNU MPFR (http://www.mpfr.org) and GNU MP +(http://gmplib.org) (GMP) libraries for arbitrary precision arithmetic +on numbers. So if you do not see the names of these libraries in the +output, then your version of `gawk' does not support arbitrary +precision arithmetic. + + Even if you aren't interested in arbitrary precision arithmetic, you +may still benifit from knowing about how `gawk' handles numbers in +general, and the limitations of doing arithmetic with ordinary `gawk' +numbers. + +* Menu: + +* Floating-point Programming:: Effective Floating-point Programming. +* Floating-point Representation:: Binary Floating-point Representation. +* Floating-point Context:: Floating-point Context. +* Rounding Mode:: Floating-point Rounding Mode. +* Arbitrary Precision Floats:: Arbitrary Precision Floating-point + Arithmetic with `gawk'. +* Setting Precision:: Setting the Working Precision. +* Setting Rounding Mode:: Setting the Rounding Mode. +* Floating-point Constants:: Representing Floating-point Constants. +* Changing Precision:: Changing the Precision of a Number. +* Exact Arithmetic:: Exact Arithmetic with Floating-point Numbers. +* Integer Programming:: Effective Integer Programming. +* Arbitrary Precision Integers:: Arbitrary Precision Integer + Arithmetic with `gawk'. +* MPFR and GMP Libraries:: Information About the MPFR and GMP Libraries. + + ---------- Footnotes ---------- + + (1) Donald E. Knuth. `The Art of Computer Programming'. Volume 2, +`Seminumerical Algorithms', third edition, 1998, ISBN 0-201-89683-4, p. +229. + + +File: gawk.info, Node: Floating-point Programming, Next: Floating-point Representation, Up: Arbitrary Precision Arithmetic + +11.1 Effective Floating-point Programming +========================================= + +Numerical programming is an extensive area; if you need to develop +sophisticated numerical algorithms then `gawk' may not be the ideal +tool, and this documentation may not be sufficient. It might require a +book or two to communicate how to compute with ideal accuracy and +precision and the result often depends on the particular application. + + NOTE: A floating-point calculation's "accuracy" is how close it + comes to the real value. This is as opposed to the "precision", + which usually refers to the number of bits used to represent the + number (see the Wikipedia article + (http://en.wikipedia.org/wiki/Accuracy_and_precision) for more + information). + + Binary floating-point representations and arithmetic are inexact. +Simple values like 0.1 cannot be precisely represented using binary +floating-point numbers, and the limited precision of floating-point +numbers means that slight changes in the order of operations or the +precision of intermediate storage can change the result. To make +matters worse with arbitrary precision floating-point, you can set the +precision before starting a computation, but then you cannot be sure of +the number of significant decimal places in the final result. + + Sometimes you need to think more about what you really want and +what's really happening. Consider the two numbers in the following +example: + + x = 0.875 # 1/2 + 1/4 + 1/8 + y = 0.425 + + Unlike the number in `y', the number stored in `x' is exactly +representable in binary since it can be written as a finite sum of one +or more fractions whose denominators are all powers of two. When +`gawk' reads a floating-point number from program source, it +automatically rounds that number to whatever precision your machine +supports. If you try to print the numeric content of a variable using +an output format string of `"%.17g"', it may not produce the same +number as you assigned to it: + + $ gawk 'BEGIN { x = 0.875; y = 0.425 + > printf("%0.17g, %0.17g\n", x, y) }' + -| 0.875, 0.42499999999999999 + + Often the error is so small you do not even notice it, and if you do, +you can always specify how much precision you would like in your output. +Usually this is a format string like `"%.15g"', which when used in the +previous example, produces an output identical to the input. + + Because the underlying representation can be little bit off from the +exact value, comparing floats to see if they are equal is generally not +a good idea. Here is an example where it does not work like you expect: + + $ gawk 'BEGIN { print (0.1 + 12.2 == 12.3) }' + -| 0 + + The loss of accuracy during a single computation with floating-point +numbers usually isn't enough to worry about. However, if you compute a +value which is the result of a sequence of floating point operations, +the error can accumulate and greatly affect the computation itself. +Here is an attempt to compute the value of the constant pi using one of +its many series representations: + + BEGIN { + x = 1.0 / sqrt(3.0) + n = 6 + for (i = 1; i < 30; i++) { + n = n * 2.0 + x = (sqrt(x * x + 1) - 1) / x + printf("%.15f\n", n * x) + } + } + + When run, the early errors propagating through later computations +cause the loop to terminate prematurely after an attempt to divide by +zero. + + $ gawk -f pi.awk + -| 3.215390309173475 + -| 3.159659942097510 + -| 3.146086215131467 + -| 3.142714599645573 + ... + -| 3.224515243534819 + -| 2.791117213058638 + -| 0.000000000000000 + error--> gawk: pi.awk:6: fatal: division by zero attempted + + Here is one more example where the inaccuracies in internal +representations yield an unexpected result: + + $ gawk 'BEGIN { + > for (d = 1.1; d <= 1.5; d += 0.1) + > i++ + > print i + > }' + -| 4 + + Can computation using aribitrary precision help with the previous +examples? If you are impatient to know, see *note Exact Arithmetic::. + + Instead of aribitrary precision floating-point arithmetic, often all +you need is an adjustment of your logic or a different order for the +operations in your calculation. The stability and the accuracy of the +computation of the constant pi in the previous example can be enhanced +by using the following simple algebraic transformation: + + (sqrt(x * x + 1) - 1) / x = x / (sqrt(x * x + 1) + x) + + There is no need to be unduly suspicious about the results from +floating-point arithmetic. The lesson to remember is that +floating-point math is always more complex than the math using pencil +and paper. In order to take advantage of the power of computer +floating-point, you need to know its limitations and work within them. +For most casual use of floating-point arithmetic, you will often get +the expected result in the end if you simply round the display of your +final results to the correct number of significant decimal digits. +Avoid presenting numerical data in a manner that implies better +precision than is actually the case. + + +File: gawk.info, Node: Floating-point Representation, Next: Floating-point Context, Prev: Floating-point Programming, Up: Arbitrary Precision Arithmetic + +11.2 Binary Floating-point Representation +========================================= + +Although floating-point representations vary from machine to machine, +the most commonly encountered representation is that defined by the +IEEE 754 Standard. An IEEE-754 format value has three components: + + * a sign bit telling whether the number is positive or negative, + + * an "exponent" giving its order of magnitude, E, + + * and a "significand", S, specifying the actual digits of the number. + + The value of the number is then S * 2^E. The first bit of a +non-zero binary significand is always one, so the significand in an +IEEE-754 format only includes the fractional part, leaving the leading +one implicit. + + Three of the standard IEEE-754 types are 32-bit single precision, +64-bit double precision and 128-bit quadruple precision. The standard +also specifies extended precision formats to allow greater precisions +and larger exponent ranges. + + +File: gawk.info, Node: Floating-point Context, Next: Rounding Mode, Prev: Floating-point Representation, Up: Arbitrary Precision Arithmetic + +11.3 Floating-point Context +=========================== + +A floating-point context defines the environment for arithmetic +operations. It governs precision, sets rules for rounding and limits +range for exponents. The context has the following primary components: + +`precision' + Precision of the floating-point format in bits. + +`emax' + Maximum exponent allowed for this format. + +`emin' + Minimum exponent allowed for this format. + +`underflow behavior' + The format may or may not support gradual underflow. + +`rounding' + The rounding mode of this context. + + *note table-ieee-formats:: lists the precision and exponent field +values for the basic IEEE-754 binary formats: + +Name Total bits Precision emin emax +--------------------------------------------------------------------------- +Single 32 24 -126 +127 +Double 64 53 -1022 +1023 +Quadruple 128 113 -16382 +16383 + +Table 11.1: Basic IEEE Formats + + NOTE: The precision numbers include the implied leading one that + gives them one extra bit of significand. + + A floating-point context can also determine which signals are treated +as exceptions, and can set rules for arithmetic with special values. +Please consult the IEEE-754 standard or other resources for details. + + `gawk' ordinarily uses the hardware double precision representation +for numbers. On most systems, this is IEEE-754 floating-point format, +corresponding to 64-bit binary with 53 bits of precision. + + NOTE: In case an underflow occurs, the standard allows, but does + not require, the result from an arithmetic operation to be a + number smaller than the smallest nonzero normalized number. Such + numbers do not have as many significant digits as normal numbers, + and are called "denormals" or "subnormals". The alternative, + simply returning a zero, is called "flush to zero". The basic + IEEE-754 binary formats support subnormal numbers. + + +File: gawk.info, Node: Rounding Mode, Next: Arbitrary Precision Floats, Prev: Floating-point Context, Up: Arbitrary Precision Arithmetic + +11.4 Floating-point Rounding Mode +================================= + +The "rounding mode" specifies the behavior for the results of numerical +operations when discarding extra precision. Each rounding mode indicates +how the least significant returned digit of a rounded result is to be +calculated. The `ROUNDMODE' variable (*note Setting Rounding Mode::) +provides program level control over the rounding mode. *note +table-rounding-modes:: lists the IEEE-754 defined rounding modes: + +Rounding Mode IEEE Name `ROUNDMODE' +--------------------------------------------------------------------------- +Round to nearest, ties to even `roundTiesToEven' `"N"' or `"n"' +Round toward plus Infinity `roundTowardPositive' `"U"' or `"u"' +Round toward negative Infinity `roundTowardNegative' `"D"' or `"d"' +Round toward zero `roundTowardZero' `"Z"' or `"z"' +Round to nearest, ties away `roundTiesToAway' `"A"' or `"a"' +from zero + +Table 11.2: Rounding Modes + + The default mode `roundTiesToEven' is the most preferred, but the +least intuitive. This method does the obvious thing for most values, by +rounding them up or down to the nearest digit. For example, rounding +1.132 to two digits yields 1.13, and rounding 1.157 yields 1.16. + + However, when it comes to rounding a value that is exactly halfway +between, things do not work the way you probably learned in school. In +this case, the number is rounded to the nearest even digit. So +rounding 0.125 to two digits rounds down to 0.12, but rounding 0.6875 +to three digits rounds up to 0.688. You probably have already +encountered this rounding mode when using the `printf' routine to +format floating-point numbers. For example: + + BEGIN { + x = -4.5 + for (i = 1; i < 10; i++) { + x += 1.0 + printf("%4.1f => %2.0f\n", x, x) + } + } + +produces the following output when run(1): + + -3.5 => -4 + -2.5 => -2 + -1.5 => -2 + -0.5 => 0 + 0.5 => 0 + 1.5 => 2 + 2.5 => 2 + 3.5 => 4 + 4.5 => 4 + + The theory behind the rounding mode `roundTiesToEven' is that it +more or less evenly distributes upward and downward rounds of exact +halves, which might cause the round-off error to cancel itself out. +This is the default rounding mode used in IEEE-754 computing functions +and operators. + + The other rounding modes are rarely used. Round toward positive +infinity (`roundTowardPositive') and round toward negative infinity +(`roundTowardNegative') are often used to implement interval arithmetic, +where you adjust the rounding mode to calculate upper and lower bounds +for the range of output. The `roundTowardZero' mode can be used for +converting floating-point numbers to integers. The rounding mode +`roundTiesToAway' rounds the result to the nearest number and selects +the number with the larger magnitude if a tie occurs. + + Some numerical analysts will tell you that your choice of rounding +style has tremendous impact on the final outcome, and advise you to +wait until final output for any rounding. Instead, you can often +achieve this goal by setting the precision initially to some value +sufficiently larger than the final desired precision, so that the +accumulation of round-off error does not influence the outcome. If you +suspect that results from your computation are sensitive to +accumulation of round-off error, one way to be sure is to look for a +significant difference in output when you change the rounding mode. + + ---------- Footnotes ---------- + + (1) It is possible for the output to be completely different if the +C library in your system does not use the IEEE-754 even-rounding rule +to round halfway cases for `printf()'. + + +File: gawk.info, Node: Arbitrary Precision Floats, Next: Setting Precision, Prev: Rounding Mode, Up: Arbitrary Precision Arithmetic + +11.5 Arbitrary Precision Floating-point Arithmetic with `gawk' +============================================================== + +`gawk' uses the GNU MPFR library for arbitrary precision floating-point +arithmetic. The MPFR library provides precise control over precisions +and rounding modes, and gives correctly rounded reproducible +platform-independent results. With the command-line option `--bignum' +or `-M', all floating-point arithmetic operators and numeric functions +can yield results to any desired precision level supported by MPFR. +Two built-in variables `PREC' (*note Setting Precision::) and +`ROUNDMODE' (*note Setting Rounding Mode::) provide control over the +working precision and the rounding mode. The precision and the +rounding mode are set globally for every operation to follow. + + The default working precision for arbitrary precision floats is 53, +and the default value for `ROUNDMODE' is `"N"', which selects the +IEEE-754 `roundTiesToEven' (*note Rounding Mode::) rounding mode.(1) +`gawk' uses the default exponent range in MPFR (EMAX = 2^30 - 1, EMIN = +-EMAX) for all floating-point contexts. There is no explicit mechanism +to adjust the exponent range. MPFR does not implement subnormal +numbers by default, and this behavior cannot be changed in `gawk'. + + NOTE: When emulating an IEEE-754 format (*note Setting + Precision::), `gawk' internally adjusts the exponent range to the + value defined for the format and also performs computations needed + for gradual underflow (subnormal numbers). + + NOTE: MPFR numbers are variable-size entities, consuming only as + much space as needed to store the significant digits. Since the + performance using MPFR numbers pales in comparison to doing math + using the underlying machine types, you should consider using only + as much precision as needed by your program. + + ---------- Footnotes ---------- + + (1) The default precision is 53, since according to the MPFR +documentation, the library should be able to exactly reproduce all +computations with double-precision machine floating-point numbers +(`double' type in C), except the default exponent range is much wider +and subnormal numbers are not implemented. + + +File: gawk.info, Node: Setting Precision, Next: Setting Rounding Mode, Prev: Arbitrary Precision Floats, Up: Arbitrary Precision Arithmetic + +11.6 Setting the Working Precision +================================== + +`gawk' uses a global working precision; it does not keep track of the +precision or accuracy of individual numbers. Performing an arithmetic +operation or calling a built-in function rounds the result to the +current working precision. The default working precision is 53 which +can be modified using the built-in variable `PREC'. You can also set the +value to one of the following pre-defined case-insensitive strings to +emulate an IEEE-754 binary format: + +`PREC' IEEE-754 Binary Format +--------------------------------------------------- +`"half"' 16-bit half-precision. +`"single"' Basic 32-bit single precision. +`"double"' Basic 64-bit double precision. +`"quad"' Basic 128-bit quadruple precision. +`"oct"' 256-bit octuple precision. + + The following example illustrates the effects of changing precision +on arithmetic operations: + + $ gawk -M -vPREC=100 'BEGIN { x = 1.0e-400; print x + 0; \ + > PREC = "double"; print x + 0 }' + -| 1e-400 + -| 0 + + Binary and decimal precisions are related approximately according to +the formula: + + PREC = 3.322 * DPS + +Here, PREC denotes the binary precision (measured in bits) and DPS +(short for decimal places) is the decimal digits. We can easily +calculate how many decimal digits the 53-bit significand of an IEEE +double is equivalent to: 53 / 3.332 which is equal to about 15.95. But +what does 15.95 digits actually mean? It depends whether you are +concerned about how many digits you can rely on, or how many digits you +need. + + It is important to know how many bits it takes to uniquely identify +a double-precision value (the C type `double'). If you want to convert +from `double' to decimal and back to `double' (e.g., saving a `double' +representing an intermediate result to a file, and later reading it +back to restart the computation), then a few more decimal digits are +required. 17 digits is generally enough for a `double'. + + It can also be important to know what decimal numbers can be uniquely +represented with a `double'. If you want to convert from decimal to +`double' and back again, 15 digits is the most that you can get. Stated +differently, you should not present the numbers from your +floating-point computations with more than 15 significant digits in +them. + + Conversely, it takes a precision of 332 bits to hold an approximation +of constant pi that is accurate to 100 decimal places. You should +always add some extra bits in order to avoid the confusing round-off +issues that occur because numbers are stored internally in binary. + + +File: gawk.info, Node: Setting Rounding Mode, Next: Floating-point Constants, Prev: Setting Precision, Up: Arbitrary Precision Arithmetic + +11.7 Setting the Rounding Mode +============================== + +The built-in variable `ROUNDMODE' has the default value `"N"', which +selects the IEEE-754 rounding mode `roundTiesToEven'. The other +possible values for `ROUNDMODE' are `"U"' for rounding mode +`roundTowardPositive', `"D"' for `roundTowardNegative', and `"Z"' for +`roundTowardZero'. `gawk' also accepts `"A"' to select the IEEE-754 +mode `roundTiesToAway' if your version of the MPFR library supports it; +otherwise setting `ROUNDMODE' to this value has no effect. *Note +Rounding Mode::, for the meanings of the various rounding modes. + + Here is an example of how to change the default rounding behavior of +`printf''s output: + + $ gawk -M -vROUNDMODE="Z" 'BEGIN { printf("%.2f\n", 1.378) }' + -| 1.37 + + +File: gawk.info, Node: Floating-point Constants, Next: Changing Precision, Prev: Setting Rounding Mode, Up: Arbitrary Precision Arithmetic + +11.8 Representing Floating-point Constants +========================================== + +Be wary of floating-point constants! When reading a floating-point +constant from program source code, `gawk' uses the default precision, +unless overridden by an assignment to the special variable `PREC' on +the command line, to store it internally as a MPFR number. Changing +the precision using `PREC' in the program text does not change the +precision of a constant. If you need to represent a floating-point +constant at a higher precision than the default and cannot use a +command line assignment to `PREC', you should either specify the +constant as a string, or a rational number whenever possible. The +following example illustrates the differences among various ways to +print a floating-point constant: + + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 0.1) }' + -| 0.1000000000000000055511151 + $ gawk -M -vPREC = 113 'BEGIN { printf("%0.25f\n", 0.1) }' + -| 0.1000000000000000000000000 + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", "0.1") }' + -| 0.1000000000000000000000000 + $ gawk -M 'BEGIN { PREC = 113; printf("%0.25f\n", 1/10) }' + -| 0.1000000000000000000000000 + + In the first case, the number is stored with the default precision +of 53. + + +File: gawk.info, Node: Changing Precision, Next: Exact Arithmetic, Prev: Floating-point Constants, Up: Arbitrary Precision Arithmetic + +11.9 Changing the Precision of a Number +======================================= + + The point is that in any variable-precision package, a decision is + made on how to treat numbers given as data, or arising in + intermediate results, which are represented in floating-point + format to a precision lower than working precision. Do we promote + them to full membership of the high-precision club, or do we treat + them and all their associates as second-class citizens? Sometimes + the first course is proper, sometimes the second, and it takes + careful analysis to tell which. + + Dirk Laurie(1) + + `gawk' does not implicitly modify the precision of any previously +computed results when the working precision is changed with an +assignment to `PREC'. The precision of a number is always the one that +was used at the time of its creation, and there is no way for the user +to explicitly change it afterwards. However, since the result of a +floating-point arithmetic operation is always an arbitrary precision +floating-point value--with a precision set by the value of `PREC'--one +of the following workarounds effectively accomplishes the desired +behavior: + + x = x + 0.0 + +or: + + x += 0.0 + + ---------- Footnotes ---------- + + (1) Dirk Laurie. `Variable-precision Arithmetic Considered Perilous +- A Detective Story'. Electronic Transactions on Numerical Analysis. +Volume 28, pp. 168-173, 2008. + + +File: gawk.info, Node: Exact Arithmetic, Next: Integer Programming, Prev: Changing Precision, Up: Arbitrary Precision Arithmetic + +11.10 Exact Arithmetic with Floating-point Numbers +================================================== + + CAUTION: Never depend on the exactness of floating-point + arithmetic, even for apparently simple expressions! + + Can arbitrary precision arithmetic give exact results? There are no +easy answers. The standard rules of algebra often do not apply when +using floating-point arithmetic. Among other things, the distributive +and associative laws do not hold completely, and order of operation may +be important for your computation. Rounding error, cumulative precision +loss and underflow are often troublesome. + + When `gawk' tests the expressions `0.1 + 12.2' and `12.3' for +equality using the machine double precision arithmetic, it decides that +they are not equal! (*Note Floating-point Programming::.) You can get +the result you want by increasing the precision; 56 in this case will +get the job done: + + $ gawk -M -vPREC=56 'BEGIN { print (0.1 + 12.2 == 12.3) }' + -| 1 + + If adding more bits is good, perhaps adding even more bits of +precision is better? Here is what happens if we use an even larger +value of `PREC': + + $ gawk -M -vPREC=201 'BEGIN { print (0.1 + 12.2 == 12.3) }' + -| 0 + + This is not a bug in `gawk' or in the MPFR library. It is easy to +forget that the finite number of bits used to store the value is often +just an approximation after proper rounding. The test for equality +succeeds if and only if _all_ bits in the two operands are exactly the +same. Since this is not necessarily true after floating-point +computations with a particular precision and effective rounding rule, a +straight test for equality may not work. + + So, don't assume that floating-point values can be compared for +equality. You should also exercise caution when using other forms of +comparisons. The standard way to compare between floating-point +numbers is to determine how much error (or "tolerance") you will allow +in a comparison and check to see if one value is within this error +range of the other. + + In applications where 15 or fewer decimal places suffice, hardware +double precision arithmetic can be adequate, and is usually much faster. +But you do need to keep in mind that every floating-point operation can +suffer a new rounding error with catastrophic consequences as +illustrated by our attempt to compute the value of the constant pi, +(*note Floating-point Programming::). Extra precision can greatly +enhance the stability and the accuracy of your computation in such +cases. + + Repeated addition is not necessarily equivalent to multiplication in +floating-point arithmetic. In the last example (*note Floating-point +Programming::), you may or may not succeed in getting the correct +result by choosing an arbitrarily large value for `PREC'. Reformulation +of the problem at hand is often the correct approach in such situations. + + +File: gawk.info, Node: Integer Programming, Next: Arbitrary Precision Integers, Prev: Exact Arithmetic, Up: Arbitrary Precision Arithmetic + +11.11 Effective Integer Programming +=================================== + +As has been mentioned already, `gawk' ordinarily uses hardware double +precision with 64-bit IEEE binary floating-point representation for +numbers on most systems. A large integer like 9007199254740997 has a +binary representation that, although finite, is more than 53 bits long; +it must also be rounded to 53 bits. The biggest integer that can be +stored in a C `double' is usually the same as the largest possible +value of a `double'. If your system `double' is an IEEE 64-bit +`double', this largest possible value is an integer and can be +represented precisely. What more should one know about integers? + + If you want to know what is the largest integer, such that it and +all smaller integers can be stored in 64-bit doubles without losing +precision, then the answer is 2^53. The next representable number is +the even number 2^53 + 2, meaning it is unlikely that you will be able +to make `gawk' print 2^53 + 1 in integer format. The range of integers +exactly representable by a 64-bit double is [-2^53, 2^53]. If you ever +see an integer outside this range in `gawk' using 64-bit doubles, you +have reason to be very suspicious about the accuracy of the output. +Here is a simple program with erroneous output: + + $ gawk 'BEGIN { i = 2^53 - 1; for (j = 0; j < 4; j++) print i + j }' + -| 9007199254740991 + -| 9007199254740992 + -| 9007199254740992 + -| 9007199254740994 + + The lesson is to not assume that any large integer printed by `gawk' +represents an exact result from your computation, especially if it wraps +around on your screen. + + +File: gawk.info, Node: Arbitrary Precision Integers, Next: MPFR and GMP Libraries, Prev: Integer Programming, Up: Arbitrary Precision Arithmetic + +11.12 Arbitrary Precision Integer Arithmetic with `gawk' +======================================================== + +If the option `--bignum' or `-M' is specified, `gawk' performs all +integer arithmetic using GMP arbitrary precision integers. Any number +that looks like an integer in a program source or data file is stored +as an arbitrary precision integer. The size of the integer is limited +only by your computer's memory. The current floating-point context has +no effect on operations involving integers. For example, the following +computes 5^4^3^2, the result of which is beyond the limits of ordinary +`gawk' numbers: + + $ gawk -M 'BEGIN { + > x = 5^4^3^2 + > print "# of digits =", length(x) + > print substr(x, 1, 20), "...", substr(x, length(x) - 19, 20) + > }' + -| # of digits = 183231 + -| 62060698786608744707 ... 92256259918212890625 + + If you were to compute the same value using arbitrary precision +floating-point values instead, the precision needed for correct output +(using the formula `prec = 3.322 * dps'), would be 3.322 x 183231, or +608693. + + The result from an arithmetic operation with an integer and a +floating-point value is a floating-point value with a precision equal +to the working precision. The following program calculates the eighth +term in Sylvester's sequence(1) using a recurrence: + + $ gawk -M 'BEGIN { + > s = 2.0 + > for (i = 1; i <= 7; i++) + > s = s * (s - 1) + 1 + > print s + > }' + -| 113423713055421845118910464 + + The output differs from the acutal number, +113423713055421844361000443, because the default precision of 53 is not +enough to represent the floating-point results exactly. You can either +increase the precision (100 is enough in this case), or replace the +floating-point constant `2.0' with an integer, to perform all +computations using integer arithmetic to get the correct output. + + It will sometimes be necessary for `gawk' to implicitly convert an +arbitrary precision integer into an arbitrary precision floating-point +value. This is primarily because the MPFR library does not always +provide the relevant interface to process arbitrary precision integers +or mixed-mode numbers as needed by an operation or function. In such a +case, the precision is set to the minimum value necessary for exact +conversion, and the working precision is not used for this purpose. If +this is not what you need or want, you can employ a subterfuge like +this: + + gawk -M 'BEGIN { n = 13; print (n + 0.0) % 2.0 }' + + You can avoid this issue altogether by specifying the number as a +float to begin with: + + gawk -M 'BEGIN { n = 13.0; print n % 2.0 }' + + Note that for the particular example above, there is unlikely to be a +reason for simply not using the following: + + gawk -M 'BEGIN { n = 13; print n % 2 }' + + ---------- Footnotes ---------- + + (1) Weisstein, Eric W. `Sylvester's Sequence'. From MathWorld-A +Wolfram Web Resource. +`http://mathworld.wolfram.com/SylvestersSequence.html' + + +File: gawk.info, Node: MPFR and GMP Libraries, Prev: Arbitrary Precision Integers, Up: Arbitrary Precision Arithmetic + +11.13 Information About the MPFR and GMP Libraries +================================================== + +There are a few elements available in the `PROCINFO' array to provide +information about the MPFR and GMP libraries. *Note Auto-set::, for +more information. + + +File: gawk.info, Node: Advanced Features, Next: Library Functions, Prev: Arbitrary Precision Arithmetic, Up: Top -11 Advanced Features of `gawk' +12 Advanced Features of `gawk' ****************************** Write documentation as if whoever reads it is a violent psychopath @@ -13521,7 +14480,7 @@ and likely to change, its description is relegated to an appendix. File: gawk.info, Node: Nondecimal Data, Next: Array Sorting, Up: Advanced Features -11.1 Allowing Nondecimal Input Data +12.1 Allowing Nondecimal Input Data =================================== If you run `gawk' with the `--non-decimal-data' option, you can have @@ -13563,7 +14522,7 @@ request it. File: gawk.info, Node: Array Sorting, Next: Two-way I/O, Prev: Nondecimal Data, Up: Advanced Features -11.2 Controlling Array Traversal and Array Sorting +12.2 Controlling Array Traversal and Array Sorting ================================================== `gawk' lets you control the order in which a `for (i in array)' loop @@ -13582,7 +14541,7 @@ to order the elements during sorting. File: gawk.info, Node: Controlling Array Traversal, Next: Array Sorting Functions, Up: Array Sorting -11.2.1 Controlling Array Traversal +12.2.1 Controlling Array Traversal ---------------------------------- By default, the order in which a `for (i in array)' loop scans an array @@ -13813,7 +14772,7 @@ the default. File: gawk.info, Node: Array Sorting Functions, Prev: Controlling Array Traversal, Up: Array Sorting -11.2.2 Sorting Array Values and Indices with `gawk' +12.2.2 Sorting Array Values and Indices with `gawk' --------------------------------------------------- In most `awk' implementations, sorting an array requires writing a @@ -13908,7 +14867,7 @@ extensions, they are not available in that case. File: gawk.info, Node: Two-way I/O, Next: TCP/IP Networking, Prev: Array Sorting, Up: Advanced Features -11.3 Two-Way Communications with Another Process +12.3 Two-Way Communications with Another Process ================================================ From: brennan@whidbey.com (Mike Brennan) @@ -14043,7 +15002,7 @@ regular pipes. File: gawk.info, Node: TCP/IP Networking, Next: Profiling, Prev: Two-way I/O, Up: Advanced Features -11.4 Using `gawk' for Network Programming +12.4 Using `gawk' for Network Programming ========================================= `EMISTERED': @@ -14120,29 +15079,26 @@ examples. File: gawk.info, Node: Profiling, Prev: TCP/IP Networking, Up: Advanced Features -11.5 Profiling Your `awk' Programs +12.5 Profiling Your `awk' Programs ================================== You may produce execution traces of your `awk' programs. This is done -with a specially compiled version of `gawk', called `pgawk' ("profiling -`gawk'"). - - `pgawk' is identical in every way to `gawk', except that when it has -finished running, it creates a profile of your program in a file named -`awkprof.out'. Because it is profiling, it also executes up to 45% +by passing the option `--profile' to `gawk'. When `gawk' has finished +running, it creates a profile of your program in a file named +`awkprof.out'. Because it is profiling, it also executes up to 45% slower than `gawk' normally does. As shown in the following example, the `--profile' option can be -used to change the name of the file where `pgawk' will write the -profile: +used to change the name of the file where `gawk' will write the profile: - pgawk --profile=myprog.prof -f myprog.awk data1 data2 + gawk --profile=myprog.prof -f myprog.awk data1 data2 -In the above example, `pgawk' places the profile in `myprog.prof' +In the above example, `gawk' places the profile in `myprog.prof' instead of in `awkprof.out'. Here is a sample session showing a simple `awk' program, its input -data, and the results from running `pgawk'. First, the `awk' program: +data, and the results from running `gawk' with the `--profile' option. +First, the `awk' program: BEGIN { print "First BEGIN rule" } @@ -14178,9 +15134,9 @@ data, and the results from running `pgawk'. First, the `awk' program: foo junk - Here is the `awkprof.out' that results from running `pgawk' on this -program and data (this example also illustrates that `awk' programmers -sometimes have to work late): + 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): # gawk profile, created Sun Aug 13 00:00:15 2000 @@ -14269,14 +15225,14 @@ output. They are as follows: redirection. Similarly, if the target of a redirection isn't a scalar, it gets parenthesized. - * `pgawk' supplies leading comments in front of the `BEGIN' and - `END' rules, the pattern/action rules, and the functions. + * `gawk' supplies leading comments in front of the `BEGIN' and `END' + rules, the pattern/action rules, and the functions. The profiled version of your program may not look exactly like what -you typed when you wrote it. This is because `pgawk' creates the +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 `pgawk' can produce a +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: @@ -14291,21 +15247,23 @@ come out as: which is correct, but possibly surprising. - Besides creating profiles when a program has completed, `pgawk' can + Besides creating profiles when a program has completed, `gawk' can produce a profile while it is running. This is useful if your `awk' program goes into an infinite loop and you want to see what has been -executed. To use this feature, run `pgawk' in the background: +executed. To use this feature, run `gawk' with the `--profile' option +in the background: - $ pgawk -f myprog & + $ gawk --profile -f myprog & [1] 13992 The shell prints a job number and process ID number; in this case, -13992. Use the `kill' command to send the `USR1' signal to `pgawk': +13992. Use the `kill' command to send the `USR1' signal to `gawk': $ kill -USR1 13992 As usual, the profiled version of the program is written to -`awkprof.out', or to a different file if you use the `--profile' option. +`awkprof.out', or to a different file if one specified with the +`--profile' option. Along with the regular profile, as shown earlier, the profile includes a trace of any active functions: @@ -14317,29 +15275,29 @@ includes a trace of any active functions: # 1. foo # -- main -- - You may send `pgawk' the `USR1' signal as many times as you like. + You may send `gawk' the `USR1' signal as many times as you like. Each time, the profile and function call trace are appended to the output profile file. - If you use the `HUP' signal instead of the `USR1' signal, `pgawk' + If you use the `HUP' signal instead of the `USR1' signal, `gawk' produces the profile and the function call trace and then exits. - When `pgawk' runs on MS-Windows systems, it uses the `INT' and -`QUIT' signals for producing the profile and, in the case of the `INT' -signal, `pgawk' exits. This is because these systems don't support the -`kill' command, so the only signals you can deliver to a program are -those generated by the keyboard. The `INT' signal is generated by the + When `gawk' runs on MS-Windows systems, it uses the `INT' and `QUIT' +signals for producing the profile and, in the case of the `INT' signal, +`gawk' exits. This is because these systems don't support the `kill' +command, so the only signals you can deliver to a program are those +generated by the keyboard. The `INT' signal is generated by the `Ctrl-<C>' or `Ctrl-<BREAK>' key, while the `QUIT' signal is generated by the `Ctrl-<\>' key. - Finally, regular `gawk' also accepts the `--profile' option. When + Finally, `gawk' also accepts another option `--pretty-print'. When called this way, `gawk' "pretty prints" the program into `awkprof.out', without any execution counts. File: gawk.info, Node: Library Functions, Next: Sample Programs, Prev: Advanced Features, Up: Top -12 A Library of `awk' Functions +13 A Library of `awk' Functions ******************************* *note User-defined::, describes how to write your own `awk' functions. @@ -14411,7 +15369,7 @@ contents of the input record. File: gawk.info, Node: Library Names, Next: General Functions, Up: Library Functions -12.1 Naming Library Function Global Variables +13.1 Naming Library Function Global Variables ============================================= Due to the way the `awk' language evolved, variables are either @@ -14491,7 +15449,7 @@ verifying this. File: gawk.info, Node: General Functions, Next: Data File Management, Prev: Library Names, Up: Library Functions -12.2 General Programming +13.2 General Programming ======================== This minor node presents a number of functions that are of general @@ -14514,7 +15472,7 @@ programming use. File: gawk.info, Node: Strtonum Function, Next: Assert Function, Up: General Functions -12.2.1 Converting Strings To Numbers +13.2.1 Converting Strings To Numbers ------------------------------------ The `strtonum()' function (*note String Functions::) is a `gawk' @@ -14598,7 +15556,7 @@ be tested with `gawk' and the results compared to the built-in File: gawk.info, Node: Assert Function, Next: Round Function, Prev: Strtonum Function, Up: General Functions -12.2.2 Assertions +13.2.2 Assertions ----------------- When writing large programs, it is often useful to know that a @@ -14684,7 +15642,7 @@ rule always ends with an `exit' statement. File: gawk.info, Node: Round Function, Next: Cliff Random Function, Prev: Assert Function, Up: General Functions -12.2.3 Rounding Numbers +13.2.3 Rounding Numbers ----------------------- The way `printf' and `sprintf()' (*note Printf::) perform rounding @@ -14730,7 +15688,7 @@ might be useful if your `awk''s `printf' does unbiased rounding: File: gawk.info, Node: Cliff Random Function, Next: Ordinal Functions, Prev: Round Function, Up: General Functions -12.2.4 The Cliff Random Number Generator +13.2.4 The Cliff Random Number Generator ---------------------------------------- The Cliff random number generator @@ -14759,7 +15717,7 @@ might try using this function instead. File: gawk.info, Node: Ordinal Functions, Next: Join Function, Prev: Cliff Random Function, Up: General Functions -12.2.5 Translating Between Characters and Numbers +13.2.5 Translating Between Characters and Numbers ------------------------------------------------- One commercial implementation of `awk' supplies a built-in function, @@ -14857,7 +15815,7 @@ extensions, you can simplify `_ord_init' to loop from 0 to 255. File: gawk.info, Node: Join Function, Next: Gettimeofday Function, Prev: Ordinal Functions, Up: General Functions -12.2.6 Merging an Array into a String +13.2.6 Merging an Array into a String ------------------------------------- When doing string processing, it is often useful to be able to join all @@ -14904,7 +15862,7 @@ makes string operations more difficult than they really need to be. File: gawk.info, Node: Gettimeofday Function, Prev: Join Function, Up: General Functions -12.2.7 Managing the Time of Day +13.2.7 Managing the Time of Day ------------------------------- The `systime()' and `strftime()' functions described in *note Time @@ -14986,7 +15944,7 @@ optional timestamp value to use instead of the current time. File: gawk.info, Node: Data File Management, Next: Getopt Function, Prev: General Functions, Up: Library Functions -12.3 Data File Management +13.3 Data File Management ========================= This minor node presents functions that are useful for managing @@ -15003,7 +15961,7 @@ command-line data files. File: gawk.info, Node: Filetrans Function, Next: Rewind Function, Up: Data File Management -12.3.1 Noting Data File Boundaries +13.3.1 Noting Data File Boundaries ---------------------------------- The `BEGIN' and `END' rules are each executed exactly once at the @@ -15101,7 +16059,7 @@ it provides an easy way to do per-file cleanup processing. File: gawk.info, Node: Rewind Function, Next: File Checking, Prev: Filetrans Function, Up: Data File Management -12.3.2 Rereading the Current File +13.3.2 Rereading the Current File --------------------------------- Another request for a new built-in function was for a `rewind()' @@ -15143,7 +16101,7 @@ Nextfile Statement::). File: gawk.info, Node: File Checking, Next: Empty Files, Prev: Rewind Function, Up: Data File Management -12.3.3 Checking for Readable Data Files +13.3.3 Checking for Readable Data Files --------------------------------------- Normally, if you give `awk' a data file that isn't readable, it stops @@ -15172,7 +16130,7 @@ in the list). See also *note ARGC and ARGV::. File: gawk.info, Node: Empty Files, Next: Ignoring Assigns, Prev: File Checking, Up: Data File Management -12.3.4 Checking For Zero-length Files +13.3.4 Checking For Zero-length Files ------------------------------------- All known `awk' implementations silently skip over zero-length files. @@ -15229,7 +16187,7 @@ intervening value in `ARGV' is a variable assignment. File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Management -12.3.5 Treating Assignments as File Names +13.3.5 Treating Assignments as File Names ----------------------------------------- Occasionally, you might not want `awk' to process command-line variable @@ -15272,7 +16230,7 @@ arguments are left alone. File: gawk.info, Node: Getopt Function, Next: Passwd Functions, Prev: Data File Management, Up: Library Functions -12.4 Processing Command-Line Options +13.4 Processing Command-Line Options ==================================== Most utilities on POSIX compatible systems take options on the command @@ -15565,7 +16523,7 @@ have left it alone, since using `substr()' is more portable. File: gawk.info, Node: Passwd Functions, Next: Group Functions, Prev: Getopt Function, Up: Library Functions -12.5 Reading the User Database +13.5 Reading the User Database ============================== The `PROCINFO' array (*note Built-in Variables::) provides access to @@ -15808,7 +16766,7 @@ network database. File: gawk.info, Node: Group Functions, Next: Walking Arrays, Prev: Passwd Functions, Up: Library Functions -12.6 Reading the Group Database +13.6 Reading the Group Database =============================== Much of the discussion presented in *note Passwd Functions::, applies @@ -16042,7 +17000,7 @@ very simple, relying on `awk''s associative arrays to do work. File: gawk.info, Node: Walking Arrays, Prev: Group Functions, Up: Library Functions -12.7 Traversing Arrays of Arrays +13.7 Traversing Arrays of Arrays ================================ *note Arrays of Arrays::, described how `gawk' provides arrays of @@ -16093,7 +17051,7 @@ value. Here is a main program to demonstrate: File: gawk.info, Node: Sample Programs, Next: Debugger, Prev: Library Functions, Up: Top -13 Practical `awk' Programs +14 Practical `awk' Programs *************************** *note Library Functions::, presents the idea that reading programs in a @@ -16113,7 +17071,7 @@ Library Functions::. File: gawk.info, Node: Running Examples, Next: Clones, Up: Sample Programs -13.1 Running the Example Programs +14.1 Running the Example Programs ================================= To run a given program, you would typically do something like this: @@ -16136,7 +17094,7 @@ OPTIONS are any command-line options for the program that start with a File: gawk.info, Node: Clones, Next: Miscellaneous Programs, Prev: Running Examples, Up: Sample Programs -13.2 Reinventing Wheels for Fun and Profit +14.2 Reinventing Wheels for Fun and Profit ========================================== This minor node presents a number of POSIX utilities implemented in @@ -16166,7 +17124,7 @@ programming for "real world" tasks. File: gawk.info, Node: Cut Program, Next: Egrep Program, Up: Clones -13.2.1 Cutting out Fields and Columns +14.2.1 Cutting out Fields and Columns ------------------------------------- The `cut' utility selects, or "cuts," characters or fields from its @@ -16425,7 +17383,7 @@ solution to the problem of picking the input line apart by characters. File: gawk.info, Node: Egrep Program, Next: Id Program, Prev: Cut Program, Up: Clones -13.2.2 Searching for Regular Expressions in Files +14.2.2 Searching for Regular Expressions in Files ------------------------------------------------- The `egrep' utility searches files for patterns. It uses regular @@ -16657,7 +17615,7 @@ the translated line, not the original. File: gawk.info, Node: Id Program, Next: Split Program, Prev: Egrep Program, Up: Clones -13.2.3 Printing out User Information +14.2.3 Printing out User Information ------------------------------------ The `id' utility lists a user's real and effective user ID numbers, @@ -16764,7 +17722,7 @@ body never executes. File: gawk.info, Node: Split Program, Next: Tee Program, Prev: Id Program, Up: Clones -13.2.4 Splitting a Large File into Pieces +14.2.4 Splitting a Large File into Pieces ----------------------------------------- The `split' program splits large text files into smaller pieces. Usage @@ -16872,7 +17830,7 @@ not relevant for what the program aims to demonstrate. File: gawk.info, Node: Tee Program, Next: Uniq Program, Prev: Split Program, Up: Clones -13.2.5 Duplicating Output into Multiple Files +14.2.5 Duplicating Output into Multiple Files --------------------------------------------- The `tee' program is known as a "pipe fitting." `tee' copies its @@ -16960,7 +17918,7 @@ N input records and M output files, the first method only executes N File: gawk.info, Node: Uniq Program, Next: Wc Program, Prev: Tee Program, Up: Clones -13.2.6 Printing Nonduplicated Lines of Text +14.2.6 Printing Nonduplicated Lines of Text ------------------------------------------- The `uniq' utility reads sorted lines of data on its standard input, @@ -17179,7 +18137,7 @@ line of input data: File: gawk.info, Node: Wc Program, Prev: Uniq Program, Up: Clones -13.2.7 Counting Things +14.2.7 Counting Things ---------------------- The `wc' (word count) utility counts lines, words, and characters in @@ -17324,7 +18282,7 @@ characters, not bytes. File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs -13.3 A Grab Bag of `awk' Programs +14.3 A Grab Bag of `awk' Programs ================================= This minor node is a large "grab bag" of miscellaneous programs. We @@ -17351,7 +18309,7 @@ hope you find them both interesting and enjoyable. File: gawk.info, Node: Dupword Program, Next: Alarm Program, Up: Miscellaneous Programs -13.3.1 Finding Duplicated Words in a Document +14.3.1 Finding Duplicated Words in a Document --------------------------------------------- A common error when writing large amounts of prose is to accidentally @@ -17399,7 +18357,7 @@ word, comparing it to the previous one: File: gawk.info, Node: Alarm Program, Next: Translate Program, Prev: Dupword Program, Up: Miscellaneous Programs -13.3.2 An Alarm Clock Program +14.3.2 An Alarm Clock Program ----------------------------- Nothing cures insomnia like a ringing alarm clock. @@ -17532,7 +18490,7 @@ necessary: File: gawk.info, Node: Translate Program, Next: Labels Program, Prev: Alarm Program, Up: Miscellaneous Programs -13.3.3 Transliterating Characters +14.3.3 Transliterating Characters --------------------------------- The system `tr' utility transliterates characters. For example, it is @@ -17658,7 +18616,7 @@ split each character in a string into separate array elements. File: gawk.info, Node: Labels Program, Next: Word Sorting, Prev: Translate Program, Up: Miscellaneous Programs -13.3.4 Printing Mailing Labels +14.3.4 Printing Mailing Labels ------------------------------ Here is a "real world"(1) program. This script reads lists of names and @@ -17765,7 +18723,7 @@ something done." File: gawk.info, Node: Word Sorting, Next: History Sorting, Prev: Labels Program, Up: Miscellaneous Programs -13.3.5 Generating Word-Usage Counts +14.3.5 Generating Word-Usage Counts ----------------------------------- When working with large amounts of text, it can be interesting to know @@ -17869,7 +18827,7 @@ operating system documentation for more information on how to use the File: gawk.info, Node: History Sorting, Next: Extract Program, Prev: Word Sorting, Up: Miscellaneous Programs -13.3.6 Removing Duplicates from Unsorted Text +14.3.6 Removing Duplicates from Unsorted Text --------------------------------------------- The `uniq' program (*note Uniq Program::), removes duplicate lines from @@ -17916,7 +18874,7 @@ seen. File: gawk.info, Node: Extract Program, Next: Simple Sed, Prev: History Sorting, Up: Miscellaneous Programs -13.3.7 Extracting Programs from Texinfo Source Files +14.3.7 Extracting Programs from Texinfo Source Files ---------------------------------------------------- The nodes *note Library Functions::, and *note Sample Programs::, are @@ -18116,7 +19074,7 @@ function. Consider how you might use it to simplify the code. File: gawk.info, Node: Simple Sed, Next: Igawk Program, Prev: Extract Program, Up: Miscellaneous Programs -13.3.8 A Simple Stream Editor +14.3.8 A Simple Stream Editor ----------------------------- The `sed' utility is a stream editor, a program that reads a stream of @@ -18197,7 +19155,7 @@ the single rule handles the printing scheme outlined above, using File: gawk.info, Node: Igawk Program, Next: Anagram Program, Prev: Simple Sed, Up: Miscellaneous Programs -13.3.9 An Easy Way to Use Library Functions +14.3.9 An Easy Way to Use Library Functions ------------------------------------------- In *note Include Files::, we saw how `gawk' provides a built-in @@ -18594,7 +19552,7 @@ can loop forever if the file exists but is empty. Caveat emptor. File: gawk.info, Node: Anagram Program, Next: Signature Program, Prev: Igawk Program, Up: Miscellaneous Programs -13.3.10 Finding Anagrams From A Dictionary +14.3.10 Finding Anagrams From A Dictionary ------------------------------------------ An interesting programming challenge is to search for "anagrams" in a @@ -18684,7 +19642,7 @@ otherwise the anagrams would appear in arbitrary order: File: gawk.info, Node: Signature Program, Prev: Anagram Program, Up: Miscellaneous Programs -13.3.11 And Now For Something Completely Different +14.3.11 And Now For Something Completely Different -------------------------------------------------- The following program was written by Davide Brini and is published on @@ -18711,45 +19669,46 @@ supplies the following copyright terms: File: gawk.info, Node: Debugger, Next: Language History, Prev: Sample Programs, Up: Top -14 `dgawk': The `awk' Debugger -****************************** +15 Debugging `awk' Programs +*************************** It would be nice if computer programs worked perfectly the first time they were run, but in real life, this rarely happens for programs of any complexity. Thus, most programming languages have facilities available for "debugging" programs, and now `awk' is no exception. - The `dgawk' debugger is purposely modeled after the GNU Debugger + The `gawk' debugger is purposely modeled after the GNU Debugger (GDB) (http://www.gnu.org/software/gdb/) command-line debugger. If you -are familiar with GDB, learning `dgawk' is easy. +are familiar with GDB, learning how to use `gawk' for debugging your +program is easy. * Menu: -* Debugging:: Introduction to `dgawk'. -* Sample dgawk session:: Sample `dgawk' session. -* List of Debugger Commands:: Main `dgawk' Commands. -* Readline Support:: Readline Support. -* Dgawk Limitations:: Limitations and future plans. +* Debugging:: Introduction to `gawk' debugger. +* Sample Debugging Session:: Sample debugging session. +* List of Debugger Commands:: Main debugger commands. +* Readline Support:: Readline support. +* Limitations:: Limitations and future plans. -File: gawk.info, Node: Debugging, Next: Sample dgawk session, Up: Debugger +File: gawk.info, Node: Debugging, Next: Sample Debugging Session, Up: Debugger -14.1 Introduction to `dgawk' -============================ +15.1 Introduction to `gawk' Debugger +==================================== This minor node introduces debugging in general and begins the discussion of debugging in `gawk'. * Menu: -* Debugging Concepts:: Debugging In General. +* Debugging Concepts:: Debugging in General. * Debugging Terms:: Additional Debugging Concepts. * Awk Debugging:: Awk Debugging. File: gawk.info, Node: Debugging Concepts, Next: Debugging Terms, Up: Debugging -14.1.1 Debugging In General +15.1.1 Debugging in General --------------------------- (If you have used debuggers in other languages, you may want to skip @@ -18789,13 +19748,12 @@ functional program that you or someone else wrote). File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging Concepts, Up: Debugging -14.1.2 Additional Debugging Concepts +15.1.2 Additional Debugging Concepts ------------------------------------ Before diving in to the details, we need to introduce several important -concepts that apply to just about all debuggers, including `dgawk'. -The following list defines terms used throughout the rest of this -major node. +concepts that apply to just about all debuggers. The following list +defines terms used throughout the rest of this major node. "Stack Frame" Programs generally call functions during the course of their @@ -18813,11 +19771,11 @@ major node. needed to manage the call stack. This data area is termed a "stack frame". - `gawk' also follows this model, and `dgawk' gives you access to - the call stack and to each stack frame. You can see the call - stack, as well as from where each function on the stack was - invoked. Commands that print the call stack print information about - each stack frame (as detailed later on). + `gawk' also follows this model, and gives you access to the call + stack and to each stack frame. You can see the call stack, as well + as from where each function on the stack was invoked. Commands + that print the call stack print information about each stack frame + (as detailed later on). "Breakpoint" During debugging, you often wish to let the program run until it @@ -18842,7 +19800,7 @@ major node. File: gawk.info, Node: Awk Debugging, Prev: Debugging Terms, Up: Debugging -14.1.3 Awk Debugging +15.1.3 Awk Debugging -------------------- Debugging an `awk' program has some specific aspects that are not @@ -18862,54 +19820,57 @@ individual primitive instructions carried out by the higher-level `awk' commands. -File: gawk.info, Node: Sample dgawk session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger +File: gawk.info, Node: Sample Debugging Session, Next: List of Debugger Commands, Prev: Debugging, Up: Debugger -14.2 Sample `dgawk' session -=========================== +15.2 Sample Debugging Session +============================= -In order to illustrate the use of `dgawk', let's look at a sample -debugging session. We will use the `awk' implementation of the POSIX -`uniq' command described earlier (*note Uniq Program::) as our example. +In order to illustrate the use of `gawk' as a debugger, let's look at a +sample debugging session. We will use the `awk' implementation of the +POSIX `uniq' command described earlier (*note Uniq Program::) as our +example. * Menu: -* dgawk invocation:: `dgawk' Invocation. -* Finding The Bug:: Finding The Bug. +* Debugger Invocation:: How to Start the Debugger. +* Finding The Bug:: Finding the Bug. -File: gawk.info, Node: dgawk invocation, Next: Finding The Bug, Up: Sample dgawk session +File: gawk.info, Node: Debugger Invocation, Next: Finding The Bug, Up: Sample Debugging Session -14.2.1 `dgawk' Invocation -------------------------- +15.2.1 How to Start the Debugger +-------------------------------- -Starting `dgawk' is exactly like running `awk'. The file(s) containing -the program and any supporting code are given on the command line as -arguments to one or more `-f' options. (`dgawk' is not designed to -debug command-line programs, only programs contained in files.) In our -case, we call `dgawk' like this: +Starting the debugger is almost exactly like running `awk', except you +have to pass an additional option `--debug' or the corresponding short +option `-D'. The file(s) containing the program and any supporting +code are given on the command line as arguments to one or more `-f' +options. (`gawk' is not designed to debug command-line programs, only +programs contained in files.) In our case, we invoke the debugger like +this: - $ dgawk -f getopt.awk -f join.awk -f uniq.awk inputfile + $ gawk -D -f getopt.awk -f join.awk -f uniq.awk inputfile where both `getopt.awk' and `uniq.awk' are in `$AWKPATH'. (Experienced users of GDB or similar debuggers should note that this syntax is -slightly different from what they are used to. With `dgawk', the -arguments for running the program are given in the command line to the -debugger rather than as part of the `run' command at the debugger +slightly different from what they are used to. With `gawk' debugger, +the arguments for running the program are given in the command line to +the debugger rather than as part of the `run' command at the debugger prompt.) Instead of immediately running the program on `inputfile', as `gawk' -would ordinarily do, `dgawk' merely loads all the program source files, -compiles them internally, and then gives us a prompt: +would ordinarily do, the debugger merely loads all the program source +files, compiles them internally, and then gives us a prompt: - dgawk> + gawk> from which we can issue commands to the debugger. At this point, no code has been executed. -File: gawk.info, Node: Finding The Bug, Prev: dgawk invocation, Up: Sample dgawk session +File: gawk.info, Node: Finding The Bug, Prev: Debugger Invocation, Up: Sample Debugging Session -14.2.2 Finding The Bug +15.2.2 Finding the Bug ---------------------- Let's say that we are having a problem using (a faulty version of) @@ -18939,27 +19900,27 @@ for a breakpoint in `uniq.awk' is at the beginning of the function `are_equal()', which compares the current line with the previous one. To set the breakpoint, use the `b' (breakpoint) command: - dgawk> b are_equal + gawk> b are_equal -| Breakpoint 1 set at file `awklib/eg/prog/uniq.awk', line 64 The debugger tells us the file and line number where the breakpoint is. Now type `r' or `run' and the program runs until it hits the breakpoint for the first time: - dgawk> r + gawk> r -| Starting program: -| Stopping in Rule ... -| Breakpoint 1, are_equal(n, m, clast, cline, alast, aline) at `awklib/eg/prog/uniq.awk':64 -| 64 if (fcount == 0 && charcount == 0) - dgawk> + gawk> Now we can look at what's going on inside our program. First of all, let's see how we got to where we are. At the prompt, we type `bt' -(short for "backtrace"), and `dgawk' responds with a listing of the -current stack frames: +(short for "backtrace"), and the debugger responds with a listing of +the current stack frames: - dgawk> bt + gawk> bt -| #0 are_equal(n, m, clast, cline, alast, aline) at `awklib/eg/prog/uniq.awk':69 -| #1 in main() at `awklib/eg/prog/uniq.awk':89 @@ -18973,9 +19934,9 @@ the key to finding the source of the problem.) Now that we're in `are_equal()', we can start looking at the values of some variables. Let's say we type `p n' (`p' is short for "print"). We would expect to see the value of `n', a parameter to `are_equal()'. -Actually, `dgawk' gives us: +Actually, the debugger gives us: - dgawk> p n + gawk> p n -| n = untyped variable In this case, `n' is an uninitialized local variable, since the @@ -18983,13 +19944,13 @@ function was called without arguments (*note Function Calls::). A more useful variable to display might be the current record: - dgawk> p $0 + gawk> p $0 -| $0 = string ("gawk is a wonderful program!") This might be a bit puzzling at first since this is the second line of our test input above. Let's look at `NR': - dgawk> p NR + gawk> p NR -| NR = number (2) So we can see that `are_equal()' was only called for the second record @@ -19003,7 +19964,7 @@ for `NR == 1': OK, let's just check that that rule worked correctly: - dgawk> p last + gawk> p last -| last = string ("awk is a wonderful program!") Everything we have done so far has verified that the program has @@ -19012,7 +19973,7 @@ the problem must be inside this function. To investigate further, we must begin "stepping through" the lines of `are_equal()'. We start by typing `n' (for "next"): - dgawk> n + gawk> n -| 67 if (fcount > 0) { This tells us that `gawk' is now ready to execute line 67, which @@ -19028,15 +19989,15 @@ was false.) Continuing to step, we now get to the splitting of the current and last records: - dgawk> n + gawk> n -| 68 n = split(last, alast) - dgawk> n + gawk> n -| 69 m = split($0, aline) At this point, we should be curious to see what our records were split into, so we try to look: - dgawk> p n m alast aline + gawk> p n m alast aline -| n = number (5) -| m = number (5) -| alast = array, 5 elements @@ -19052,19 +20013,19 @@ want to see inside the array? The first choice would be to use subscripts: - dgawk> p alast[0] + gawk> p alast[0] -| "0" not in array `alast' Oops! - dgawk> p alast[1] + gawk> p alast[1] -| alast["1"] = string ("awk") - This would be kind of slow for a 100-member array, though, so -`dgawk' provides a shortcut (reminiscent of another language not to be + This would be kind of slow for a 100-member array, though, so `gawk' +provides a shortcut (reminiscent of another language not to be mentioned): - dgawk> p @alast + gawk> p @alast -| alast["1"] = string ("awk") -| alast["2"] = string ("is") -| alast["3"] = string ("a") @@ -19073,9 +20034,9 @@ mentioned): It looks like we got this far OK. Let's take another step or two: - dgawk> n + gawk> n -| 70 clast = join(alast, fcount, n) - dgawk> n + gawk> n -| 71 cline = join(aline, fcount, m) Well, here we are at our error (sorry to spoil the suspense). What @@ -19083,7 +20044,7 @@ we had in mind was to join the fields starting from the second one to make the virtual record to compare, and if the first field was numbered zero, this would work. Let's look at what we've got: - dgawk> p cline clast + gawk> p cline clast -| cline = string ("gawk is a wonderful program!") -| clast = string ("awk is a wonderful program!") @@ -19091,9 +20052,9 @@ zero, this would work. Let's look at what we've got: unaltered, input records. A little thinking (the human brain is still the best debugging tool), and we realize that we were off by one! - We get out of `dgawk': + We get out of the debugger: - dgawk> q + gawk> q -| The program is running. Exit anyway (y/n)? y Then we get into an editor: @@ -19104,12 +20065,13 @@ Then we get into an editor: and problem solved! -File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample dgawk session, Up: Debugger +File: gawk.info, Node: List of Debugger Commands, Next: Readline Support, Prev: Sample Debugging Session, Up: Debugger -14.3 Main `dgawk' Commands -========================== +15.3 Main Debugger Commands +=========================== -The `dgawk' command set can be divided into the following categories: +The `gawk' debugger command set can be divided into the following +categories: * Breakpoint control @@ -19125,26 +20087,26 @@ The `dgawk' command set can be divided into the following categories: Each of these are discussed in the following subsections. In the following descriptions, commands which may be abbreviated show the -abbreviation on a second description line. A `dgawk' command name may -also be truncated if that partial name is unambiguous. `dgawk' has the -built-in capability to automatically repeat the previous command when -just hitting <Enter>. This works for the commands `list', `next', +abbreviation on a second description line. A debugger command name may +also be truncated if that partial name is unambiguous. The debugger has +the built-in capability to automatically repeat the previous command +when just hitting <Enter>. This works for the commands `list', `next', `nexti', `step', `stepi' and `continue' executed without any argument. * Menu: -* Breakpoint Control:: Control of breakpoints. -* Dgawk Execution Control:: Control of execution. -* Viewing And Changing Data:: Viewing and changing data. -* Dgawk Stack:: Dealing with the stack. -* Dgawk Info:: Obtaining information about the program and - the debugger state. -* Miscellaneous Dgawk Commands:: Miscellaneous Commands. +* Breakpoint Control:: Control of Breakpoints. +* Debugger Execution Control:: Control of Execution. +* Viewing And Changing Data:: Viewing and Changing Data. +* Execution Stack:: Dealing with the Stack. +* Debugger Info:: Obtaining Information about the Program and + the Debugger State. +* Miscellaneous Debugger Commands:: Miscellaneous Commands. -File: gawk.info, Node: Breakpoint Control, Next: Dgawk Execution Control, Up: List of Debugger Commands +File: gawk.info, Node: Breakpoint Control, Next: Debugger Execution Control, Up: List of Debugger Commands -14.3.1 Control Of Breakpoints +15.3.1 Control of Breakpoints ----------------------------- As we saw above, the first thing you probably want to do in a debugging @@ -19172,10 +20134,10 @@ controlling breakpoints are: it from the breakpoint list using the `delete' command. With a breakpoint, you may also supply a condition. This is an - `awk' expression (enclosed in double quotes) that `dgawk' + `awk' expression (enclosed in double quotes) that the debugger evaluates whenever the breakpoint is reached. If the condition is - true, then `dgawk' stops execution and prompts for a command. - Otherwise, `dgawk' continues executing the program. + true, then the debugger stops execution and prompts for a command. + Otherwise, it continues executing the program. `clear' [[FILENAME`:']N | FUNCTION] Without any argument, delete any breakpoint at the next instruction @@ -19197,12 +20159,13 @@ controlling breakpoints are: `condition' N `"EXPRESSION"' Add a condition to existing breakpoint or watchpoint N. The - condition is an `awk' expression that `dgawk' evaluates whenever - the breakpoint or watchpoint is reached. If the condition is true, - then `dgawk' stops execution and prompts for a command. Otherwise, - `dgawk' continues executing the program. If the condition - expression is not specified, any existing condition is removed; - i.e., the breakpoint or watchpoint is made unconditional. + condition is an `awk' expression that the debugger evaluates + whenever the breakpoint or watchpoint is reached. If the condition + is true, then the debugger stops execution and prompts for a + command. Otherwise, the debugger continues executing the program. + If the condition expression is not specified, any existing + condition is removed; i.e., the breakpoint or watchpoint is made + unconditional. `delete' [N1 N2 ...] [N-M] `d' [N1 N2 ...] [N-M] @@ -19236,9 +20199,9 @@ controlling breakpoints are: arguments are the same as for `break'. -File: gawk.info, Node: Dgawk Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands +File: gawk.info, Node: Debugger Execution Control, Next: Viewing And Changing Data, Prev: Breakpoint Control, Up: List of Debugger Commands -14.3.2 Control of Execution +15.3.2 Control of Execution --------------------------- Now that your breakpoints are ready, you can start running the program @@ -19259,14 +20222,14 @@ execution of the program than we saw in our earlier example: `continue') terminates the list (an implicit `end'), and subsequent commands are ignored. For example: - dgawk> commands + gawk> commands > silent > printf "A silent breakpoint; i = %d\n", i > info locals > set i = 10 > continue > end - dgawk> + gawk> `continue' [COUNT] `c' [COUNT] @@ -19299,9 +20262,9 @@ execution of the program than we saw in our earlier example: `run' `r' - Start/restart execution of the program. When restarting, `dgawk' - retains the current breakpoints, watchpoints, command history, - automatic display variables, and debugger options. + Start/restart execution of the program. When restarting, the + debugger retains the current breakpoints, watchpoints, command + history, automatic display variables, and debugger options. `step' [COUNT] `s' [COUNT] @@ -19316,7 +20279,7 @@ execution of the program than we saw in our earlier example: Execute one (or COUNT) instruction(s), stepping inside function calls. (For illustration of what is meant by an "instruction" in `gawk', see the output shown under `dump' in *note Miscellaneous - Dgawk Commands::.) + Debugger Commands::.) `until' [[FILENAME`:']N | FUNCTION] `u' [[FILENAME`:']N | FUNCTION] @@ -19326,9 +20289,9 @@ execution of the program than we saw in our earlier example: current stack frame returns. -File: gawk.info, Node: Viewing And Changing Data, Next: Dgawk Stack, Prev: Dgawk Execution Control, Up: List of Debugger Commands +File: gawk.info, Node: Viewing And Changing Data, Next: Execution Stack, Prev: Debugger Execution Control, Up: List of Debugger Commands -14.3.3 Viewing and Changing Data +15.3.3 Viewing and Changing Data -------------------------------- The commands for viewing and changing variables inside of `gawk' are: @@ -19338,7 +20301,7 @@ The commands for viewing and changing variables inside of `gawk' are: of the variable or field is displayed each time the program stops. Each variable added to the list is identified by a unique number: - dgawk> display x + gawk> display x -| 10: x = 1 displays the assigned item number, the variable name and its @@ -19366,7 +20329,7 @@ AWK STATEMENTS Print the value of a `gawk' variable or field. Fields must be referenced by constants: - dgawk> print $3 + gawk> print $3 This prints the third field in the input record (if the specified field does not exist, it prints `Null field'). A variable can be @@ -19394,16 +20357,16 @@ AWK STATEMENTS `watch' VAR | `$'N [`"EXPRESSION"'] `w' VAR | `$'N [`"EXPRESSION"'] - Add variable VAR (or field `$N') to the watch list. `dgawk' then - stops whenever the value of the variable or field changes. Each - watched item is assigned a number which can be used to delete it - from the watch list using the `unwatch' command. + Add variable VAR (or field `$N') to the watch list. The debugger + then stops whenever the value of the variable or field changes. + Each watched item is assigned a number which can be used to delete + it from the watch list using the `unwatch' command. With a watchpoint, you may also supply a condition. This is an - `awk' expression (enclosed in double quotes) that `dgawk' + `awk' expression (enclosed in double quotes) that the debugger evaluates whenever the watchpoint is reached. If the condition is - true, then `dgawk' stops execution and prompts for a command. - Otherwise, `dgawk' continues executing the program. + true, then the debugger stops execution and prompts for a command. + Otherwise, `gawk' continues executing the program. `undisplay' [N] Remove item number N (or all items, if no argument) from the @@ -19415,9 +20378,9 @@ AWK STATEMENTS -File: gawk.info, Node: Dgawk Stack, Next: Dgawk Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands +File: gawk.info, Node: Execution Stack, Next: Debugger Info, Prev: Viewing And Changing Data, Up: List of Debugger Commands -14.3.4 Dealing With The Stack +15.3.4 Dealing with the Stack ----------------------------- Whenever you run a program which contains any function calls, `gawk' @@ -19452,16 +20415,17 @@ are: frame. Then select and print the frame. -File: gawk.info, Node: Dgawk Info, Next: Miscellaneous Dgawk Commands, Prev: Dgawk Stack, Up: List of Debugger Commands +File: gawk.info, Node: Debugger Info, Next: Miscellaneous Debugger Commands, Prev: Execution Stack, Up: List of Debugger Commands -14.3.5 Obtaining Information About The Program and The Debugger State +15.3.5 Obtaining Information about the Program and the Debugger State --------------------------------------------------------------------- Besides looking at the values of variables, there is often a need to get other sorts of information about the state of your program and of the -debugging environment itself. `dgawk' has one command which provides -this information, appropriately called `info'. `info' is used with one -of a number of arguments that tell it exactly what you want to know: +debugging environment itself. The `gawk' debugger has one command which +provides this information, appropriately called `info'. `info' is used +with one of a number of arguments that tell it exactly what you want to +know: `info' WHAT `i' WHAT @@ -19489,10 +20453,10 @@ of a number of arguments that tell it exactly what you want to know: `source' The name of the current source file. Each time the program stops, the current source file is the file containing the - current instruction. When `dgawk' first starts, the current - source file is the first file included via the `-f' option. - The `list FILENAME:LINENO' command can be used at any time to - change the current source. + current instruction. When the debugger first starts, the + current source file is the first file included via the `-f' + option. The `list FILENAME:LINENO' command can be used at any + time to change the current source. `sources' List all program sources. @@ -19516,7 +20480,7 @@ from a file. The commands are: `history_size' The maximum number of lines to keep in the history file - `./.dgawk_history'. The default is 100. + `./.gawk_history'. The default is 100. `listsize' The number of lines that `list' prints. The default is 15. @@ -19527,14 +20491,14 @@ from a file. The commands are: standard output. `prompt' - The debugger prompt. The default is `dgawk> '. + The debugger prompt. The default is `gawk> '. `save_history [on | off]' - Save command history to file `./.dgawk_history'. The default + Save command history to file `./.gawk_history'. The default is `on'. `save_options [on | off]' - Save current options to file `./.dgawkrc' upon exit. The + Save current options to file `./.gawkrc' upon exit. The default is `on'. Options are read back in to the next session upon startup. @@ -19552,17 +20516,17 @@ from a file. The commands are: ignored; they do _not_ repeat the last command. You can't restart the program by having more than one `run' command in the file. Also, the list of commands may include additional `source' - commands; however, `dgawk' will not source the same file more than - once in order to avoid infinite recursion. + commands; however, the `gawk' debugger will not source the same + file more than once in order to avoid infinite recursion. In addition to, or instead of the `source' command, you can use - the `-R FILE' or `--command=FILE' command-line options to execute + the `-D FILE' or `--debug=FILE' command-line options to execute commands from a file non-interactively (*note Options::. -File: gawk.info, Node: Miscellaneous Dgawk Commands, Prev: Dgawk Info, Up: List of Debugger Commands +File: gawk.info, Node: Miscellaneous Debugger Commands, Prev: Debugger Info, Up: List of Debugger Commands -14.3.6 Miscellaneous Commands +15.3.6 Miscellaneous Commands ----------------------------- There are a few more commands which do not fit into the previous @@ -19576,7 +20540,7 @@ categories, as follows: partial dump of Davide Brini's obfuscated code (*note Signature Program::) demonstrates: - dgawk> dump + gawk> dump -| # BEGIN -| -| [ 2:0x89faef4] Op_rule : [in_rule = BEGIN] [source_file = brini.awk] @@ -19625,13 +20589,13 @@ categories, as follows: -| [ :0x89fa3b0] Op_after_beginfile : -| [ :0x89fa388] Op_no_op : -| [ :0x89fa3c4] Op_after_endfile : - dgawk> + gawk> `help' `h' - Print a list of all of the `dgawk' commands with a short summary - of their usage. `help COMMAND' prints the information about the - command COMMAND. + Print a list of all of the `gawk' debugger commands with a short + summary of their usage. `help COMMAND' prints the information + about the command COMMAND. `list' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION] `l' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION] @@ -19665,7 +20629,7 @@ categories, as follows: Exit the debugger. Debugging is great fun, but sometimes we all have to tend to other obligations in life, and sometimes we find the bug, and are free to go on to the next one! As we saw above, - if you are running a program, `dgawk' warns you if you + if you are running a program, the debugger warns you if you accidentally type `q' or `quit', to make sure you really want to quit. @@ -19680,12 +20644,12 @@ categories, as follows: -File: gawk.info, Node: Readline Support, Next: Dgawk Limitations, Prev: List of Debugger Commands, Up: Debugger +File: gawk.info, Node: Readline Support, Next: Limitations, Prev: List of Debugger Commands, Up: Debugger -14.4 Readline Support +15.4 Readline Support ===================== -If `dgawk' is compiled with the `readline' library, you can take +If `gawk' is compiled with the `readline' library, you can take advantage of that library's command completion and history expansion features. The following types of completion are available: @@ -19707,27 +20671,27 @@ Variable name completion -File: gawk.info, Node: Dgawk Limitations, Prev: Readline Support, Up: Debugger +File: gawk.info, Node: Limitations, Prev: Readline Support, Up: Debugger -14.5 Limitations and Future Plans +15.5 Limitations and Future Plans ================================= -We hope you find `dgawk' useful and enjoyable to work with, but as with -any program, especially in its early releases, it still has some -limitations. A few which are worth being aware of are: +We hope you find the `gawk' debugger useful and enjoyable to work with, +but as with any program, especially in its early releases, it still has +some limitations. A few which are worth being aware of are: - * At this point, `dgawk' does not give a detailed explanation of + * At this point, the debugger does not give a detailed explanation of what you did wrong when you type in something it doesn't like. Rather, it just responds `syntax error'. When you do figure out what your mistake was, though, you'll feel like a real guru. - * If you perused the dump of opcodes in *note Miscellaneous Dgawk + * If you perused the dump of opcodes in *note Miscellaneous Debugger Commands::, (or if you are already familiar with `gawk' internals), you will realize that much of the internal manipulation of data in `gawk', as in many interpreters, is done on a stack. `Op_push', `Op_pop', etc., are the "bread and butter" of most `gawk' code. - Unfortunately, as of now, `dgawk' does not allow you to examine - the stack's contents. + Unfortunately, as of now, the `gawk' debugger does not allow you + to examine the stack's contents. That is, the intermediate results of expression evaluation are on the stack, but cannot be printed. Rather, only variables which @@ -19740,13 +20704,15 @@ limitations. A few which are worth being aware of are: expressions to see if you got it right. As an `awk' programmer, you are expected to know what `/[^[:alnum:][:blank:]]/' means. - * `dgawk' is designed to be used by running a program (with all its - parameters) on the command line, as described in *note dgawk - invocation::. There is no way (as of now) to attach or "break in" - to a running program. This seems reasonable for a language which - is used mainly for quickly executing, short programs. + * The `gawk' debugger is designed to be used by running a program + (with all its parameters) on the command line, as described in + *note Debugger Invocation::. There is no way (as of now) to + attach or "break in" to a running program. This seems reasonable + for a language which is used mainly for quickly executing, short + programs. - * `dgawk' only accepts source supplied with the `-f' option. + * The `gawk' debugger only accepts source supplied with the `-f' + option. Look forward to a future release when these and other missing features may be added, and of course feel free to try to add them @@ -20059,6 +21025,9 @@ the current version of `gawk'. - The `AWKPATH' environment variable for specifying a path search for the `-f' command-line option (*note Options::). + - The `AWKLIBPATH' environment variable for specifying a path + search for the `-l' command-line option (*note Options::). + - The ability to use GNU-style long-named options that start with `--' and the `--characters-as-bytes', `--compat', `--dump-variables', `--exec', `--gen-pot', `--lint', @@ -20322,7 +21291,7 @@ Info file, in approximate chronological order: Windows32 environments. (This is no longer supported) * John Haque reworked the `gawk' internals to use a byte-code engine, - providing the `dgawk' debugger for `awk' programs. + providing the `gawk' debugger for `awk' programs. * Efraim Yawitz contributed the original text for *note Debugger::. @@ -21339,9 +22308,10 @@ Unix `awk' `pawk' Nelson H.F. Beebe at the University of Utah has modified Brian Kernighan's `awk' to provide timing and profiling information. It - is different from `pgawk' (*note Profiling::), in that it uses - CPU-based profiling, not line-count profiling. You may find it at - either `ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz' or + is different from `gawk' with the `--profile' option. (*note + Profiling::), in that it uses CPU-based profiling, not line-count + profiling. You may find it at either + `ftp://ftp.math.utah.edu/pub/pawk/pawk-20030606.tar.gz' or `http://www.math.utah.edu/pub/pawk/pawk-20030606.tar.gz'. Busybox Awk @@ -21738,6 +22708,7 @@ is necessary when reading this minor node. * Internals:: A brief look at some `gawk' internals. * Plugin License:: A note about licensing. +* Loading Extensions:: How to load dynamic extensions. * Sample Library:: A example of new functions. @@ -21782,16 +22753,9 @@ when writing extensions. The next minor node shows how they are used: is current. It may end up calling an internal `gawk' function. It also guarantees that the wide string is zero-terminated. -`size_t get_curfunc_arg_count(void)' - This function returns the actual number of parameters passed to - the current function. Inside the code of an extension this can be - used to determine the maximum index which is safe to use with - `get_actual_argument'. If this value is greater than `nargs', the - function was called incorrectly from the `awk' program. - `nargs' - Inside an extension function, this is the maximum number of - expected parameters, as set by the `make_builtin()' function. + Inside an extension function, this is the actual number of + parameters passed to the current function. `n->stptr' `n->stlen' @@ -21819,12 +22783,10 @@ when writing extensions. The next minor node shows how they are used: Clears the associative array pointed to by `n'. Make sure that `n->type == Node_var_array' first. -`NODE **assoc_lookup(NODE *symbol, NODE *subs, int reference)' +`NODE **assoc_lookup(NODE *symbol, NODE *subs)' Finds, and installs if necessary, array elements. `symbol' is the array, `subs' is the subscript. This is usually a value created - with `make_string()' (see below). `reference' should be `TRUE' if - it is an error to use the value before it is created. Typically, - `FALSE' is the correct value to use from extension functions. + with `make_string()' (see below). `NODE *make_string(char *s, size_t len)' Take a C string and turn it into a pointer to a `NODE' that can be @@ -21879,16 +22841,22 @@ when writing extensions. The next minor node shows how they are used: `get_array_argument(i, opt)' This is a convenience macro that calls `get_actual_argument()'. -`void update_ERRNO(void)' - This function is called from within a C extension function to set - the value of `gawk''s `ERRNO' variable, based on the current value - of the C `errno' global variable. It is provided as a convenience. - -`void update_ERRNO_saved(int errno_saved)' +`void update_ERRNO_int(int errno_saved)' This function is called from within a C extension function to set the value of `gawk''s `ERRNO' variable, based on the error value provided as the argument. It is provided as a convenience. +`void update_ERRNO_string(const char *string, enum errno_translate)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable to a given string. The + second argument determines whether the string is translated before + being installed into `ERRNO'. It is provided as a convenience. + +`void unset_ERRNO(void)' + This function is called from within a C extension function to set + the value of `gawk''s `ERRNO' variable to a null string. It is + provided as a convenience. + `void register_deferred_variable(const char *name, NODE *(*load_func)(void))' This function is called to register a function to be called when a reference to an undefined variable with the given name is @@ -21946,7 +22914,7 @@ function parameter. just blindly copy this code. -File: gawk.info, Node: Plugin License, Next: Sample Library, Prev: Internals, Up: Dynamic Extensions +File: gawk.info, Node: Plugin License, Next: Loading Extensions, Prev: Internals, Up: Dynamic Extensions C.3.2 Extension Licensing ------------------------- @@ -21963,9 +22931,54 @@ the symbol exists in the global scope. Something like this is enough: int plugin_is_GPL_compatible; -File: gawk.info, Node: Sample Library, Prev: Plugin License, Up: Dynamic Extensions +File: gawk.info, Node: Loading Extensions, Next: Sample Library, Prev: Plugin License, Up: Dynamic Extensions + +C.3.3 Loading a Dynamic Extension +--------------------------------- + +There are two ways to load a dynamically linked library. The first is +to use the builtin `extension()': + + extension(libname, init_func) + + where `libname' is the library to load, and `init_func' is the name +of the initialization or bootstrap routine to run once loaded. + + The second method for dynamic loading of a library is to use the +command line option `-l': + + $ gawk -l libname -f myprog + + This will work only if the initialization routine is named +`dlload()'. + + If you use `extension()', the library will be loaded at run time. +This means that the functions are available only to the rest of your +script. If you use the command line option `-l' instead, the library +will be loaded before `gawk' starts compiling the actual program. The +net effect is that you can use those functions anywhere in the program. + + `gawk' has a list of directories where it searches for libraries. +By default, the list includes directories that depend upon how gawk was +built and installed (*note AWKLIBPATH Variable::). If you want `gawk' +to look for libraries in your private directory, you have to tell it. +The way to do it is to set the `AWKLIBPATH' environment variable (*note +AWKLIBPATH Variable::). `gawk' supplies the default shared library +platform suffix if it is not present in the name of the library. If +the name of your library is `mylib.so', you can simply type + + $ gawk -l mylib -f myprog + + and `gawk' will do everything necessary to load in your library, and +then call your `dlload()' routine. + + You can always specify the library using an absolute pathname, in +which case `gawk' will not use `AWKLIBPATH' to search for it. + + +File: gawk.info, Node: Sample Library, Prev: Loading Extensions, Up: Dynamic Extensions -C.3.3 Example: Directory and File Operation Built-ins +C.3.4 Example: Directory and File Operation Built-ins ----------------------------------------------------- Two useful functions that are not in `awk' are `chdir()' (so that an @@ -21982,7 +22995,7 @@ implements these functions for `gawk' in an external extension library. File: gawk.info, Node: Internal File Description, Next: Internal File Ops, Up: Sample Library -C.3.3.1 Using `chdir()' and `stat()' +C.3.4.1 Using `chdir()' and `stat()' .................................... This minor node shows how to use the new functions at the `awk' level @@ -22105,7 +23118,7 @@ Elements::): File: gawk.info, Node: Internal File Ops, Next: Using Internal File Ops, Prev: Internal File Description, Up: Sample Library -C.3.3.2 C Code for `chdir()' and `stat()' +C.3.4.2 C Code for `chdir()' and `stat()' ......................................... Here is the C code for these extensions. They were written for @@ -22126,7 +23139,7 @@ other POSIX-compliant systems:(1) NODE *newdir; int ret = -1; - if (do_lint && get_curfunc_arg_count() != 1) + if (do_lint && nargs != 1) lintwarn("chdir: called with incorrect number of arguments"); newdir = get_scalar_argument(0, FALSE); @@ -22149,7 +23162,7 @@ system call. If the `chdir()' fails, `ERRNO' is updated. (void) force_string(newdir); ret = chdir(newdir->stptr); if (ret < 0) - update_ERRNO(); + update_ERRNO_int(errno); Finally, the function returns the return value to the `awk' level: @@ -22183,7 +23196,7 @@ declarations and argument checking: char *pmode; /* printable mode */ char *type = "unknown"; - if (do_lint && get_curfunc_arg_count() > 2) + if (do_lint && nargs > 2) lintwarn("stat: called with too many arguments"); Then comes the actual work. First, the function gets the arguments. @@ -22202,7 +23215,7 @@ link. If there's an error, it sets `ERRNO' and returns: (void) force_string(file); ret = lstat(file->stptr, & sbuf); if (ret < 0) { - update_ERRNO(); + update_ERRNO_int(errno); return make_number((AWKNUM) ret); } @@ -22210,15 +23223,15 @@ link. If there's an error, it sets `ERRNO' and returns: calls are shown here, since they all follow the same pattern: /* fill in the array */ - aptr = assoc_lookup(array, tmp = make_string("name", 4), FALSE); + aptr = assoc_lookup(array, tmp = make_string("name", 4)); *aptr = dupnode(file); unref(tmp); - aptr = assoc_lookup(array, tmp = make_string("mode", 4), FALSE); + aptr = assoc_lookup(array, tmp = make_string("mode", 4)); *aptr = make_number((AWKNUM) sbuf.st_mode); unref(tmp); - aptr = assoc_lookup(array, tmp = make_string("pmode", 5), FALSE); + aptr = assoc_lookup(array, tmp = make_string("pmode", 5)); pmode = format_mode(sbuf.st_mode); *aptr = make_string(pmode, strlen(pmode)); unref(tmp); @@ -22255,7 +23268,7 @@ version. File: gawk.info, Node: Using Internal File Ops, Prev: Internal File Ops, Up: Sample Library -C.3.3.3 Integrating the Extensions +C.3.4.3 Integrating the Extensions .................................. Now that the code is written, it must be possible to add it at runtime @@ -24693,8 +25706,8 @@ 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): Regexp Operators. (line 79) -* () (parentheses), pgawk program: Profiling. (line 141) * * (asterisk), * operator, as multiplication operator: Precedence. (line 55) * * (asterisk), * operator, as regexp operator: Regexp Operators. @@ -24724,73 +25737,78 @@ Index * - (hyphen), filenames beginning with: Options. (line 59) * - (hyphen), in bracket expressions: Bracket Expressions. (line 17) * --assign option: Options. (line 32) +* --bignum option: Options. (line 187) * --c option: Options. (line 81) * --characters-as-bytes option: Options. (line 68) -* --command option: Options. (line 234) * --copyright option: Options. (line 88) +* --debug option: Options. (line 108) * --disable-lint configuration option: Additional Configuration Options. (line 9) * --disable-nls configuration option: Additional Configuration Options. (line 24) * --dump-variables option <1>: Library Names. (line 45) * --dump-variables option: Options. (line 93) -* --exec option: Options. (line 116) +* --exec option: Options. (line 125) * --field-separator option: Options. (line 21) * --file option: Options. (line 25) * --gen-pot option <1>: String Extraction. (line 6) -* --gen-pot option: Options. (line 138) -* --help option: Options. (line 145) -* --L option: Options. (line 248) -* --lint option <1>: Options. (line 150) +* --gen-pot option: Options. (line 147) +* --help option: Options. (line 154) +* --L option: Options. (line 274) +* --lint option <1>: Options. (line 168) * --lint option: Command Line. (line 20) -* --lint-old option: Options. (line 248) +* --lint-old option: Options. (line 274) +* --load option: Options. (line 159) * --non-decimal-data option <1>: Nondecimal Data. (line 6) -* --non-decimal-data option: Options. (line 169) +* --non-decimal-data option: Options. (line 193) * --non-decimal-data option, strtonum() function and: Nondecimal Data. (line 36) -* --optimize option: Options. (line 182) -* --posix option: Options. (line 202) -* --posix option, --traditional option and: Options. (line 221) -* --profile option <1>: Profiling. (line 15) -* --profile option: Options. (line 189) -* --re-interval option: Options. (line 227) -* --sandbox option: Options. (line 239) +* --optimize option: Options. (line 214) +* --posix option: Options. (line 233) +* --posix option, --traditional option and: Options. (line 252) +* --pretty-print option: Options. (line 206) +* --profile option <1>: Profiling. (line 12) +* --profile option: Options. (line 221) +* --re-interval option: Options. (line 258) +* --sandbox option: Options. (line 265) * --sandbox option, disabling system() function: I/O Functions. (line 85) * --sandbox option, input redirection with getline: Getline. (line 19) * --sandbox option, output redirection with print, printf: Redirection. (line 6) -* --source option: Options. (line 108) +* --source option: Options. (line 117) * --traditional option: Options. (line 81) -* --traditional option, --posix option and: Options. (line 221) -* --use-lc-numeric option: Options. (line 177) -* --version option: Options. (line 253) +* --traditional option, --posix option and: Options. (line 252) +* --use-lc-numeric option: Options. (line 201) +* --version option: Options. (line 279) * --with-whiny-user-strftime configuration option: Additional Configuration Options. (line 29) * -b option: Options. (line 68) * -C option: Options. (line 88) +* -D option: Options. (line 108) * -d option: Options. (line 93) -* -E option: Options. (line 116) -* -e option: Options. (line 108) +* -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 261) -* -f option, on command line: Options. (line 266) -* -g option: Options. (line 138) -* -h option: Options. (line 145) -* -l option: Options. (line 150) -* -N option: Options. (line 177) -* -n option: Options. (line 169) -* -O option: Options. (line 182) -* -P option: Options. (line 202) -* -p option: Options. (line 189) -* -R option: Options. (line 234) -* -r option: Options. (line 227) -* -S option: Options. (line 239) -* -V option: Options. (line 253) +* -F option, -Ft sets FS to TAB: Options. (line 287) +* -f option, on command line: Options. (line 292) +* -g option: Options. (line 147) +* -h option: Options. (line 154) +* -l option: Options. (line 159) +* -M option: Options. (line 187) +* -N option: Options. (line 201) +* -n option: Options. (line 193) +* -O option: Options. (line 214) +* -o option: Options. (line 206) +* -P option: Options. (line 233) +* -p option: Options. (line 221) +* -r option: Options. (line 258) +* -S option: Options. (line 265) +* -V option: Options. (line 279) * -v option: Options. (line 32) * -v option, variables, assigning: Assignment Options. (line 12) * -W option: Options. (line 46) @@ -24930,7 +25948,7 @@ Index (line 67) * advanced features, data files as single record: Records. (line 175) * advanced features, fixed-width data: Constant Size. (line 9) -* advanced features, FNR/NR variables: Auto-set. (line 207) +* advanced features, FNR/NR variables: Auto-set. (line 225) * advanced features, gawk: Advanced Features. (line 6) * advanced features, gawk, network programming: TCP/IP Networking. (line 6) @@ -24965,6 +25983,8 @@ Index * and Boolean-logic operator: Boolean Ops. (line 6) * and() function (gawk): Bitwise Functions. (line 39) * ANSI: Glossary. (line 35) +* arbitrary precision: Arbitrary Precision Arithmetic. + (line 6) * archeologists: Bugs. (line 6) * ARGC/ARGV variables <1>: ARGC and ARGV. (line 6) * ARGC/ARGV variables: Auto-set. (line 11) @@ -24979,18 +25999,18 @@ Index * arguments, command-line, invoking awk: Command Line. (line 6) * arguments, in function calls: Function Calls. (line 16) * arguments, processing: Getopt Function. (line 6) -* arguments, retrieving: Internals. (line 120) +* arguments, retrieving: Internals. (line 111) * arithmetic operators: Arithmetic Ops. (line 6) * arrays: Arrays. (line 6) * arrays, as parameters to functions: Pass By Value/Reference. (line 47) * arrays, associative: Array Intro. (line 50) -* arrays, associative, clearing: Internals. (line 75) +* arrays, associative, clearing: Internals. (line 68) * 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, deleting: Delete. (line 6) -* arrays, elements, installing: Internals. (line 79) +* arrays, elements, installing: Internals. (line 72) * arrays, elements, order of: Scanning an Array. (line 48) * arrays, elements, referencing: Reference to Elements. (line 6) @@ -25029,8 +26049,8 @@ Index * assignment operators, evaluation order: Assignment Ops. (line 111) * assignment operators, lvalues/rvalues: Assignment Ops. (line 32) * assignments as filenames: Ignoring Assigns. (line 6) -* assoc_clear() internal function: Internals. (line 75) -* assoc_lookup() internal function: Internals. (line 79) +* assoc_clear() internal function: Internals. (line 68) +* assoc_lookup() internal function: Internals. (line 72) * associative arrays: Array Intro. (line 50) * asterisk (*), * operator, as multiplication operator: Precedence. (line 55) @@ -25046,7 +26066,10 @@ Index * asterisk (*), *= operator: Assignment Ops. (line 129) * atan2() function: Numeric Functions. (line 11) * awf (amazingly workable formatter) program: Glossary. (line 25) +* awk debugging, enabling: Options. (line 108) +* awk enabling: Options. (line 206) * awk language, POSIX version: Assignment Ops. (line 136) +* awk profiling, enabling: Options. (line 221) * awk programs <1>: Two Rules. (line 6) * awk programs <2>: Executable Scripts. (line 6) * awk programs: Getting Started. (line 12) @@ -25062,7 +26085,6 @@ Index * awk programs, location of: Options. (line 25) * awk programs, one-line examples: Very Simple. (line 45) * awk programs, profiling: Profiling. (line 6) -* awk programs, profiling, enabling: Options. (line 189) * awk programs, running <1>: Long. (line 6) * awk programs, running: Running gawk. (line 6) * awk programs, running, from shell scripts: One-shot. (line 22) @@ -25099,10 +26121,11 @@ Index * awk, versions of, See Also Brian Kernighan's awk: BTL. (line 6) * awk.h file (internal): Internals. (line 15) * awka compiler for awk: Other Versions. (line 55) +* AWKLIBPATH environment variable: AWKLIBPATH Variable. (line 6) * AWKNUM internal type: Internals. (line 19) * AWKPATH environment variable <1>: PC Using. (line 11) * AWKPATH environment variable: AWKPATH Variable. (line 6) -* awkprof.out file: Profiling. (line 10) +* awkprof.out file: Profiling. (line 6) * awksed.awk program: Simple Sed. (line 25) * awkvars.out file: Options. (line 93) * b debugger command (alias for break): Breakpoint Control. (line 11) @@ -25156,12 +26179,13 @@ Index * backslash (\), in escape sequences, POSIX and: Escape Sequences. (line 113) * backslash (\), regexp constants: Computed Regexps. (line 28) -* backtrace debugger command: Dgawk Stack. (line 13) +* backtrace debugger command: Execution Stack. (line 13) * BBS-list file: Sample Data Files. (line 6) * Beebe, Nelson <1>: Other Versions. (line 69) * Beebe, Nelson: Acknowledgments. (line 60) -* BEGIN pattern <1>: BEGIN/END. (line 6) -* BEGIN pattern <2>: Field Separators. (line 44) +* BEGIN pattern <1>: Profiling. (line 62) +* BEGIN pattern <2>: BEGIN/END. (line 6) +* BEGIN pattern <3>: Field Separators. (line 44) * BEGIN pattern: Records. (line 29) * BEGIN pattern, assert() user-defined function and: Assert Function. (line 83) @@ -25176,7 +26200,6 @@ Index * BEGIN pattern, OFS/ORS variables, assigning values to: Output Separators. (line 20) * BEGIN pattern, operators and: Using BEGIN/END. (line 17) -* BEGIN pattern, pgawk program: Profiling. (line 65) * BEGIN pattern, print statement and: I/O And BEGIN/END. (line 16) * BEGIN pattern, pwcat program: Passwd Functions. (line 143) * BEGIN pattern, running awk programs and: Cut Program. (line 68) @@ -25205,8 +26228,8 @@ 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 ({}), actions and: Action Overview. (line 19) -* braces ({}), pgawk program: Profiling. (line 137) * braces ({}), statements, grouping: Statements. (line 10) * bracket expressions <1>: Bracket Expressions. (line 6) * bracket expressions: Regexp Operators. (line 55) @@ -25233,7 +26256,7 @@ Index * Broder, Alan J.: Contributors. (line 88) * Brown, Martin: Contributors. (line 82) * BSD-based operating systems: Glossary. (line 611) -* bt debugger command (alias for backtrace): Dgawk Stack. (line 13) +* bt debugger command (alias for backtrace): Execution Stack. (line 13) * Buening, Andreas <1>: Bugs. (line 71) * Buening, Andreas <2>: Contributors. (line 92) * Buening, Andreas: Acknowledgments. (line 60) @@ -25251,7 +26274,7 @@ Index * built-in variables, -v option, setting with: Options. (line 40) * built-in variables, conveying information: Auto-set. (line 6) * built-in variables, user-modifiable: User-modified. (line 6) -* Busybox Awk: Other Versions. (line 78) +* Busybox Awk: Other Versions. (line 79) * call by reference: Pass By Value/Reference. (line 47) * call by value: Pass By Value/Reference. @@ -25271,7 +26294,7 @@ Index * 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 116) +* CGI, awk scripts for: Options. (line 125) * character lists, See bracket expressions: Regexp Operators. (line 55) * character sets (machine character encodings) <1>: Glossary. (line 141) * character sets (machine character encodings): Ordinal Functions. @@ -25301,7 +26324,7 @@ Index * close() function, two-way pipes and: Two-way I/O. (line 77) * Close, Diane <1>: Contributors. (line 21) * Close, Diane: Manual History. (line 41) -* close_func() input method: Internals. (line 160) +* close_func() input method: Internals. (line 157) * collating elements: Bracket Expressions. (line 69) * collating symbols: Bracket Expressions. (line 76) * Colombo, Antonio: Acknowledgments. (line 60) @@ -25325,7 +26348,7 @@ Index * 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: Dgawk Execution Control. +* commands debugger command: Debugger Execution Control. (line 10) * commenting: Comments. (line 6) * commenting, backslash continuation and: Statements/Lines. (line 76) @@ -25378,8 +26401,12 @@ Index (line 29) * configuration options, gawk: Additional Configuration Options. (line 6) +* constants, floating-point: Floating-point Constants. + (line 6) * constants, nondecimal: Nondecimal Data. (line 6) * constants, types of: Constants. (line 6) +* context, floating-point: Floating-point Context. + (line 6) * continue statement: Continue Statement. (line 6) * control statements: Statements. (line 6) * converting, case: String Functions. (line 522) @@ -25402,7 +26429,7 @@ Index * cos() function: Numeric Functions. (line 15) * counting: Wc Program. (line 6) * csh utility: Statements/Lines. (line 44) -* csh utility, POSIXLY_CORRECT environment variable: Options. (line 308) +* csh utility, POSIXLY_CORRECT environment variable: Options. (line 334) * 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) @@ -25410,7 +26437,7 @@ Index (line 30) * cut utility: Cut Program. (line 6) * cut.awk program: Cut Program. (line 45) -* d debugger command (alias for delete): Breakpoint Control. (line 63) +* d debugger command (alias for delete): Breakpoint Control. (line 64) * d.c., See dark corner: Conventions. (line 38) * dark corner <1>: Glossary. (line 193) * dark corner <2>: Truth Values. (line 24) @@ -25432,9 +26459,9 @@ Index * dark corner, exit statement: Exit Statement. (line 30) * dark corner, field separators: Field Splitting Summary. (line 47) -* dark corner, FILENAME variable <1>: Auto-set. (line 92) +* dark corner, FILENAME variable <1>: Auto-set. (line 93) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 207) +* dark corner, FNR/NR variables: Auto-set. (line 225) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -25474,119 +26501,121 @@ Index (line 33) * deadlocks: Two-way I/O. (line 70) * debugger commands, b (break): Breakpoint Control. (line 11) -* debugger commands, backtrace: Dgawk Stack. (line 13) +* debugger commands, backtrace: Execution Stack. (line 13) * debugger commands, break: Breakpoint Control. (line 11) -* debugger commands, bt (backtrace): Dgawk Stack. (line 13) -* debugger commands, c (continue): Dgawk Execution Control. +* debugger commands, bt (backtrace): Execution Stack. (line 13) +* debugger commands, c (continue): Debugger Execution Control. (line 33) * debugger commands, clear: Breakpoint Control. (line 36) -* debugger commands, commands: Dgawk Execution Control. +* debugger commands, commands: Debugger Execution Control. (line 10) * debugger commands, condition: Breakpoint Control. (line 54) -* debugger commands, continue: Dgawk Execution Control. +* debugger commands, continue: Debugger Execution Control. (line 33) -* debugger commands, d (delete): Breakpoint Control. (line 63) -* debugger commands, delete: Breakpoint Control. (line 63) -* debugger commands, disable: Breakpoint Control. (line 68) +* debugger commands, d (delete): Breakpoint Control. (line 64) +* debugger commands, delete: Breakpoint Control. (line 64) +* debugger commands, disable: Breakpoint Control. (line 69) * debugger commands, display: Viewing And Changing Data. (line 8) -* debugger commands, down: Dgawk Stack. (line 21) -* debugger commands, dump: Miscellaneous Dgawk Commands. +* debugger commands, down: Execution Stack. (line 21) +* debugger commands, dump: Miscellaneous Debugger Commands. (line 9) -* debugger commands, e (enable): Breakpoint Control. (line 72) -* debugger commands, enable: Breakpoint Control. (line 72) -* debugger commands, end: Dgawk Execution Control. +* debugger commands, e (enable): Breakpoint Control. (line 73) +* debugger commands, enable: Breakpoint Control. (line 73) +* debugger commands, end: Debugger Execution Control. (line 10) * debugger commands, eval: Viewing And Changing Data. (line 23) -* debugger commands, f (frame): Dgawk Stack. (line 25) -* debugger commands, finish: Dgawk Execution Control. +* debugger commands, f (frame): Execution Stack. (line 25) +* debugger commands, finish: Debugger Execution Control. (line 39) -* debugger commands, frame: Dgawk Stack. (line 25) -* debugger commands, h (help): Miscellaneous Dgawk Commands. +* debugger commands, frame: Execution Stack. (line 25) +* debugger commands, h (help): Miscellaneous Debugger Commands. (line 68) -* debugger commands, help: Miscellaneous Dgawk Commands. +* debugger commands, help: Miscellaneous Debugger Commands. (line 68) -* debugger commands, i (info): Dgawk Info. (line 12) -* debugger commands, ignore: Breakpoint Control. (line 86) -* debugger commands, info: Dgawk Info. (line 12) -* debugger commands, l (list): Miscellaneous Dgawk Commands. +* debugger commands, i (info): Debugger Info. (line 13) +* debugger commands, ignore: Breakpoint Control. (line 87) +* debugger commands, info: Debugger Info. (line 13) +* debugger commands, l (list): Miscellaneous Debugger Commands. (line 74) -* debugger commands, list: Miscellaneous Dgawk Commands. +* debugger commands, list: Miscellaneous Debugger Commands. (line 74) -* debugger commands, n (next): Dgawk Execution Control. +* debugger commands, n (next): Debugger Execution Control. (line 43) -* debugger commands, next: Dgawk Execution Control. +* debugger commands, next: Debugger Execution Control. (line 43) -* debugger commands, nexti: Dgawk Execution Control. +* debugger commands, nexti: Debugger Execution Control. (line 49) -* debugger commands, ni (nexti): Dgawk Execution Control. +* debugger commands, ni (nexti): Debugger Execution Control. (line 49) -* debugger commands, o (option): Dgawk Info. (line 56) -* debugger commands, option: Dgawk Info. (line 56) +* debugger commands, o (option): Debugger Info. (line 57) +* debugger commands, option: Debugger Info. (line 57) * debugger commands, p (print): Viewing And Changing Data. (line 36) * debugger commands, print: Viewing And Changing Data. (line 36) * debugger commands, printf: Viewing And Changing Data. (line 54) -* debugger commands, q (quit): Miscellaneous Dgawk Commands. +* debugger commands, q (quit): Miscellaneous Debugger Commands. (line 101) -* debugger commands, quit: Miscellaneous Dgawk Commands. +* debugger commands, quit: Miscellaneous Debugger Commands. (line 101) -* debugger commands, r (run): Dgawk Execution Control. +* debugger commands, r (run): Debugger Execution Control. (line 62) -* debugger commands, return: Dgawk Execution Control. +* debugger commands, return: Debugger Execution Control. (line 54) -* debugger commands, run: Dgawk Execution Control. +* debugger commands, run: Debugger Execution Control. (line 62) -* debugger commands, s (step): Dgawk Execution Control. +* debugger commands, s (step): Debugger Execution Control. (line 68) * debugger commands, set: Viewing And Changing Data. (line 59) -* debugger commands, si (stepi): Dgawk Execution Control. +* debugger commands, si (stepi): Debugger Execution Control. (line 76) -* debugger commands, silent: Dgawk Execution Control. +* debugger commands, silent: Debugger Execution Control. (line 10) -* debugger commands, step: Dgawk Execution Control. +* debugger commands, step: Debugger Execution Control. (line 68) -* debugger commands, stepi: Dgawk Execution Control. +* debugger commands, stepi: Debugger Execution Control. (line 76) -* debugger commands, t (tbreak): Breakpoint Control. (line 89) -* debugger commands, tbreak: Breakpoint Control. (line 89) -* debugger commands, trace: Miscellaneous Dgawk Commands. +* debugger commands, t (tbreak): Breakpoint Control. (line 90) +* debugger commands, tbreak: Breakpoint Control. (line 90) +* debugger commands, trace: Miscellaneous Debugger Commands. (line 110) -* debugger commands, u (until): Dgawk Execution Control. +* debugger commands, u (until): Debugger Execution Control. (line 83) * debugger commands, undisplay: Viewing And Changing Data. (line 80) -* debugger commands, until: Dgawk Execution Control. +* debugger commands, until: Debugger Execution Control. (line 83) * debugger commands, unwatch: Viewing And Changing Data. (line 84) -* debugger commands, up: Dgawk Stack. (line 33) +* debugger commands, up: Execution Stack. (line 33) * debugger commands, w (watch): Viewing And Changing Data. (line 67) * debugger commands, watch: Viewing And Changing Data. (line 67) +* debugging awk programs: Debugger. (line 6) * debugging gawk, bug reports: Bugs. (line 9) -* decimal point character, locale specific: Options. (line 218) +* decimal point character, locale specific: Options. (line 249) * decrement operators: Increment Ops. (line 35) * default keyword: Switch Statement. (line 6) * Deifik, Scott <1>: Bugs. (line 70) * Deifik, Scott <2>: Contributors. (line 54) * Deifik, Scott: Acknowledgments. (line 60) -* delete debugger command: Breakpoint Control. (line 63) +* delete debugger command: Breakpoint Control. (line 64) * delete statement: Delete. (line 6) * deleting elements in arrays: Delete. (line 6) * deleting entire arrays: Delete. (line 39) -* dgawk: Debugger. (line 6) * differences between gawk and awk: String Functions. (line 196) * differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV. (line 88) * differences in awk and gawk, ARGIND variable: Auto-set. (line 40) * differences in awk and gawk, array elements, deleting: Delete. (line 39) +* differences in awk and gawk, AWKLIBPATH environment variable: AWKLIBPATH Variable. + (line 6) * differences in awk and gawk, AWKPATH environment variable: AWKPATH Variable. (line 6) * differences in awk and gawk, BEGIN/END patterns: I/O And BEGIN/END. @@ -25597,7 +26626,7 @@ Index (line 23) * differences in awk and gawk, close() function: Close Files And Pipes. (line 81) -* differences in awk and gawk, ERRNO variable: Auto-set. (line 72) +* differences in awk and gawk, ERRNO variable: Auto-set. (line 73) * differences in awk and gawk, error messages: Special FD. (line 16) * differences in awk and gawk, FIELDWIDTHS variable: User-modified. (line 35) @@ -25626,14 +26655,14 @@ Index (line 6) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 123) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 124) * differences in awk and gawk, record separators: Records. (line 112) * differences in awk and gawk, regexp constants: Using Constant Regexps. (line 43) * differences in awk and gawk, regular expressions: Case-sensitivity. (line 26) * differences in awk and gawk, RS/RT variables: Records. (line 167) -* differences in awk and gawk, RT variable: Auto-set. (line 196) +* differences in awk and gawk, RT variable: Auto-set. (line 214) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -25643,15 +26672,16 @@ Index * differences in awk and gawk, strtonum() function (gawk): String Functions. (line 404) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. - (line 153) + (line 162) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. (line 66) * directories, changing: Sample Library. (line 6) * 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) -* disable debugger command: Breakpoint Control. (line 68) +* disable debugger command: Breakpoint Control. (line 69) * display debugger command: Viewing And Changing Data. (line 8) * division: Arithmetic Ops. (line 44) @@ -25669,14 +26699,14 @@ Index * double quote (") <1>: Quoting. (line 37) * double quote ("): Read Terminal. (line 25) * double quote ("), regexp constants: Computed Regexps. (line 28) -* down debugger command: Dgawk Stack. (line 21) +* down debugger command: Execution Stack. (line 21) * Drepper, Ulrich: Acknowledgments. (line 52) * DuBois, John: Acknowledgments. (line 60) -* dump debugger command: Miscellaneous Dgawk Commands. +* dump debugger command: Miscellaneous Debugger Commands. (line 9) -* dupnode() internal function: Internals. (line 96) +* dupnode() internal function: Internals. (line 87) * dupword.awk program: Dupword Program. (line 31) -* e debugger command (alias for enable): Breakpoint Control. (line 72) +* e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 24) @@ -25692,9 +26722,10 @@ Index * empty pattern: Empty. (line 6) * empty strings, See null strings: Regexp Field Splitting. (line 43) -* enable debugger command: Breakpoint Control. (line 72) -* end debugger command: Dgawk Execution Control. +* enable debugger command: Breakpoint Control. (line 73) +* end debugger command: Debugger Execution Control. (line 10) +* END pattern <1>: Profiling. (line 62) * END pattern: BEGIN/END. (line 6) * END pattern, assert() user-defined function and: Assert Function. (line 75) @@ -25706,7 +26737,6 @@ Index * END pattern, next/nextfile statements and: I/O And BEGIN/END. (line 37) * END pattern, operators and: Using BEGIN/END. (line 17) -* END pattern, pgawk program: Profiling. (line 65) * END pattern, print statement and: I/O And BEGIN/END. (line 16) * ENDFILE pattern: BEGINFILE/ENDFILE. (line 6) * ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 73) @@ -25715,7 +26745,7 @@ Index * endgrent() user-defined function: Group Functions. (line 218) * endpwent() function (C library): Passwd Functions. (line 210) * endpwent() user-defined function: Passwd Functions. (line 213) -* ENVIRON array <1>: Internals. (line 149) +* ENVIRON array <1>: Internals. (line 146) * ENVIRON array: Auto-set. (line 60) * environment variables: Auto-set. (line 60) * epoch, definition of: Glossary. (line 239) @@ -25724,15 +26754,15 @@ Index * equals sign (=), == operator: Comparison Operators. (line 11) * EREs (Extended Regular Expressions): Bracket Expressions. (line 24) -* ERRNO variable <1>: Internals. (line 139) +* ERRNO variable <1>: Internals. (line 130) * ERRNO variable <2>: TCP/IP Networking. (line 54) -* ERRNO variable <3>: Auto-set. (line 72) +* ERRNO variable <3>: Auto-set. (line 73) * ERRNO variable <4>: BEGINFILE/ENDFILE. (line 26) * ERRNO variable <5>: Close Files And Pipes. (line 139) * ERRNO variable: Getline. (line 19) * error handling: Special FD. (line 16) -* error handling, ERRNO variable and: Auto-set. (line 72) +* 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) @@ -25773,7 +26803,7 @@ Index (line 9) * expressions, selecting: Conditional Exp. (line 6) * Extended Regular Expressions (EREs): Bracket Expressions. (line 24) -* eXtensible Markup Language (XML): Internals. (line 160) +* eXtensible Markup Language (XML): Internals. (line 157) * extension() function (gawk): Using Internal File Ops. (line 15) * extensions, Brian Kernighan's awk <1>: Other Versions. (line 13) @@ -25798,7 +26828,7 @@ Index * extract.awk program: Extract Program. (line 78) * extraction, of marked strings (internationalization): String Extraction. (line 6) -* f debugger command (alias for frame): Dgawk Stack. (line 25) +* f debugger command (alias for frame): Execution Stack. (line 25) * false, logical: Truth Values. (line 6) * FDL (Free Documentation License): GNU Free Documentation License. (line 6) @@ -25847,7 +26877,7 @@ Index * file names, distinguishing: Auto-set. (line 52) * file names, in compatibility mode: Special Caveats. (line 9) * file names, standard streams in gawk: Special FD. (line 46) -* FILENAME variable <1>: Auto-set. (line 92) +* FILENAME variable <1>: Auto-set. (line 93) * FILENAME variable: Reading Files. (line 6) * FILENAME variable, getline, setting with: Getline Notes. (line 19) * filenames, assignments as: Ignoring Assigns. (line 6) @@ -25865,7 +26895,7 @@ Index * files, /inet6/... (gawk): TCP/IP Networking. (line 6) * files, as single records: Records. (line 196) * files, awk programs in: Long. (line 6) -* files, awkprof.out: Profiling. (line 10) +* files, awkprof.out: Profiling. (line 6) * files, awkvars.out: Options. (line 93) * files, closing: I/O Functions. (line 10) * files, descriptors, See file descriptors: Special FD. (line 6) @@ -25894,7 +26924,7 @@ Index * files, portable object template: Explaining gettext. (line 30) * files, portable object, converting to message object files: I18N Example. (line 62) -* files, portable object, generating: Options. (line 138) +* files, portable object, generating: Options. (line 147) * files, processing, ARGIND variable and: Auto-set. (line 47) * files, reading: Rewind Function. (line 6) * files, reading, multiline records: Multiple Line. (line 6) @@ -25903,18 +26933,20 @@ 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) -* finish debugger command: Dgawk Execution Control. +* finish debugger command: Debugger Execution Control. (line 39) * Fish, Fred: Contributors. (line 51) * fixed-width data: Constant Size. (line 9) * flag variables <1>: Tee Program. (line 20) * flag variables: Boolean Ops. (line 67) +* floating-point numbers, arbitrary precision: Arbitrary Precision Arithmetic. + (line 6) * floating-point, numbers <1>: Unexpected Results. (line 6) * floating-point, numbers: Basic Data Typing. (line 21) * floating-point, numbers, AWKNUM internal type: Internals. (line 19) -* FNR variable <1>: Auto-set. (line 102) +* FNR variable <1>: Auto-set. (line 103) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 207) +* FNR variable, changing: Auto-set. (line 225) * for statement: For Statement. (line 6) * for statement, in arrays: Scanning an Array. (line 20) * force_number() internal function: Internals. (line 27) @@ -25938,7 +26970,7 @@ Index * FPAT variable <1>: User-modified. (line 45) * FPAT variable: Splitting By Content. (line 26) -* frame debugger command: Dgawk Stack. (line 25) +* frame debugger command: Execution Stack. (line 25) * Free Documentation License (FDL): GNU Free Documentation License. (line 6) * Free Software Foundation (FSF) <1>: Glossary. (line 301) @@ -25950,7 +26982,7 @@ Index * FS variable, --field-separator option and: Options. (line 21) * FS variable, as null string: Single Character Fields. (line 20) -* FS variable, as TAB character: Options. (line 214) +* FS variable, as TAB character: Options. (line 245) * FS variable, changing value of: Field Separators. (line 34) * FS variable, running awk programs and: Cut Program. (line 68) * FS variable, setting from command line: Command Line Field Separator. @@ -25995,20 +27027,21 @@ Index * functions, names of <1>: Definition Syntax. (line 20) * functions, names of: Arrays. (line 18) * functions, recursive: Definition Syntax. (line 73) -* functions, return values, setting: Internals. (line 139) +* functions, return values, setting: Internals. (line 130) * functions, string-translation: I18N Functions. (line 6) * 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 132) +* functions, user-defined, counts: Profiling. (line 129) * functions, user-defined, library of: Library Functions. (line 6) * functions, user-defined, next/nextfile statements and <1>: Nextfile Statement. (line 44) * functions, user-defined, next/nextfile statements and: Next Statement. (line 45) -* G-d: Acknowledgments. (line 81) +* G-d: Acknowledgments. (line 83) * Garfinkle, Scott: Contributors. (line 35) +* gawk program, dynamic profiling: Profiling. (line 171) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 23) @@ -26029,13 +27062,13 @@ Index * gawk, distribution: Distribution contents. (line 6) * gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54) -* gawk, ERRNO variable in <2>: Auto-set. (line 72) +* gawk, ERRNO variable in <2>: Auto-set. (line 73) * gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26) * gawk, ERRNO variable in <4>: Close Files And Pipes. (line 139) * gawk, ERRNO variable in: Getline. (line 19) * gawk, escape sequences: Escape Sequences. (line 125) -* gawk, extensions, disabling: Options. (line 202) +* gawk, extensions, disabling: Options. (line 233) * gawk, features, adding: Adding Code. (line 6) * gawk, features, advanced: Advanced Features. (line 6) * gawk, fflush() function in: I/O Functions. (line 44) @@ -26049,6 +27082,7 @@ Index (line 26) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, functions, adding: Dynamic Extensions. (line 10) +* gawk, functions, loading: Loading Extensions. (line 6) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) * gawk, IGNORECASE variable in <1>: Array Sorting Functions. (line 81) @@ -26079,7 +27113,7 @@ Index * gawk, OS/2 version of: PC Using. (line 11) * gawk, PROCINFO array in <1>: Two-way I/O. (line 116) * gawk, PROCINFO array in <2>: Time Functions. (line 46) -* gawk, PROCINFO array in: Auto-set. (line 123) +* gawk, PROCINFO array in: Auto-set. (line 124) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -26087,7 +27121,7 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 196) +* gawk, RT variable in <1>: Auto-set. (line 214) * gawk, RT variable in <2>: Getline/Variable/File. (line 10) * gawk, RT variable in <3>: Multiple Line. (line 129) @@ -26096,10 +27130,10 @@ Index * 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, TEXTDOMAIN variable in: User-modified. (line 162) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 36) -* gawk, versions of, information about, printing: Options. (line 253) +* gawk, versions of, information about, printing: Options. (line 279) * gawk, VMS version of: VMS Installation. (line 6) * gawk, word-boundary operator: GNU Regexp Operators. (line 63) @@ -26109,12 +27143,11 @@ Index * gensub() function (gawk): Using Constant Regexps. (line 43) * gensub() function (gawk), escape processing: Gory Details. (line 6) -* get_actual_argument() internal function: Internals. (line 125) -* get_argument() internal function: Internals. (line 120) -* get_array_argument() internal macro: Internals. (line 136) -* get_curfunc_arg_count() internal function: Internals. (line 42) -* get_record() input method: Internals. (line 160) -* get_scalar_argument() internal macro: Internals. (line 133) +* get_actual_argument() internal function: Internals. (line 116) +* get_argument() internal function: Internals. (line 111) +* get_array_argument() internal macro: Internals. (line 127) +* get_record() input method: Internals. (line 157) +* get_scalar_argument() internal macro: Internals. (line 124) * getaddrinfo() function (C library): TCP/IP Networking. (line 38) * getgrent() function (C library): Group Functions. (line 6) * getgrent() user-defined function: Group Functions. (line 6) @@ -26152,6 +27185,8 @@ Index * gettext() function (C library): Explaining gettext. (line 62) * gettimeofday() user-defined function: Gettimeofday Function. (line 16) +* GMP: Arbitrary Precision Arithmetic. + (line 6) * GNITS mailing list: Acknowledgments. (line 52) * GNU awk, See gawk: Preface. (line 49) * GNU Free Documentation License: GNU Free Documentation License. @@ -26160,7 +27195,7 @@ Index * GNU Lesser General Public License: Glossary. (line 397) * GNU long options <1>: Options. (line 6) * GNU long options: Command Line. (line 13) -* GNU long options, printing list of: Options. (line 145) +* GNU long options, printing list of: Options. (line 154) * GNU Project <1>: Glossary. (line 319) * GNU Project: Manual History. (line 11) * GNU/Linux <1>: Glossary. (line 611) @@ -26179,7 +27214,7 @@ Index (line 43) * gsub() function, arguments of: String Functions. (line 462) * gsub() function, escape processing: Gory Details. (line 6) -* h debugger command (alias for help): Miscellaneous Dgawk Commands. +* h debugger command (alias for help): Miscellaneous Debugger Commands. (line 68) * Hankerson, Darrel <1>: Contributors. (line 61) * Hankerson, Darrel: Acknowledgments. (line 60) @@ -26188,13 +27223,13 @@ Index * Hartholz, Elaine: Acknowledgments. (line 38) * Hartholz, Marshall: Acknowledgments. (line 38) * Hasegawa, Isamu: Contributors. (line 94) -* help debugger command: Miscellaneous Dgawk Commands. +* help debugger command: Miscellaneous Debugger Commands. (line 68) * hexadecimal numbers: Nondecimal-numbers. (line 6) -* hexadecimal values, enabling interpretation of: Options. (line 169) +* hexadecimal values, enabling interpretation of: Options. (line 193) * histsort.awk program: History Sorting. (line 25) * Hughes, Phil: Acknowledgments. (line 43) -* HUP signal: Profiling. (line 204) +* HUP signal: Profiling. (line 203) * hyphen (-), - operator: Precedence. (line 52) * hyphen (-), -- (decrement/increment) operators: Precedence. (line 46) * hyphen (-), -- operator: Increment Ops. (line 48) @@ -26202,14 +27237,16 @@ Index * hyphen (-), -= operator: Assignment Ops. (line 129) * hyphen (-), filenames beginning with: Options. (line 59) * hyphen (-), in bracket expressions: Bracket Expressions. (line 17) -* i debugger command (alias for info): Dgawk Info. (line 12) +* i debugger command (alias for info): Debugger Info. (line 13) * id utility: Id Program. (line 6) * 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, actions, changing: Ranges. (line 25) * igawk.sh program: Igawk Program. (line 124) -* ignore debugger command: Breakpoint Control. (line 86) +* ignore debugger command: Breakpoint Control. (line 87) * IGNORECASE variable <1>: Array Sorting Functions. (line 81) * IGNORECASE variable <2>: String Functions. (line 29) @@ -26237,7 +27274,9 @@ Index * index() function: String Functions. (line 155) * indexing arrays: Array Intro. (line 50) * indirect function calls: Indirect Calls. (line 6) -* info debugger command: Dgawk Info. (line 12) +* infinite precision: Arbitrary Precision Arithmetic. + (line 6) +* info debugger command: Debugger Info. (line 13) * initialization, automatic: More Complex. (line 38) * input files: Reading Files. (line 6) * input files, closing: Close Files And Pipes. @@ -26262,47 +27301,49 @@ 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 206) * int() function: Numeric Functions. (line 23) +* integer, arbitrary precision: Arbitrary Precision Integers. + (line 6) * integers: Basic Data Typing. (line 21) * integers, unsigned: Basic Data Typing. (line 30) * interacting with other programs: I/O Functions. (line 63) -* internal constant, INVALID_HANDLE: Internals. (line 160) -* internal function, assoc_clear(): Internals. (line 75) -* internal function, assoc_lookup(): Internals. (line 79) -* internal function, dupnode(): Internals. (line 96) +* internal constant, INVALID_HANDLE: Internals. (line 157) +* internal function, assoc_clear(): Internals. (line 68) +* internal function, assoc_lookup(): Internals. (line 72) +* internal function, dupnode(): Internals. (line 87) * internal function, force_number(): Internals. (line 27) * internal function, force_string(): Internals. (line 32) * internal function, force_wstring(): Internals. (line 37) -* internal function, get_actual_argument(): Internals. (line 125) -* internal function, get_argument(): Internals. (line 120) -* internal function, get_curfunc_arg_count(): Internals. (line 42) -* internal function, iop_alloc(): Internals. (line 160) -* internal function, make_builtin(): Internals. (line 106) -* internal function, make_number(): Internals. (line 91) -* internal function, make_string(): Internals. (line 86) -* internal function, register_deferred_variable(): Internals. (line 149) -* internal function, register_open_hook(): Internals. (line 160) -* internal function, unref(): Internals. (line 101) -* internal function, update_ERRNO(): Internals. (line 139) -* internal function, update_ERRNO_saved(): Internals. (line 144) -* internal macro, get_array_argument(): Internals. (line 136) -* internal macro, get_scalar_argument(): Internals. (line 133) -* internal structure, IOBUF: Internals. (line 160) +* internal function, get_actual_argument(): Internals. (line 116) +* internal function, get_argument(): Internals. (line 111) +* internal function, iop_alloc(): Internals. (line 157) +* internal function, make_builtin(): Internals. (line 97) +* internal function, make_number(): Internals. (line 82) +* internal function, make_string(): Internals. (line 77) +* internal function, register_deferred_variable(): Internals. (line 146) +* internal function, register_open_hook(): Internals. (line 157) +* internal function, unref(): Internals. (line 92) +* internal function, unset_ERRNO(): Internals. (line 141) +* internal function, update_ERRNO_int(): Internals. (line 130) +* internal function, update_ERRNO_string(): Internals. (line 135) +* internal macro, get_array_argument(): Internals. (line 127) +* internal macro, get_scalar_argument(): Internals. (line 124) +* internal structure, IOBUF: Internals. (line 157) * internal type, AWKNUM: Internals. (line 19) * internal type, NODE: Internals. (line 23) -* internal variable, nargs: Internals. (line 49) -* internal variable, stlen: Internals. (line 53) -* internal variable, stptr: Internals. (line 53) -* internal variable, type: Internals. (line 66) -* internal variable, vname: Internals. (line 71) -* internal variable, wstlen: Internals. (line 61) -* internal variable, wstptr: Internals. (line 61) +* internal variable, nargs: Internals. (line 42) +* internal variable, stlen: Internals. (line 46) +* internal variable, stptr: Internals. (line 46) +* internal variable, type: Internals. (line 59) +* internal variable, vname: Internals. (line 64) +* internal variable, wstlen: Internals. (line 54) +* internal variable, wstptr: Internals. (line 54) * internationalization <1>: I18N and L10N. (line 6) * internationalization: I18N Functions. (line 6) * internationalization, localization <1>: Internationalization. (line 13) -* internationalization, localization: User-modified. (line 153) +* internationalization, localization: User-modified. (line 162) * internationalization, localization, character classes: Bracket Expressions. (line 90) * internationalization, localization, gawk and: Internationalization. @@ -26317,10 +27358,10 @@ Index * interpreted programs <1>: Glossary. (line 361) * interpreted programs: Basic High Level. (line 14) * interval expressions: Regexp Operators. (line 116) -* INVALID_HANDLE internal constant: Internals. (line 160) +* INVALID_HANDLE internal constant: Internals. (line 157) * inventory-shipped file: Sample Data Files. (line 32) -* IOBUF internal structure: Internals. (line 160) -* iop_alloc() internal function: Internals. (line 160) +* IOBUF internal structure: Internals. (line 157) +* iop_alloc() internal function: Internals. (line 157) * isarray() function (gawk): Type Functions. (line 11) * ISO: Glossary. (line 372) * ISO 8859-1: Glossary. (line 141) @@ -26328,9 +27369,9 @@ Index * Jacobs, Andrew: Passwd Functions. (line 90) * Jaegermann, Michal <1>: Contributors. (line 46) * Jaegermann, Michal: Acknowledgments. (line 60) -* Java implementation of awk: Other Versions. (line 96) +* Java implementation of awk: Other Versions. (line 97) * Java programming language: Glossary. (line 380) -* jawk: Other Versions. (line 96) +* jawk: Other Versions. (line 97) * Jedi knights: Undocumented. (line 6) * join() user-defined function: Join Function. (line 18) * Kahrs, Ju"rgen <1>: Contributors. (line 70) @@ -26342,16 +27383,19 @@ Index * Kernighan, Brian <3>: Contributors. (line 12) * Kernighan, Brian <4>: BTL. (line 6) * Kernighan, Brian <5>: Concatenation. (line 6) -* Kernighan, Brian <6>: Acknowledgments. (line 75) +* Kernighan, Brian <6>: Acknowledgments. (line 77) * Kernighan, Brian <7>: Conventions. (line 34) * Kernighan, Brian: History. (line 17) -* kill command, dynamic profiling: Profiling. (line 182) +* kill command, dynamic profiling: Profiling. (line 180) * Knights, jedi: Undocumented. (line 6) +* Knuth, Donald: Arbitrary Precision Arithmetic. + (line 6) * Kwok, Conrad: Contributors. (line 35) -* l debugger command (alias for list): Miscellaneous Dgawk Commands. +* l debugger command (alias for list): Miscellaneous Debugger Commands. (line 74) * labels.awk program: Labels Program. (line 51) * languages, data-driven: Basic High Level. (line 83) +* Laurie, Dirk: Changing Precision. (line 6) * LC_ALL locale category: Explaining gettext. (line 120) * LC_COLLATE locale category: Explaining gettext. (line 93) * LC_CTYPE locale category: Explaining gettext. (line 97) @@ -26374,7 +27418,7 @@ Index * length() function: String Functions. (line 166) * Lesser General Public License (LGPL): Glossary. (line 397) * LGPL (Lesser General Public License): Glossary. (line 397) -* libmawk: Other Versions. (line 104) +* libmawk: Other Versions. (line 105) * libraries of awk functions: Library Functions. (line 6) * libraries of awk functions, assertions: Assert Function. (line 6) * libraries of awk functions, associative arrays and: Library Names. @@ -26412,20 +27456,22 @@ Index * lint checking, array subscripts: Uninitialized Subscripts. (line 43) * lint checking, empty programs: Command Line. (line 16) -* lint checking, issuing warnings: Options. (line 150) +* lint checking, issuing warnings: Options. (line 168) * lint checking, POSIXLY_CORRECT environment variable: Options. - (line 292) + (line 318) * lint checking, undefined functions: Pass By Value/Reference. (line 88) * LINT variable: User-modified. (line 98) * Linux <1>: Glossary. (line 611) * Linux <2>: I18N Example. (line 55) * Linux: Manual History. (line 28) -* list debugger command: Miscellaneous Dgawk Commands. +* list debugger command: Miscellaneous Debugger Commands. (line 74) +* loading extension: Loading Extensions. (line 6) +* loading, library: Options. (line 159) * local variables: Variable Scope. (line 6) * locale categories: Explaining gettext. (line 80) -* locale decimal point character: Options. (line 218) +* locale decimal point character: Options. (line 249) * locale, definition of: Locales. (line 6) * localization: I18N and L10N. (line 6) * localization, See internationalization, localization: I18N and L10N. @@ -26438,7 +27484,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 126) +* loops, count for header: Profiling. (line 123) * loops, exiting: Break Statement. (line 6) * loops, See Also while statement: While Statement. (line 6) * Lost In Space: Dynamic Extensions. (line 6) @@ -26447,9 +27493,9 @@ Index * lvalues/rvalues: Assignment Ops. (line 32) * mailing labels, printing: Labels Program. (line 6) * mailing list, GNITS: Acknowledgments. (line 52) -* make_builtin() internal function: Internals. (line 106) -* make_number() internal function: Internals. (line 91) -* make_string() internal function: Internals. (line 86) +* make_builtin() internal function: Internals. (line 97) +* make_number() internal function: Internals. (line 82) +* make_string() internal function: Internals. (line 77) * mark parity: Ordinal Functions. (line 45) * marked string extraction (internationalization): String Extraction. (line 6) @@ -26464,7 +27510,7 @@ Index * matching, null strings: Gory Details. (line 164) * mawk program: Other Versions. (line 35) * McPhee, Patrick: Contributors. (line 100) -* memory, releasing: Internals. (line 101) +* memory, releasing: Internals. (line 92) * message object files: Explaining gettext. (line 41) * message object files, converting from portable object files: I18N Example. (line 62) @@ -26476,8 +27522,12 @@ Index * mktime() function (gawk): Time Functions. (line 24) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 103) +* MPFR: Arbitrary Precision Arithmetic. + (line 6) * msgfmt utility: I18N Example. (line 62) -* n debugger command (alias for next): Dgawk Execution Control. +* multiple precision: Arbitrary Precision Arithmetic. + (line 6) +* n debugger command (alias for next): Debugger Execution Control. (line 43) * names, arrays/variables <1>: Library Names. (line 6) * names, arrays/variables: Arrays. (line 18) @@ -26486,14 +27536,14 @@ Index * namespace issues <1>: Library Names. (line 6) * namespace issues: Arrays. (line 18) * namespace issues, functions: Definition Syntax. (line 20) -* nargs internal variable: Internals. (line 49) +* nargs internal variable: Internals. (line 42) * nawk utility: Names. (line 17) * negative zero: Unexpected Results. (line 28) * NetBSD: Glossary. (line 611) * networks, programming: TCP/IP Networking. (line 6) * networks, support for: Special Network. (line 6) * newlines <1>: Boolean Ops. (line 67) -* newlines <2>: Options. (line 208) +* newlines <2>: Options. (line 239) * newlines: Statements/Lines. (line 6) * newlines, as field separators: Default Field Splitting. (line 6) @@ -26504,7 +27554,7 @@ Index * newlines, separating statements in actions <1>: Statements. (line 10) * newlines, separating statements in actions: Action Overview. (line 19) -* next debugger command: Dgawk Execution Control. +* next debugger command: Debugger Execution Control. (line 43) * next statement <1>: Next Statement. (line 6) * next statement: Boolean Ops. (line 85) @@ -26519,20 +27569,20 @@ Index (line 26) * nextfile statement, user-defined functions and: Nextfile Statement. (line 44) -* nexti debugger command: Dgawk Execution Control. +* nexti debugger command: Debugger Execution Control. (line 49) -* NF variable <1>: Auto-set. (line 107) +* NF variable <1>: Auto-set. (line 108) * NF variable: Fields. (line 33) * NF variable, decrementing: Changing Fields. (line 107) -* ni debugger command (alias for nexti): Dgawk Execution Control. +* ni debugger command (alias for nexti): Debugger Execution Control. (line 49) * noassign.awk program: Ignoring Assigns. (line 15) * NODE internal type: Internals. (line 23) -* nodes, duplicating: Internals. (line 96) +* nodes, duplicating: Internals. (line 87) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 118) +* NR variable <1>: Auto-set. (line 119) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 207) +* NR variable, changing: Auto-set. (line 225) * null strings <1>: Basic Data Typing. (line 50) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -26549,7 +27599,7 @@ Index * number sign (#), #! (executable scripts), portability issues with: Executable Scripts. (line 6) * number sign (#), commenting: Comments. (line 6) -* numbers: Internals. (line 91) +* numbers: Internals. (line 82) * numbers, as array subscripts: Numeric Array Subscripts. (line 6) * numbers, as values of characters: Ordinal Functions. (line 6) @@ -26569,11 +27619,11 @@ Index * numeric, output format: OFMT. (line 6) * numeric, strings: Variable Typing. (line 6) * numeric, values: Internals. (line 27) -* o debugger command (alias for option): Dgawk Info. (line 56) +* o debugger command (alias for option): Debugger Info. (line 57) * oawk utility: Names. (line 17) * obsolete features: Obsolete. (line 6) * octal numbers: Nondecimal-numbers. (line 6) -* octal values, enabling interpretation of: Options. (line 169) +* octal values, enabling interpretation of: Options. (line 193) * OFMT variable <1>: User-modified. (line 115) * OFMT variable <2>: Conversion. (line 55) * OFMT variable: OFMT. (line 15) @@ -26582,7 +27632,7 @@ Index * OFS variable <2>: Output Separators. (line 6) * OFS variable: Changing Fields. (line 64) * OpenBSD: Glossary. (line 611) -* OpenSolaris: Other Versions. (line 86) +* OpenSolaris: Other Versions. (line 87) * operating systems, BSD-based: Manual History. (line 28) * operating systems, PC, gawk on: PC Using. (line 6) * operating systems, PC, gawk on, installing: PC Installation. @@ -26615,7 +27665,7 @@ Index (line 48) * operators, word-boundary (gawk): GNU Regexp Operators. (line 63) -* option debugger command: Dgawk Info. (line 56) +* option debugger command: Debugger Info. (line 57) * options, command-line <1>: Command Line Field Separator. (line 6) * options, command-line <2>: Options. (line 6) @@ -26626,7 +27676,7 @@ Index * options, deprecated: Obsolete. (line 6) * options, long <1>: Options. (line 6) * options, long: Command Line. (line 13) -* options, printing list of: Options. (line 145) +* options, printing list of: Options. (line 154) * OR bitwise operation: Bitwise Functions. (line 6) * or Boolean-logic operator: Boolean Ops. (line 6) * or() function (gawk): Bitwise Functions. (line 48) @@ -26652,15 +27702,15 @@ Index (line 36) * P1003.1 POSIX standard: Glossary. (line 454) * P1003.2 POSIX standard: Glossary. (line 454) -* parameters, number of: Internals. (line 49) +* parameters, number of: Internals. (line 42) +* parentheses () <1>: Profiling. (line 138) * parentheses (): Regexp Operators. (line 79) -* parentheses (), pgawk program: Profiling. (line 141) * password file: Passwd Functions. (line 16) * patsplit() function: String Functions. (line 293) * patterns: Patterns and Actions. (line 6) * patterns, comparison expressions as: Expression Patterns. (line 14) -* patterns, counts: Profiling. (line 113) +* patterns, counts: Profiling. (line 110) * patterns, default: Very Simple. (line 34) * patterns, empty: Empty. (line 6) * patterns, expressions as: Regexp Patterns. (line 6) @@ -26678,9 +27728,6 @@ Index * Perl: Future Extensions. (line 6) * Peters, Arno: Contributors. (line 85) * Peterson, Hal: Contributors. (line 40) -* pgawk program: Profiling. (line 6) -* pgawk program, awkprof.out file: Profiling. (line 10) -* pgawk program, dynamic profiling: Profiling. (line 174) * pipes, closing: Close Files And Pipes. (line 6) * pipes, input: Getline/Pipe. (line 6) @@ -26721,13 +27768,13 @@ 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 313) +* portability, POSIXLY_CORRECT environment variable: Options. (line 339) * portability, substr() function: String Functions. (line 512) * 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. (line 62) -* portable object files, generating: Options. (line 138) +* portable object files, generating: Options. (line 147) * portable object template files: Explaining gettext. (line 30) * porting gawk: New Ports. (line 6) * positional specifiers, printf statement <1>: Printf Ordering. @@ -26771,11 +27818,13 @@ Index * POSIX awk, regular expressions and: Regexp Operators. (line 161) * POSIX awk, timestamps and: Time Functions. (line 6) * POSIX awk, | I/O operator and: Getline/Pipe. (line 52) -* POSIX mode: Options. (line 202) +* POSIX mode: Options. (line 233) * 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 292) +* POSIXLY_CORRECT environment variable: Options. (line 318) +* PREC variable <1>: Setting Precision. (line 6) +* PREC variable: User-modified. (line 134) * precedence <1>: Precedence. (line 6) * precedence: Increment Ops. (line 61) * precedence, regexp operators: Regexp Operators. (line 156) @@ -26809,24 +27858,24 @@ Index * printf statement, sprintf() function and: Round Function. (line 6) * printf statement, syntax of: Basic Printf. (line 6) * printing: Printing. (line 6) -* printing, list of options: Options. (line 145) +* 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) * processes, two-way communications with: Two-way I/O. (line 23) * processing data: Basic High Level. (line 6) -* PROCINFO array <1>: Internals. (line 149) +* PROCINFO array <1>: Internals. (line 146) * PROCINFO array <2>: Id Program. (line 15) * PROCINFO array <3>: Group Functions. (line 6) * PROCINFO array <4>: Passwd Functions. (line 6) * PROCINFO array <5>: Two-way I/O. (line 116) * PROCINFO array <6>: Time Functions. (line 46) -* PROCINFO array <7>: Auto-set. (line 123) +* PROCINFO array <7>: Auto-set. (line 124) * PROCINFO array: Obsolete. (line 11) * profiling awk programs: Profiling. (line 6) -* profiling awk programs, dynamically: Profiling. (line 174) -* profiling gawk, See pgawk program: Profiling. (line 6) +* profiling awk programs, dynamically: Profiling. (line 171) +* profiling gawk: Profiling. (line 6) * program, definition of: Getting Started. (line 21) * programmers, attractiveness of: Two-way I/O. (line 6) * programming conventions, --non-decimal-data option: Nondecimal Data. @@ -26850,23 +27899,23 @@ Index * programming, basic steps: Basic High Level. (line 19) * programming, concepts: Basic Concepts. (line 6) * pwcat program: Passwd Functions. (line 23) -* q debugger command (alias for quit): Miscellaneous Dgawk Commands. +* q debugger command (alias for quit): Miscellaneous Debugger Commands. (line 101) -* QSE Awk: Other Versions. (line 108) +* QSE Awk: Other Versions. (line 109) * question mark (?) regexp operator <1>: GNU Regexp Operators. (line 59) * question mark (?) regexp operator: Regexp Operators. (line 111) * question mark (?), ?: operator: Precedence. (line 92) -* QuikTrim Awk: Other Versions. (line 112) -* quit debugger command: Miscellaneous Dgawk Commands. +* QuikTrim Awk: Other Versions. (line 113) +* quit debugger command: Miscellaneous Debugger Commands. (line 101) -* QUIT signal (MS-Windows): Profiling. (line 207) +* QUIT signal (MS-Windows): Profiling. (line 206) * 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) -* r debugger command (alias for run): Dgawk Execution Control. +* r debugger command (alias for run): Debugger Execution Control. (line 62) * Rakitzis, Byron: History Sorting. (line 25) * rand() function: Numeric Functions. (line 34) @@ -26884,7 +27933,7 @@ Index * readable data files, checking: File Checking. (line 6) * readable.awk program: File Checking. (line 11) * recipe for a programming language: History. (line 6) -* record separators <1>: User-modified. (line 134) +* record separators <1>: User-modified. (line 143) * record separators: Records. (line 14) * record separators, changing: Records. (line 81) * record separators, regular expressions as: Records. (line 112) @@ -26912,8 +27961,8 @@ Index * 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_deferred_variable() internal function: Internals. (line 149) -* register_open_hook() internal function: Internals. (line 160) +* register_deferred_variable() internal function: Internals. (line 146) +* register_open_hook() internal function: Internals. (line 157) * regular expressions: Regexp. (line 6) * regular expressions as field separators: Field Separators. (line 50) * regular expressions, anchors in: Regexp Operators. (line 22) @@ -26932,7 +27981,7 @@ Index (line 59) * regular expressions, gawk, command-line options: GNU Regexp Operators. (line 70) -* regular expressions, interval expressions and: Options. (line 227) +* regular expressions, interval expressions and: Options. (line 258) * regular expressions, leftmost longest match: Leftmost Longest. (line 6) * regular expressions, operators <1>: Regexp Operators. (line 6) @@ -26948,7 +27997,7 @@ Index * regular expressions, searching for: Egrep Program. (line 6) * relational operators, See comparison operators: Typing and Comparison. (line 9) -* return debugger command: Dgawk Execution Control. +* return debugger command: Debugger Execution Control. (line 54) * return statement, user-defined functions: Return Statement. (line 6) * return values, close() function: Close Files And Pipes. @@ -26966,7 +28015,7 @@ Index * right angle bracket (>), >> operator (I/O): Redirection. (line 50) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 74) -* RLENGTH variable: Auto-set. (line 183) +* RLENGTH variable: Auto-set. (line 201) * RLENGTH variable, match() function and: String Functions. (line 223) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 32) @@ -26977,23 +28026,27 @@ Index * Robbins, Arnold: Command Line Field Separator. (line 80) * Robbins, Bill: Getline/Pipe. (line 36) -* Robbins, Harry: Acknowledgments. (line 81) -* Robbins, Jean: Acknowledgments. (line 81) +* Robbins, Harry: Acknowledgments. (line 83) +* Robbins, Jean: Acknowledgments. (line 83) * Robbins, Miriam <1>: Passwd Functions. (line 90) * Robbins, Miriam <2>: Getline/Pipe. (line 36) -* Robbins, Miriam: Acknowledgments. (line 81) +* Robbins, Miriam: Acknowledgments. (line 83) * Robinson, Will: Dynamic Extensions. (line 6) * robot, the: Dynamic Extensions. (line 6) * Rommel, Kai Uwe: Contributors. (line 43) * round() user-defined function: Round Function. (line 16) +* rounding mode, floating-point: Rounding Mode. (line 6) * rounding numbers: Round Function. (line 6) -* RS variable <1>: User-modified. (line 134) +* ROUNDMODE variable <1>: Setting Rounding Mode. + (line 6) +* ROUNDMODE variable: User-modified. (line 138) +* RS variable <1>: User-modified. (line 143) * RS variable: Records. (line 20) * RS variable, multiline records and: Multiple Line. (line 17) * rshift() function (gawk): Bitwise Functions. (line 51) -* RSTART variable: Auto-set. (line 189) +* RSTART variable: Auto-set. (line 207) * RSTART variable, match() function and: String Functions. (line 223) -* RT variable <1>: Auto-set. (line 196) +* RT variable <1>: Auto-set. (line 214) * RT variable <2>: Getline/Variable/File. (line 10) * RT variable <3>: Multiple Line. (line 129) @@ -27001,12 +28054,12 @@ Index * Rubin, Paul <1>: Contributors. (line 16) * Rubin, Paul: History. (line 30) * rule, definition of: Getting Started. (line 21) -* run debugger command: Dgawk Execution Control. +* run debugger command: Debugger Execution Control. (line 62) * rvalues/lvalues: Assignment Ops. (line 32) -* s debugger command (alias for step): Dgawk Execution Control. +* s debugger command (alias for step): Debugger Execution Control. (line 68) -* sandbox mode: Options. (line 239) +* sandbox mode: Options. (line 265) * scalar values: Basic Data Typing. (line 13) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) @@ -27014,7 +28067,9 @@ Index * search paths <1>: VMS Running. (line 29) * search paths <2>: PC Using. (line 11) * search paths <3>: Igawk Program. (line 368) +* search paths <4>: AWKLIBPATH Variable. (line 6) * search paths: AWKPATH Variable. (line 6) +* search paths, for shared libraries: AWKLIBPATH Variable. (line 6) * search paths, for source files <1>: VMS Running. (line 29) * search paths, for source files <2>: PC Using. (line 11) * search paths, for source files <3>: Igawk Program. (line 368) @@ -27036,11 +28091,11 @@ Index * separators, field, FIELDWIDTHS variable and: User-modified. (line 35) * separators, field, FPAT variable and: User-modified. (line 45) * separators, field, POSIX and: Fields. (line 6) -* separators, for records <1>: User-modified. (line 134) +* separators, for records <1>: User-modified. (line 143) * separators, for records: Records. (line 14) * separators, for records, regular expressions as: Records. (line 112) * separators, for statements in actions: Action Overview. (line 19) -* separators, subscript: User-modified. (line 147) +* separators, subscript: User-modified. (line 156) * set debugger command: Viewing And Changing Data. (line 59) * shells, piping commands into: Redirection. (line 143) @@ -27052,7 +28107,7 @@ Index (line 6) * shift, bitwise: Bitwise Functions. (line 32) * short-circuit operators: Boolean Ops. (line 57) -* si debugger command (alias for stepi): Dgawk Execution Control. +* si debugger command (alias for stepi): Debugger Execution Control. (line 76) * side effects <1>: Increment Ops. (line 11) * side effects: Concatenation. (line 42) @@ -27067,15 +28122,15 @@ Index * side effects, FILENAME variable: Getline Notes. (line 19) * side effects, function calls: Function Calls. (line 54) * side effects, statements: Action Overview. (line 32) -* 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 182) -* SIGQUIT signal (MS-Windows): Profiling. (line 207) -* SIGUSR1 signal: Profiling. (line 182) -* silent debugger command: Dgawk Execution Control. +* SIGHUP signal: Profiling. (line 203) +* SIGINT signal (MS-Windows): Profiling. (line 206) +* signals, HUP/SIGHUP: Profiling. (line 203) +* signals, INT/SIGINT (MS-Windows): Profiling. (line 206) +* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 206) +* signals, USR1/SIGUSR1: Profiling. (line 180) +* SIGQUIT signal (MS-Windows): Profiling. (line 206) +* SIGUSR1 signal: Profiling. (line 180) +* silent debugger command: Debugger Execution Control. (line 10) * sin() function: Numeric Functions. (line 75) * single precision floating-point: Basic Data Typing. (line 36) @@ -27088,7 +28143,7 @@ Index (line 6) * Skywalker, Luke: Undocumented. (line 6) * sleep utility: Alarm Program. (line 109) -* Solaris, POSIX-compliant awk: Other Versions. (line 86) +* Solaris, POSIX-compliant awk: Other Versions. (line 87) * sort function, arrays, sorting: Array Sorting Functions. (line 6) * sort utility: Word Sorting. (line 50) @@ -27097,17 +28152,17 @@ Index (line 93) * source code, awka: Other Versions. (line 55) * source code, Brian Kernighan's awk: Other Versions. (line 13) -* source code, Busybox Awk: Other Versions. (line 78) +* source code, Busybox Awk: Other Versions. (line 79) * source code, gawk: Gawk Distribution. (line 6) -* source code, jawk: Other Versions. (line 96) -* source code, libmawk: Other Versions. (line 104) +* source code, jawk: Other Versions. (line 97) +* source code, libmawk: Other Versions. (line 105) * source code, mawk: Other Versions. (line 35) -* source code, mixing: Options. (line 108) +* source code, mixing: Options. (line 117) * source code, pawk: Other Versions. (line 69) -* source code, QSE Awk: Other Versions. (line 108) -* source code, QuikTrim Awk: Other Versions. (line 112) -* source code, Solaris awk: Other Versions. (line 86) -* source code, xgawk: Other Versions. (line 119) +* source code, QSE Awk: Other Versions. (line 109) +* source code, QuikTrim Awk: Other Versions. (line 113) +* source code, Solaris awk: Other Versions. (line 87) +* source code, xgawk: Other Versions. (line 120) * source files, search path for: Igawk Program. (line 368) * sparse arrays: Array Intro. (line 71) * Spencer, Henry: Glossary. (line 12) @@ -27135,12 +28190,12 @@ Index * statements, compound, control statements and: Statements. (line 10) * statements, control, in actions: Statements. (line 6) * statements, multiple: Statements/Lines. (line 91) -* step debugger command: Dgawk Execution Control. +* step debugger command: Debugger Execution Control. (line 68) -* stepi debugger command: Dgawk Execution Control. +* stepi debugger command: Debugger Execution Control. (line 76) -* stlen internal variable: Internals. (line 53) -* stptr internal variable: Internals. (line 53) +* stlen internal variable: Internals. (line 46) +* stptr internal variable: Internals. (line 46) * stream editors <1>: Simple Sed. (line 6) * stream editors: Field Splitting Summary. (line 47) @@ -27151,7 +28206,7 @@ Index (line 6) * string operators: Concatenation. (line 9) * string-matching operators: Regexp Usage. (line 19) -* strings: Internals. (line 86) +* strings: Internals. (line 77) * strings, converting <1>: Bitwise Functions. (line 107) * strings, converting: Conversion. (line 6) * strings, converting, numbers to: User-modified. (line 28) @@ -27173,7 +28228,7 @@ Index (line 43) * sub() function, arguments of: String Functions. (line 462) * sub() function, escape processing: Gory Details. (line 6) -* subscript separators: User-modified. (line 147) +* subscript separators: User-modified. (line 156) * subscripts in arrays, multidimensional: Multi-dimensional. (line 10) * subscripts in arrays, multidimensional, scanning: Multi-scanning. (line 11) @@ -27181,7 +28236,7 @@ Index (line 6) * subscripts in arrays, uninitialized variables as: Uninitialized Subscripts. (line 6) -* SUBSEP variable: User-modified. (line 147) +* SUBSEP variable: User-modified. (line 156) * SUBSEP variable, multidimensional arrays: Multi-dimensional. (line 16) * substr() function: String Functions. (line 481) @@ -27191,8 +28246,8 @@ Index (line 148) * system() function: I/O Functions. (line 63) * systime() function (gawk): Time Functions. (line 64) -* t debugger command (alias for tbreak): Breakpoint Control. (line 89) -* tbreak debugger command: Breakpoint Control. (line 89) +* t debugger command (alias for tbreak): Breakpoint Control. (line 90) +* tbreak debugger command: Breakpoint Control. (line 90) * Tcl: Library Names. (line 57) * TCP/IP: TCP/IP Networking. (line 6) * TCP/IP, support for: Special Network. (line 6) @@ -27214,7 +28269,7 @@ Index * text, printing: Print. (line 22) * text, printing, unduplicated lines of: Uniq Program. (line 6) * TEXTDOMAIN variable <1>: Programmer i18n. (line 9) -* TEXTDOMAIN variable: User-modified. (line 153) +* TEXTDOMAIN variable: User-modified. (line 162) * TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60) * TEXTDOMAIN variable, portability and: I18N Portability. (line 20) * textdomain() function (C library): Explaining gettext. (line 27) @@ -27231,6 +28286,7 @@ Index * time, managing: Gettimeofday Function. (line 6) * time, retrieving: Time Functions. (line 17) +* timeout, reading input: Read Timeout. (line 6) * timestamps: Time Functions. (line 6) * timestamps, converting dates to: Time Functions. (line 74) * timestamps, formatted: Gettimeofday Function. @@ -27238,10 +28294,10 @@ Index * tolower() function: String Functions. (line 523) * toupper() function: String Functions. (line 529) * tr utility: Translate Program. (line 6) -* trace debugger command: Miscellaneous Dgawk Commands. +* trace debugger command: Miscellaneous Debugger Commands. (line 110) * translate.awk program: Translate Program. (line 55) -* troubleshooting, --non-decimal-data option: Options. (line 169) +* troubleshooting, --non-decimal-data option: Options. (line 193) * troubleshooting, == operator: Comparison Operators. (line 37) * troubleshooting, awk uses FS not IFS: Field Separators. (line 29) @@ -27281,8 +28337,8 @@ Index * trunc-mod operation: Arithmetic Ops. (line 66) * truth values: Truth Values. (line 6) * type conversion: Conversion. (line 21) -* type internal variable: Internals. (line 66) -* u debugger command (alias for until): Dgawk Execution Control. +* type internal variable: Internals. (line 59) +* u debugger command (alias for until): Debugger Execution Control. (line 83) * undefined functions: Pass By Value/Reference. (line 71) @@ -27307,23 +28363,24 @@ Index (line 72) * Unix, awk scripts and: Executable Scripts. (line 6) * UNIXROOT variable, on OS/2 systems: PC Using. (line 17) -* unref() internal function: Internals. (line 101) +* unref() internal function: Internals. (line 92) +* unset_ERRNO() internal function: Internals. (line 141) * unsigned integers: Basic Data Typing. (line 30) -* until debugger command: Dgawk Execution Control. +* until debugger command: Debugger Execution Control. (line 83) * unwatch debugger command: Viewing And Changing Data. (line 84) -* up debugger command: Dgawk Stack. (line 33) -* update_ERRNO() internal function: Internals. (line 139) -* update_ERRNO_saved() internal function: Internals. (line 144) +* up debugger command: Execution Stack. (line 33) +* update_ERRNO_int() internal function: Internals. (line 130) +* update_ERRNO_string() internal function: Internals. (line 135) * user database, reading: Passwd Functions. (line 6) * user-defined, functions: User-defined. (line 6) -* user-defined, functions, counts: Profiling. (line 132) +* user-defined, functions, counts: Profiling. (line 129) * 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 182) +* USR1 signal: Profiling. (line 180) * values, numeric: Basic Data Typing. (line 13) * values, string: Basic Data Typing. (line 13) * variable typing: Typing and Comparison. @@ -27366,7 +28423,7 @@ Index * vertical bar (|), || operator <1>: Precedence. (line 89) * vertical bar (|), || operator: Boolean Ops. (line 57) * Vinschen, Corinna: Acknowledgments. (line 60) -* vname internal variable: Internals. (line 71) +* vname internal variable: Internals. (line 64) * w debugger command (alias for watch): Viewing And Changing Data. (line 67) * w utility: Constant Size. (line 22) @@ -27374,7 +28431,7 @@ Index * Wall, Larry <1>: Future Extensions. (line 6) * Wall, Larry: Array Intro. (line 6) * Wallin, Anders: Acknowledgments. (line 60) -* warnings, issuing: Options. (line 150) +* warnings, issuing: Options. (line 168) * watch debugger command: Viewing And Changing Data. (line 67) * wc utility: Wc Program. (line 6) @@ -27386,7 +28443,7 @@ Index * whitespace, as field separators: Default Field Splitting. (line 6) * whitespace, functions, calling: Calling Built-in. (line 10) -* whitespace, newlines as: Options. (line 208) +* whitespace, newlines as: Options. (line 239) * Williams, Kent: Contributors. (line 35) * Woehlke, Matthew: Contributors. (line 79) * Woods, John: Contributors. (line 28) @@ -27400,11 +28457,11 @@ Index * words, counting: Wc Program. (line 6) * words, duplicate, searching for: Dupword Program. (line 6) * words, usage counts, generating: Word Sorting. (line 6) -* wstlen internal variable: Internals. (line 61) -* wstptr internal variable: Internals. (line 61) -* xgawk: Other Versions. (line 119) +* wstlen internal variable: Internals. (line 54) +* wstptr internal variable: Internals. (line 54) +* xgawk: Other Versions. (line 120) * xgettext utility: String Extraction. (line 13) -* XML (eXtensible Markup Language): Internals. (line 160) +* XML (eXtensible Markup Language): Internals. (line 157) * XOR bitwise operation: Bitwise Functions. (line 6) * xor() function (gawk): Bitwise Functions. (line 54) * Yawitz, Efraim: Contributors. (line 106) @@ -27414,8 +28471,8 @@ Index * zero, negative vs. positive: Unexpected Results. (line 28) * zerofile.awk program: Empty Files. (line 21) * Zoulas, Christos: Contributors. (line 67) +* {} (braces): Profiling. (line 134) * {} (braces), actions and: Action Overview. (line 19) -* {} (braces), pgawk program: Profiling. (line 137) * {} (braces), statements, grouping: Statements. (line 10) * | (vertical bar): Regexp Operators. (line 69) * | (vertical bar), | operator (I/O) <1>: Precedence. (line 65) @@ -27442,416 +28499,442 @@ Index Tag Table: Node: Top1352 -Node: Foreword30282 -Node: Preface34627 -Ref: Preface-Footnote-137680 -Ref: Preface-Footnote-237786 -Node: History38018 -Node: Names40409 -Ref: Names-Footnote-141886 -Node: This Manual41958 -Ref: This Manual-Footnote-146905 -Node: Conventions47005 -Node: Manual History49139 -Ref: Manual History-Footnote-152409 -Ref: Manual History-Footnote-252450 -Node: How To Contribute52524 -Node: Acknowledgments53668 -Node: Getting Started57999 -Node: Running gawk60378 -Node: One-shot61564 -Node: Read Terminal62789 -Ref: Read Terminal-Footnote-164439 -Ref: Read Terminal-Footnote-264715 -Node: Long64886 -Node: Executable Scripts66262 -Ref: Executable Scripts-Footnote-168131 -Ref: Executable Scripts-Footnote-268233 -Node: Comments68780 -Node: Quoting71247 -Node: DOS Quoting75870 -Node: Sample Data Files76545 -Node: Very Simple79577 -Node: Two Rules84176 -Node: More Complex86323 -Ref: More Complex-Footnote-189253 -Node: Statements/Lines89338 -Ref: Statements/Lines-Footnote-193800 -Node: Other Features94065 -Node: When94993 -Node: Invoking Gawk97140 -Node: Command Line98525 -Node: Options99308 -Ref: Options-Footnote-1112852 -Node: Other Arguments112877 -Node: Naming Standard Input115535 -Node: Environment Variables116629 -Node: AWKPATH Variable117073 -Ref: AWKPATH Variable-Footnote-1119670 -Node: Other Environment Variables119930 -Node: Exit Status122270 -Node: Include Files122945 -Node: Obsolete126430 -Node: Undocumented127116 -Node: Regexp127357 -Node: Regexp Usage128746 -Node: Escape Sequences130772 -Node: Regexp Operators136535 -Ref: Regexp Operators-Footnote-1143915 -Ref: Regexp Operators-Footnote-2144062 -Node: Bracket Expressions144160 -Ref: table-char-classes146050 -Node: GNU Regexp Operators148573 -Node: Case-sensitivity152296 -Ref: Case-sensitivity-Footnote-1155264 -Ref: Case-sensitivity-Footnote-2155499 -Node: Leftmost Longest155607 -Node: Computed Regexps156808 -Node: Reading Files160218 -Node: Records162159 -Ref: Records-Footnote-1170833 -Node: Fields170870 -Ref: Fields-Footnote-1173903 -Node: Nonconstant Fields173989 -Node: Changing Fields176191 -Node: Field Separators182172 -Node: Default Field Splitting184801 -Node: Regexp Field Splitting185918 -Node: Single Character Fields189260 -Node: Command Line Field Separator190319 -Node: Field Splitting Summary193760 -Ref: Field Splitting Summary-Footnote-1196952 -Node: Constant Size197053 -Node: Splitting By Content201637 -Ref: Splitting By Content-Footnote-1205363 -Node: Multiple Line205403 -Ref: Multiple Line-Footnote-1211250 -Node: Getline211429 -Node: Plain Getline213657 -Node: Getline/Variable215746 -Node: Getline/File216887 -Node: Getline/Variable/File218209 -Ref: Getline/Variable/File-Footnote-1219808 -Node: Getline/Pipe219895 -Node: Getline/Variable/Pipe222455 -Node: Getline/Coprocess223562 -Node: Getline/Variable/Coprocess224805 -Node: Getline Notes225519 -Node: Getline Summary227461 -Ref: table-getline-variants227804 -Node: Command line directories228660 -Node: Printing229285 -Node: Print230916 -Node: Print Examples232253 -Node: Output Separators235037 -Node: OFMT236797 -Node: Printf238155 -Node: Basic Printf239061 -Node: Control Letters240600 -Node: Format Modifiers244412 -Node: Printf Examples250421 -Node: Redirection253136 -Node: Special Files260120 -Node: Special FD260653 -Ref: Special FD-Footnote-1264278 -Node: Special Network264352 -Node: Special Caveats265202 -Node: Close Files And Pipes265998 -Ref: Close Files And Pipes-Footnote-1273021 -Ref: Close Files And Pipes-Footnote-2273169 -Node: Expressions273319 -Node: Values274451 -Node: Constants275127 -Node: Scalar Constants275807 -Ref: Scalar Constants-Footnote-1276666 -Node: Nondecimal-numbers276848 -Node: Regexp Constants279907 -Node: Using Constant Regexps280382 -Node: Variables283437 -Node: Using Variables284092 -Node: Assignment Options285816 -Node: Conversion287688 -Ref: table-locale-affects293064 -Ref: Conversion-Footnote-1293688 -Node: All Operators293797 -Node: Arithmetic Ops294427 -Node: Concatenation296932 -Ref: Concatenation-Footnote-1299725 -Node: Assignment Ops299845 -Ref: table-assign-ops304833 -Node: Increment Ops306241 -Node: Truth Values and Conditions309711 -Node: Truth Values310794 -Node: Typing and Comparison311843 -Node: Variable Typing312632 -Ref: Variable Typing-Footnote-1316529 -Node: Comparison Operators316651 -Ref: table-relational-ops317061 -Node: POSIX String Comparison320610 -Ref: POSIX String Comparison-Footnote-1321566 -Node: Boolean Ops321704 -Ref: Boolean Ops-Footnote-1325782 -Node: Conditional Exp325873 -Node: Function Calls327605 -Node: Precedence331199 -Node: Locales334868 -Node: Patterns and Actions335957 -Node: Pattern Overview337011 -Node: Regexp Patterns338680 -Node: Expression Patterns339223 -Node: Ranges342908 -Node: BEGIN/END345874 -Node: Using BEGIN/END346636 -Ref: Using BEGIN/END-Footnote-1349367 -Node: I/O And BEGIN/END349473 -Node: BEGINFILE/ENDFILE351755 -Node: Empty354648 -Node: Using Shell Variables354964 -Node: Action Overview357249 -Node: Statements359606 -Node: If Statement361460 -Node: While Statement362959 -Node: Do Statement365003 -Node: For Statement366159 -Node: Switch Statement369311 -Node: Break Statement371408 -Node: Continue Statement373398 -Node: Next Statement375191 -Node: Nextfile Statement377581 -Node: Exit Statement380126 -Node: Built-in Variables382542 -Node: User-modified383637 -Ref: User-modified-Footnote-1391663 -Node: Auto-set391725 -Ref: Auto-set-Footnote-1401016 -Node: ARGC and ARGV401221 -Node: Arrays405072 -Node: Array Basics406577 -Node: Array Intro407403 -Node: Reference to Elements411721 -Node: Assigning Elements413991 -Node: Array Example414482 -Node: Scanning an Array416214 -Node: Controlling Scanning418528 -Ref: Controlling Scanning-Footnote-1423461 -Node: Delete423777 -Ref: Delete-Footnote-1426212 -Node: Numeric Array Subscripts426269 -Node: Uninitialized Subscripts428452 -Node: Multi-dimensional430080 -Node: Multi-scanning433174 -Node: Arrays of Arrays434765 -Node: Functions439410 -Node: Built-in440232 -Node: Calling Built-in441310 -Node: Numeric Functions443298 -Ref: Numeric Functions-Footnote-1447130 -Ref: Numeric Functions-Footnote-2447487 -Ref: Numeric Functions-Footnote-3447535 -Node: String Functions447804 -Ref: String Functions-Footnote-1471301 -Ref: String Functions-Footnote-2471430 -Ref: String Functions-Footnote-3471678 -Node: Gory Details471765 -Ref: table-sub-escapes473444 -Ref: table-sub-posix-92474798 -Ref: table-sub-proposed476141 -Ref: table-posix-sub477491 -Ref: table-gensub-escapes479037 -Ref: Gory Details-Footnote-1480244 -Ref: Gory Details-Footnote-2480295 -Node: I/O Functions480446 -Ref: I/O Functions-Footnote-1487101 -Node: Time Functions487248 -Ref: Time Functions-Footnote-1498140 -Ref: Time Functions-Footnote-2498208 -Ref: Time Functions-Footnote-3498366 -Ref: Time Functions-Footnote-4498477 -Ref: Time Functions-Footnote-5498589 -Ref: Time Functions-Footnote-6498816 -Node: Bitwise Functions499082 -Ref: table-bitwise-ops499640 -Ref: Bitwise Functions-Footnote-1503800 -Node: Type Functions503984 -Node: I18N Functions504454 -Node: User-defined506081 -Node: Definition Syntax506885 -Ref: Definition Syntax-Footnote-1511795 -Node: Function Example511864 -Node: Function Caveats514458 -Node: Calling A Function514879 -Node: Variable Scope515994 -Node: Pass By Value/Reference517969 -Node: Return Statement521409 -Node: Dynamic Typing524390 -Node: Indirect Calls525125 -Node: Internationalization534810 -Node: I18N and L10N536236 -Node: Explaining gettext536922 -Ref: Explaining gettext-Footnote-1541988 -Ref: Explaining gettext-Footnote-2542172 -Node: Programmer i18n542337 -Node: Translator i18n546537 -Node: String Extraction547330 -Ref: String Extraction-Footnote-1548291 -Node: Printf Ordering548377 -Ref: Printf Ordering-Footnote-1551161 -Node: I18N Portability551225 -Ref: I18N Portability-Footnote-1553674 -Node: I18N Example553737 -Ref: I18N Example-Footnote-1556372 -Node: Gawk I18N556444 -Node: Advanced Features557061 -Node: Nondecimal Data558574 -Node: Array Sorting560157 -Node: Controlling Array Traversal560854 -Node: Array Sorting Functions569091 -Ref: Array Sorting Functions-Footnote-1572765 -Ref: Array Sorting Functions-Footnote-2572858 -Node: Two-way I/O573052 -Ref: Two-way I/O-Footnote-1578484 -Node: TCP/IP Networking578554 -Node: Profiling581398 -Node: Library Functions588872 -Ref: Library Functions-Footnote-1591879 -Node: Library Names592050 -Ref: Library Names-Footnote-1595521 -Ref: Library Names-Footnote-2595741 -Node: General Functions595827 -Node: Strtonum Function596780 -Node: Assert Function599710 -Node: Round Function603036 -Node: Cliff Random Function604579 -Node: Ordinal Functions605595 -Ref: Ordinal Functions-Footnote-1608665 -Ref: Ordinal Functions-Footnote-2608917 -Node: Join Function609126 -Ref: Join Function-Footnote-1610897 -Node: Gettimeofday Function611097 -Node: Data File Management614812 -Node: Filetrans Function615444 -Node: Rewind Function619583 -Node: File Checking620970 -Node: Empty Files622064 -Node: Ignoring Assigns624294 -Node: Getopt Function625847 -Ref: Getopt Function-Footnote-1637151 -Node: Passwd Functions637354 -Ref: Passwd Functions-Footnote-1646329 -Node: Group Functions646417 -Node: Walking Arrays654501 -Node: Sample Programs656070 -Node: Running Examples656735 -Node: Clones657463 -Node: Cut Program658687 -Node: Egrep Program668532 -Ref: Egrep Program-Footnote-1676305 -Node: Id Program676415 -Node: Split Program680031 -Ref: Split Program-Footnote-1683550 -Node: Tee Program683678 -Node: Uniq Program686481 -Node: Wc Program693910 -Ref: Wc Program-Footnote-1698176 -Ref: Wc Program-Footnote-2698376 -Node: Miscellaneous Programs698468 -Node: Dupword Program699656 -Node: Alarm Program701687 -Node: Translate Program706436 -Ref: Translate Program-Footnote-1710823 -Ref: Translate Program-Footnote-2711051 -Node: Labels Program711185 -Ref: Labels Program-Footnote-1714556 -Node: Word Sorting714640 -Node: History Sorting718524 -Node: Extract Program720363 -Ref: Extract Program-Footnote-1727846 -Node: Simple Sed727974 -Node: Igawk Program731036 -Ref: Igawk Program-Footnote-1746193 -Ref: Igawk Program-Footnote-2746394 -Node: Anagram Program746532 -Node: Signature Program749600 -Node: Debugger750700 -Node: Debugging751611 -Node: Debugging Concepts752024 -Node: Debugging Terms753880 -Node: Awk Debugging756503 -Node: Sample dgawk session757395 -Node: dgawk invocation757887 -Node: Finding The Bug759069 -Node: List of Debugger Commands765555 -Node: Breakpoint Control766866 -Node: Dgawk Execution Control770502 -Node: Viewing And Changing Data773853 -Node: Dgawk Stack777190 -Node: Dgawk Info778650 -Node: Miscellaneous Dgawk Commands782598 -Node: Readline Support788026 -Node: Dgawk Limitations788864 -Node: Language History791053 -Node: V7/SVR3.1792565 -Node: SVR4794886 -Node: POSIX796328 -Node: BTL797336 -Node: POSIX/GNU798070 -Node: Common Extensions803221 -Node: Ranges and Locales804328 -Ref: Ranges and Locales-Footnote-1808932 -Node: Contributors809153 -Node: Installation813415 -Node: Gawk Distribution814309 -Node: Getting814793 -Node: Extracting815619 -Node: Distribution contents817311 -Node: Unix Installation822533 -Node: Quick Installation823150 -Node: Additional Configuration Options825112 -Node: Configuration Philosophy826589 -Node: Non-Unix Installation828931 -Node: PC Installation829389 -Node: PC Binary Installation830688 -Node: PC Compiling832536 -Node: PC Testing835480 -Node: PC Using836656 -Node: Cygwin840841 -Node: MSYS841841 -Node: VMS Installation842355 -Node: VMS Compilation842958 -Ref: VMS Compilation-Footnote-1843965 -Node: VMS Installation Details844023 -Node: VMS Running845658 -Node: VMS Old Gawk847265 -Node: Bugs847739 -Node: Other Versions851591 -Node: Notes856872 -Node: Compatibility Mode857564 -Node: Additions858347 -Node: Accessing The Source859159 -Node: Adding Code860584 -Node: New Ports866551 -Node: Dynamic Extensions870664 -Node: Internals872040 -Node: Plugin License881143 -Node: Sample Library881777 -Node: Internal File Description882463 -Node: Internal File Ops886178 -Ref: Internal File Ops-Footnote-1890959 -Node: Using Internal File Ops891099 -Node: Future Extensions893476 -Node: Basic Concepts895980 -Node: Basic High Level896737 -Ref: Basic High Level-Footnote-1900772 -Node: Basic Data Typing900957 -Node: Floating Point Issues905482 -Node: String Conversion Precision906565 -Ref: String Conversion Precision-Footnote-1908265 -Node: Unexpected Results908374 -Node: POSIX Floating Point Problems910200 -Ref: POSIX Floating Point Problems-Footnote-1913905 -Node: Glossary913943 -Node: Copying938919 -Node: GNU Free Documentation License976476 -Node: Index1001613 +Node: Foreword31758 +Node: Preface36103 +Ref: Preface-Footnote-139156 +Ref: Preface-Footnote-239262 +Node: History39494 +Node: Names41885 +Ref: Names-Footnote-143362 +Node: This Manual43434 +Ref: This Manual-Footnote-148372 +Node: Conventions48472 +Node: Manual History50606 +Ref: Manual History-Footnote-153876 +Ref: Manual History-Footnote-253917 +Node: How To Contribute53991 +Node: Acknowledgments55135 +Node: Getting Started59631 +Node: Running gawk62010 +Node: One-shot63196 +Node: Read Terminal64421 +Ref: Read Terminal-Footnote-166071 +Ref: Read Terminal-Footnote-266347 +Node: Long66518 +Node: Executable Scripts67894 +Ref: Executable Scripts-Footnote-169763 +Ref: Executable Scripts-Footnote-269865 +Node: Comments70412 +Node: Quoting72879 +Node: DOS Quoting77502 +Node: Sample Data Files78177 +Node: Very Simple81209 +Node: Two Rules85808 +Node: More Complex87955 +Ref: More Complex-Footnote-190885 +Node: Statements/Lines90970 +Ref: Statements/Lines-Footnote-195432 +Node: Other Features95697 +Node: When96625 +Node: Invoking Gawk98772 +Node: Command Line100233 +Node: Options101016 +Ref: Options-Footnote-1115658 +Node: Other Arguments115683 +Node: Naming Standard Input118341 +Node: Environment Variables119435 +Node: AWKPATH Variable119993 +Ref: AWKPATH Variable-Footnote-1122582 +Node: AWKLIBPATH Variable122842 +Node: Other Environment Variables123439 +Node: Exit Status125934 +Node: Include Files126609 +Node: Loading Shared Libraries130110 +Node: Obsolete131335 +Node: Undocumented132032 +Node: Regexp132275 +Node: Regexp Usage133664 +Node: Escape Sequences135690 +Node: Regexp Operators141453 +Ref: Regexp Operators-Footnote-1148833 +Ref: Regexp Operators-Footnote-2148980 +Node: Bracket Expressions149078 +Ref: table-char-classes150968 +Node: GNU Regexp Operators153491 +Node: Case-sensitivity157214 +Ref: Case-sensitivity-Footnote-1160182 +Ref: Case-sensitivity-Footnote-2160417 +Node: Leftmost Longest160525 +Node: Computed Regexps161726 +Node: Reading Files165136 +Node: Records167140 +Ref: Records-Footnote-1175814 +Node: Fields175851 +Ref: Fields-Footnote-1178884 +Node: Nonconstant Fields178970 +Node: Changing Fields181172 +Node: Field Separators187153 +Node: Default Field Splitting189782 +Node: Regexp Field Splitting190899 +Node: Single Character Fields194241 +Node: Command Line Field Separator195300 +Node: Field Splitting Summary198741 +Ref: Field Splitting Summary-Footnote-1201933 +Node: Constant Size202034 +Node: Splitting By Content206618 +Ref: Splitting By Content-Footnote-1210344 +Node: Multiple Line210384 +Ref: Multiple Line-Footnote-1216231 +Node: Getline216410 +Node: Plain Getline218626 +Node: Getline/Variable220715 +Node: Getline/File221856 +Node: Getline/Variable/File223178 +Ref: Getline/Variable/File-Footnote-1224777 +Node: Getline/Pipe224864 +Node: Getline/Variable/Pipe227424 +Node: Getline/Coprocess228531 +Node: Getline/Variable/Coprocess229774 +Node: Getline Notes230488 +Node: Getline Summary232430 +Ref: table-getline-variants232773 +Node: Read Timeout233629 +Ref: Read Timeout-Footnote-1237374 +Node: Command line directories237431 +Node: Printing238061 +Node: Print239692 +Node: Print Examples241029 +Node: Output Separators243813 +Node: OFMT245573 +Node: Printf246931 +Node: Basic Printf247837 +Node: Control Letters249376 +Node: Format Modifiers253188 +Node: Printf Examples259197 +Node: Redirection261912 +Node: Special Files268896 +Node: Special FD269429 +Ref: Special FD-Footnote-1273054 +Node: Special Network273128 +Node: Special Caveats273978 +Node: Close Files And Pipes274774 +Ref: Close Files And Pipes-Footnote-1281797 +Ref: Close Files And Pipes-Footnote-2281945 +Node: Expressions282095 +Node: Values283227 +Node: Constants283903 +Node: Scalar Constants284583 +Ref: Scalar Constants-Footnote-1285442 +Node: Nondecimal-numbers285624 +Node: Regexp Constants288683 +Node: Using Constant Regexps289158 +Node: Variables292213 +Node: Using Variables292868 +Node: Assignment Options294592 +Node: Conversion296464 +Ref: table-locale-affects301840 +Ref: Conversion-Footnote-1302464 +Node: All Operators302573 +Node: Arithmetic Ops303203 +Node: Concatenation305708 +Ref: Concatenation-Footnote-1308501 +Node: Assignment Ops308621 +Ref: table-assign-ops313609 +Node: Increment Ops315017 +Node: Truth Values and Conditions318487 +Node: Truth Values319570 +Node: Typing and Comparison320619 +Node: Variable Typing321408 +Ref: Variable Typing-Footnote-1325305 +Node: Comparison Operators325427 +Ref: table-relational-ops325837 +Node: POSIX String Comparison329386 +Ref: POSIX String Comparison-Footnote-1330342 +Node: Boolean Ops330480 +Ref: Boolean Ops-Footnote-1334558 +Node: Conditional Exp334649 +Node: Function Calls336381 +Node: Precedence339975 +Node: Locales343644 +Node: Patterns and Actions344733 +Node: Pattern Overview345787 +Node: Regexp Patterns347456 +Node: Expression Patterns347999 +Node: Ranges351684 +Node: BEGIN/END354650 +Node: Using BEGIN/END355412 +Ref: Using BEGIN/END-Footnote-1358143 +Node: I/O And BEGIN/END358249 +Node: BEGINFILE/ENDFILE360531 +Node: Empty363424 +Node: Using Shell Variables363740 +Node: Action Overview366025 +Node: Statements368382 +Node: If Statement370236 +Node: While Statement371735 +Node: Do Statement373779 +Node: For Statement374935 +Node: Switch Statement378087 +Node: Break Statement380184 +Node: Continue Statement382174 +Node: Next Statement383967 +Node: Nextfile Statement386357 +Node: Exit Statement388902 +Node: Built-in Variables391318 +Node: User-modified392413 +Ref: User-modified-Footnote-1400768 +Node: Auto-set400830 +Ref: Auto-set-Footnote-1410738 +Node: ARGC and ARGV410943 +Node: Arrays414794 +Node: Array Basics416299 +Node: Array Intro417125 +Node: Reference to Elements421443 +Node: Assigning Elements423713 +Node: Array Example424204 +Node: Scanning an Array425936 +Node: Controlling Scanning428250 +Ref: Controlling Scanning-Footnote-1433183 +Node: Delete433499 +Ref: Delete-Footnote-1435934 +Node: Numeric Array Subscripts435991 +Node: Uninitialized Subscripts438174 +Node: Multi-dimensional439802 +Node: Multi-scanning442896 +Node: Arrays of Arrays444487 +Node: Functions449132 +Node: Built-in449954 +Node: Calling Built-in451032 +Node: Numeric Functions453020 +Ref: Numeric Functions-Footnote-1456852 +Ref: Numeric Functions-Footnote-2457209 +Ref: Numeric Functions-Footnote-3457257 +Node: String Functions457526 +Ref: String Functions-Footnote-1481023 +Ref: String Functions-Footnote-2481152 +Ref: String Functions-Footnote-3481400 +Node: Gory Details481487 +Ref: table-sub-escapes483166 +Ref: table-sub-posix-92484520 +Ref: table-sub-proposed485863 +Ref: table-posix-sub487213 +Ref: table-gensub-escapes488759 +Ref: Gory Details-Footnote-1489966 +Ref: Gory Details-Footnote-2490017 +Node: I/O Functions490168 +Ref: I/O Functions-Footnote-1496823 +Node: Time Functions496970 +Ref: Time Functions-Footnote-1507862 +Ref: Time Functions-Footnote-2507930 +Ref: Time Functions-Footnote-3508088 +Ref: Time Functions-Footnote-4508199 +Ref: Time Functions-Footnote-5508311 +Ref: Time Functions-Footnote-6508538 +Node: Bitwise Functions508804 +Ref: table-bitwise-ops509362 +Ref: Bitwise Functions-Footnote-1513522 +Node: Type Functions513706 +Node: I18N Functions514176 +Node: User-defined515803 +Node: Definition Syntax516607 +Ref: Definition Syntax-Footnote-1521517 +Node: Function Example521586 +Node: Function Caveats524180 +Node: Calling A Function524601 +Node: Variable Scope525716 +Node: Pass By Value/Reference527691 +Node: Return Statement531131 +Node: Dynamic Typing534112 +Node: Indirect Calls534847 +Node: Internationalization544532 +Node: I18N and L10N545971 +Node: Explaining gettext546657 +Ref: Explaining gettext-Footnote-1551723 +Ref: Explaining gettext-Footnote-2551907 +Node: Programmer i18n552072 +Node: Translator i18n556272 +Node: String Extraction557065 +Ref: String Extraction-Footnote-1558026 +Node: Printf Ordering558112 +Ref: Printf Ordering-Footnote-1560896 +Node: I18N Portability560960 +Ref: I18N Portability-Footnote-1563409 +Node: I18N Example563472 +Ref: I18N Example-Footnote-1566107 +Node: Gawk I18N566179 +Node: Arbitrary Precision Arithmetic566796 +Ref: Arbitrary Precision Arithmetic-Footnote-1569671 +Node: Floating-point Programming569819 +Node: Floating-point Representation575089 +Node: Floating-point Context576193 +Ref: table-ieee-formats577028 +Node: Rounding Mode578398 +Ref: table-rounding-modes579025 +Ref: Rounding Mode-Footnote-1582148 +Node: Arbitrary Precision Floats582329 +Ref: Arbitrary Precision Floats-Footnote-1584370 +Node: Setting Precision584681 +Node: Setting Rounding Mode587439 +Node: Floating-point Constants588356 +Node: Changing Precision589775 +Ref: Changing Precision-Footnote-1591175 +Node: Exact Arithmetic591348 +Node: Integer Programming594361 +Node: Arbitrary Precision Integers596141 +Ref: Arbitrary Precision Integers-Footnote-1599165 +Node: MPFR and GMP Libraries599311 +Node: Advanced Features599696 +Node: Nondecimal Data601219 +Node: Array Sorting602802 +Node: Controlling Array Traversal603499 +Node: Array Sorting Functions611736 +Ref: Array Sorting Functions-Footnote-1615410 +Ref: Array Sorting Functions-Footnote-2615503 +Node: Two-way I/O615697 +Ref: Two-way I/O-Footnote-1621129 +Node: TCP/IP Networking621199 +Node: Profiling624043 +Node: Library Functions631497 +Ref: Library Functions-Footnote-1634504 +Node: Library Names634675 +Ref: Library Names-Footnote-1638146 +Ref: Library Names-Footnote-2638366 +Node: General Functions638452 +Node: Strtonum Function639405 +Node: Assert Function642335 +Node: Round Function645661 +Node: Cliff Random Function647204 +Node: Ordinal Functions648220 +Ref: Ordinal Functions-Footnote-1651290 +Ref: Ordinal Functions-Footnote-2651542 +Node: Join Function651751 +Ref: Join Function-Footnote-1653522 +Node: Gettimeofday Function653722 +Node: Data File Management657437 +Node: Filetrans Function658069 +Node: Rewind Function662208 +Node: File Checking663595 +Node: Empty Files664689 +Node: Ignoring Assigns666919 +Node: Getopt Function668472 +Ref: Getopt Function-Footnote-1679776 +Node: Passwd Functions679979 +Ref: Passwd Functions-Footnote-1688954 +Node: Group Functions689042 +Node: Walking Arrays697126 +Node: Sample Programs698695 +Node: Running Examples699360 +Node: Clones700088 +Node: Cut Program701312 +Node: Egrep Program711157 +Ref: Egrep Program-Footnote-1718930 +Node: Id Program719040 +Node: Split Program722656 +Ref: Split Program-Footnote-1726175 +Node: Tee Program726303 +Node: Uniq Program729106 +Node: Wc Program736535 +Ref: Wc Program-Footnote-1740801 +Ref: Wc Program-Footnote-2741001 +Node: Miscellaneous Programs741093 +Node: Dupword Program742281 +Node: Alarm Program744312 +Node: Translate Program749061 +Ref: Translate Program-Footnote-1753448 +Ref: Translate Program-Footnote-2753676 +Node: Labels Program753810 +Ref: Labels Program-Footnote-1757181 +Node: Word Sorting757265 +Node: History Sorting761149 +Node: Extract Program762988 +Ref: Extract Program-Footnote-1770471 +Node: Simple Sed770599 +Node: Igawk Program773661 +Ref: Igawk Program-Footnote-1788818 +Ref: Igawk Program-Footnote-2789019 +Node: Anagram Program789157 +Node: Signature Program792225 +Node: Debugger793325 +Node: Debugging794277 +Node: Debugging Concepts794710 +Node: Debugging Terms796566 +Node: Awk Debugging799163 +Node: Sample Debugging Session800055 +Node: Debugger Invocation800575 +Node: Finding The Bug801904 +Node: List of Debugger Commands808392 +Node: Breakpoint Control809726 +Node: Debugger Execution Control813390 +Node: Viewing And Changing Data816750 +Node: Execution Stack820106 +Node: Debugger Info821573 +Node: Miscellaneous Debugger Commands825554 +Node: Readline Support830999 +Node: Limitations831830 +Node: Language History834082 +Node: V7/SVR3.1835594 +Node: SVR4837915 +Node: POSIX839357 +Node: BTL840365 +Node: POSIX/GNU841099 +Node: Common Extensions846390 +Node: Ranges and Locales847497 +Ref: Ranges and Locales-Footnote-1852101 +Node: Contributors852322 +Node: Installation856583 +Node: Gawk Distribution857477 +Node: Getting857961 +Node: Extracting858787 +Node: Distribution contents860479 +Node: Unix Installation865701 +Node: Quick Installation866318 +Node: Additional Configuration Options868280 +Node: Configuration Philosophy869757 +Node: Non-Unix Installation872099 +Node: PC Installation872557 +Node: PC Binary Installation873856 +Node: PC Compiling875704 +Node: PC Testing878648 +Node: PC Using879824 +Node: Cygwin884009 +Node: MSYS885009 +Node: VMS Installation885523 +Node: VMS Compilation886126 +Ref: VMS Compilation-Footnote-1887133 +Node: VMS Installation Details887191 +Node: VMS Running888826 +Node: VMS Old Gawk890433 +Node: Bugs890907 +Node: Other Versions894759 +Node: Notes900074 +Node: Compatibility Mode900766 +Node: Additions901549 +Node: Accessing The Source902361 +Node: Adding Code903786 +Node: New Ports909753 +Node: Dynamic Extensions913866 +Node: Internals915306 +Node: Plugin License924128 +Node: Loading Extensions924766 +Node: Sample Library926605 +Node: Internal File Description927295 +Node: Internal File Ops931010 +Ref: Internal File Ops-Footnote-1935752 +Node: Using Internal File Ops935892 +Node: Future Extensions938269 +Node: Basic Concepts940773 +Node: Basic High Level941530 +Ref: Basic High Level-Footnote-1945565 +Node: Basic Data Typing945750 +Node: Floating Point Issues950275 +Node: String Conversion Precision951358 +Ref: String Conversion Precision-Footnote-1953058 +Node: Unexpected Results953167 +Node: POSIX Floating Point Problems954993 +Ref: POSIX Floating Point Problems-Footnote-1958698 +Node: Glossary958736 +Node: Copying983712 +Node: GNU Free Documentation License1021269 +Node: Index1046406 End Tag Table |