diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2011-03-30 23:25:17 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2011-03-30 23:25:17 +0200 |
commit | 089e787a5a970f8005cf4ee34b152bf1747b14b0 (patch) | |
tree | 0d4783a31e782e02b429d5715d149a5e3df3b813 | |
parent | 0a4c1c5344b5d6c1750708675901509210497761 (diff) | |
download | egawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.tar.gz egawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.tar.bz2 egawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.zip |
More documentation edits.
-rw-r--r-- | awklib/eg/prog/alarm.awk | 2 | ||||
-rw-r--r-- | awklib/eg/prog/cut.awk | 4 | ||||
-rw-r--r-- | awklib/eg/prog/igawk.sh | 2 | ||||
-rw-r--r-- | awklib/eg/prog/uniq.awk | 4 | ||||
-rw-r--r-- | doc/gawk.1 | 2 | ||||
-rw-r--r-- | doc/gawk.info | 635 | ||||
-rw-r--r-- | doc/gawk.texi | 160 |
7 files changed, 424 insertions, 385 deletions
diff --git a/awklib/eg/prog/alarm.awk b/awklib/eg/prog/alarm.awk index 2510c787..53563d15 100644 --- a/awklib/eg/prog/alarm.awk +++ b/awklib/eg/prog/alarm.awk @@ -30,7 +30,7 @@ BEGIN \ message = ARGV[2] break default: - if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]][[:digit:]]/) { + if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]]{2}/) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 diff --git a/awklib/eg/prog/cut.awk b/awklib/eg/prog/cut.awk index 91a13a4e..fb4717c1 100644 --- a/awklib/eg/prog/cut.awk +++ b/awklib/eg/prog/cut.awk @@ -10,7 +10,7 @@ # # -s Suppress lines without the delimiter # -# Requires getopt and join library functions +# Requires getopt() and join() library functions function usage( e1, e2) { @@ -96,7 +96,7 @@ function set_charlist( field, i, j, f, g, t, if (index(f[i], "-") != 0) { # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { - printf("bad bracket expression: %s\n", + printf("bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 } diff --git a/awklib/eg/prog/igawk.sh b/awklib/eg/prog/igawk.sh index 6657e5d8..bd9d9ac8 100644 --- a/awklib/eg/prog/igawk.sh +++ b/awklib/eg/prog/igawk.sh @@ -128,7 +128,7 @@ BEGIN { } }' # close quote ends `expand_prog' variable -processed_program=$(gawk -- "$expand_prog" /dev/stdin <<EOF +processed_program=$(gawk -- "$expand_prog" /dev/stdin << EOF $program EOF ) diff --git a/awklib/eg/prog/uniq.awk b/awklib/eg/prog/uniq.awk index 07d9b9e8..990387ac 100644 --- a/awklib/eg/prog/uniq.awk +++ b/awklib/eg/prog/uniq.awk @@ -33,7 +33,7 @@ BEGIN \ else if (index("0123456789", c) != 0) { # getopt requires args to options # this messes us up for things like -5 - if (Optarg ~ /^[0-9]+$/) + if (Optarg ~ /^[[:digit:]]+$/) fcount = (c Optarg) + 0 else { fcount = c + 0 @@ -43,7 +43,7 @@ BEGIN \ usage() } - if (ARGV[Optind] ~ /^\+[0-9]+$/) { + if (ARGV[Optind] ~ /^\+[[:digit:]]+$/) { charcount = substr(ARGV[Optind], 2) + 0 Optind++ } @@ -14,7 +14,7 @@ . if \w'\(rq' .ds rq "\(rq . \} .\} -.TH GAWK 1 "Jan 31 2011" "Free Software Foundation" "Utility Commands" +.TH GAWK 1 "Mar 29 2011" "Free Software Foundation" "Utility Commands" .SH NAME gawk \- pattern scanning and processing language .SH SYNOPSIS diff --git a/doc/gawk.info b/doc/gawk.info index f084fa3f..70091258 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11820,7 +11820,7 @@ to the standard output and interprets the current time according to the format specifiers in the string. For example: $ date '+Today is %A, %B %d, %Y.' - -| Today is Wednesday, December 01, 2010. + -| Today is Wednesday, March 30, 2011. Here is the `gawk' version of the `date' utility. It has a shell "wrapper" to handle the `-u' option, which requires that `date' run as @@ -15942,7 +15942,7 @@ supplied: # # -s Suppress lines without the delimiter # - # Requires getopt and join library functions + # Requires getopt() and join() library functions function usage( e1, e2) { @@ -16061,7 +16061,7 @@ splitting: The `set_charlist()' function is more complicated than `set_fieldlist()'. The idea here is to use `gawk''s `FIELDWIDTHS' variable (*note Constant Size::), which describes constant-width input. -When using a bracket expression, that is exactly what we have. +When using a character list, that is exactly what we have. Setting up `FIELDWIDTHS' is more complicated than simply listing the fields that need to be printed. We have to keep track of the fields to @@ -16084,7 +16084,7 @@ filler fields: if (index(f[i], "-") != 0) { # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) { - printf("bad bracket expression: %s\n", + printf("bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 } @@ -16271,9 +16271,9 @@ since it is not necessary with `gawk': The `beginfile()' function is called by the rule in `ftrans.awk' when each new file is processed. In this case, it is very simple; all it does is initialize a variable `fcount' to zero. `fcount' tracks how -many lines in the current file matched the pattern (naming the -parameter `junk' shows we know that `beginfile' is called with a -parameter, but that we're not interested in its value): +many lines in the current file matched the pattern. Naming the +parameter `junk' shows we know that `beginfile()' is called with a +parameter, but that we're not interested in its value: function beginfile(junk) { @@ -16750,7 +16750,7 @@ standard output, `/dev/stdout': # uniq.awk --- do uniq in awk # # Requires getopt() and join() library functions - # + function usage( e) { e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" @@ -16779,7 +16779,7 @@ standard output, `/dev/stdout': else if (index("0123456789", c) != 0) { # getopt requires args to options # this messes us up for things like -5 - if (Optarg ~ /^[0-9]+$/) + if (Optarg ~ /^[[:digit:]]+$/) fcount = (c Optarg) + 0 else { fcount = c + 0 @@ -16789,7 +16789,7 @@ standard output, `/dev/stdout': usage() } - if (ARGV[Optind] ~ /^\+[0-9]+$/) { + if (ARGV[Optind] ~ /^\+[[:digit:]]+$/) { charcount = substr(ARGV[Optind], 2) + 0 Optind++ } @@ -17009,12 +17009,12 @@ those numbers for the file that was just read. It relies on } There is one rule that is executed for each line. It adds the length -of the record, plus one, to `chars'. Adding one plus the record length -is needed because the newline character separating records (the value -of `RS') is not part of the record itself, and thus not included in its -length. Next, `lines' is incremented for each line read, and `words' -is incremented by the value of `NF', which is the number of "words" on -this line: +of the record, plus one, to `chars'.(2) Adding one plus the record +length is needed because the newline character separating records (the +value of `RS') is not part of the record itself, and thus not included +in its length. Next, `lines' is incremented for each line read, and +`words' is incremented by the value of `NF', which is the number of +"words" on this line: # do per line { @@ -17043,6 +17043,9 @@ this line: examine the code in *note Filetrans Function::, you will see that `FNR' has already been reset by the time `endfile()' is called. + (2) Since `gawk' understands multibyte locales, this code counts +characters, not bytes. + File: gawk.info, Node: Miscellaneous Programs, Prev: Clones, Up: Sample Programs @@ -17174,7 +17177,7 @@ Statement::), but the processing could be done with a series of message = ARGV[2] break default: - if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]][[:digit:]]/) { + if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]]{2}/) { print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 @@ -17281,7 +17284,7 @@ most of the job. standard `awk': dealing with individual characters is very painful, requiring repeated use of the `substr()', `index()', and `gsub()' built-in functions (*note String Functions::).(2) There are two -functions. The first, `stranslate', takes three arguments: +functions. The first, `stranslate()', takes three arguments: `from' A list of characters from which to translate. @@ -17298,12 +17301,12 @@ simple loop goes through `from', one character at a time. For each character in `from', if the character appears in `target', it is replaced with the corresponding `to' character. - The `translate' function simply calls `stranslate' using `$0' as the -target. The main program sets two global variables, `FROM' and `TO', -from the command line, and then changes `ARGV' so that `awk' reads from -the standard input. + The `translate()' function simply calls `stranslate()' using `$0' as +the target. The main program sets two global variables, `FROM' and +`TO', from the command line, and then changes `ARGV' so that `awk' +reads from the standard input. - Finally, the processing rule simply calls `translate' for each + Finally, the processing rule simply calls `translate()' for each record: # translate.awk --- do tr-like stuff @@ -17500,6 +17503,7 @@ a useful format. At first glance, a program like this would seem to do the job: # Print list of word frequencies + { for (i = 1; i <= NF; i++) freq[$i]++ @@ -17614,6 +17618,7 @@ encountered. The `END' rule simply prints out the lines, in order: # histsort.awk --- compact a shell history file # Thanks to Byron Rakitzis for the general idea + { if (data[$0]++ == 0) lines[++count] = $0 @@ -17812,7 +17817,7 @@ sample source file (as has been done here!) without any hassle. The file is only closed when a new data file name is encountered or at the end of the input file. - Finally, the function `unexpected_eof' prints an appropriate error + Finally, the function `unexpected_eof()' prints an appropriate error message and then exits. The `END' rule handles the final cleanup, closing the open file: @@ -18210,7 +18215,7 @@ zero, the program is done: } }' # close quote ends `expand_prog' variable - processed_program=$(gawk -- "$expand_prog" /dev/stdin <<EOF + processed_program=$(gawk -- "$expand_prog" /dev/stdin << EOF $program EOF ) @@ -18313,11 +18318,10 @@ File: gawk.info, Node: Anagram Program, Next: Signature Program, Prev: Igawk 13.3.10 Finding Anagrams From A Dictionary ------------------------------------------ -An interesting programming challenge is to read a word list (such as -`/usr/share/dict/words' on many GNU/Linux systems) and find words that -are "anagrams" of each other. One word is an anagram of another if -both words contain the same letters (for example, "babbling" and -"blabbing"). +An interesting programming challenge is to search for "anagrams" in a +word list (such as `/usr/share/dict/words' on many GNU/Linux systems). +One word is an anagram of another if both words contain the same letters +(for example, "babbling" and "blabbing"). An elegant algorithm is presented in Column 2, Problem C of Jon Bentley's `Programming Pearls', second edition. The idea is to give @@ -18405,9 +18409,8 @@ File: gawk.info, Node: Signature Program, Prev: Anagram Program, Up: Miscella -------------------------------------------------- The following program was written by Davide Brini and is published on -his website (http://backreference.org/2011/02/03/obfuscated-awk/). - - It serves as his signature in the Usenet group `comp.lang.awk'. He +his website (http://backreference.org/2011/02/03/obfuscated-awk/). It +serves as his signature in the Usenet group `comp.lang.awk'. He supplies the following copyright terms: Copyright (C) 2008 Davide Brini @@ -18455,6 +18458,9 @@ File: gawk.info, Node: Debugging, Next: Sample dgawk session, Up: Debugger 14.1 Introduction to `dgawk' ============================ +This minor node introduces debugging in general and begins the +discussion of debugging in `gawk'. + * Menu: * Debugging Concepts:: Debugging In General. @@ -18489,7 +18495,7 @@ you can expect at least the following: * The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that - effects what happens afterwards. (This often includes the ability + affects what happens afterwards. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -18509,6 +18515,8 @@ File: gawk.info, Node: Debugging Terms, Next: Awk Debugging, Prev: Debugging 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 thoughout the rest of this major +node. "Stack Frame" Programs generally call functions during the course of their @@ -18657,7 +18665,7 @@ To set the breakpoint, use the `b' (breakpoint) command: 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 the first time: +breakpoint for the first time: dgawk> r -| Starting program: @@ -18722,8 +18730,8 @@ for `NR == 1': Everything we have done so far has verified that the program has worked as planned, up to and including the call to `are_equal()', so the problem must be inside this function. To investigate further, we -have to begin "stepping through" the lines of `are_equal()'. We start -by typing `n' (for "next"): +must begin "stepping through" the lines of `are_equal()'. We start by +typing `n' (for "next"): dgawk> n -| 67 if (fcount > 0) { @@ -18881,11 +18889,14 @@ controlling breakpoints are: Set a breakpoint at entry to (the first instruction of) function FUNCTION. + Each breakpoint is assigned a number which can be used to delete + it from the breakpoint list using the `delete' command. + With a breakpoint, you may also supply a condition. This is an - `awk' expression that `dgawk' 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. + `awk' expression (enclosed in double quotes) that `dgawk' + 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. `clear' [[FILENAME`:']N | FUNCTION] Without any argument, delete any breakpoint at the next instruction @@ -18923,8 +18934,8 @@ controlling breakpoints are: Disable specified breakpoints or a range of breakpoints. Without any argument, disables all breakpoints. -`enable' [`once' | `del'] [N1 N2 ...] [N-M] -`e' [`once' | `del'] [N1 N2 ...] [N-M] +`enable' [`del' | `once'] [N1 N2 ...] [N-M] +`e' [`del' | `once'] [N1 N2 ...] [N-M] Enable specified breakpoints or a range of breakpoints. Without any argument, enables all breakpoints. Optionally, you can specify how to enable the breakpoint: @@ -19110,10 +19121,10 @@ AWK STATEMENTS from the watch list using the `unwatch' command. With a watchpoint, you may also supply a condition. This is an - `awk' expression that `dgawk' 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. + `awk' expression (enclosed in double quotes) that `dgawk' + 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. `undisplay' [N] Remove item number N (or all items, if no argument) from the @@ -19343,8 +19354,8 @@ categories, as follows: 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] +`list' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION] +`l' [`-' | `+' | N | FILENAME`:'N | N-M | FUNCTION] Print the specified lines (default 15) from the current source file or the file named FILENAME. The possible arguments to `list' are as follows: @@ -19359,7 +19370,7 @@ categories, as follows: N Print lines centered around line number N. - N--M + N-M Print lines from N to M. FILENAME`:'N @@ -19396,8 +19407,8 @@ File: gawk.info, Node: Readline Support, Next: Dgawk Limitations, Prev: List ===================== If `dgawk' is compiled with the `readline' library, you can take -advantage of its command completion and history expansion features. The -following types of completion are available: +advantage of that library's command completion and history expansion +features. The following types of completion are available: Command completion Command names. @@ -19446,10 +19457,9 @@ limitations. A few which are worth being aware of are: debugging stage and then change back to obscure, perhaps more optimal code later. - * There is no way right now to look "inside" the process of compiling - regular expressions to see if you got it right. As an `awk' - programmer, you are expected to know what `/[^[:alnum:][:blank:]]/' - means. + * There is no way to look "inside" the process of compiling regular + 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 @@ -19457,6 +19467,8 @@ limitations. A few which are worth being aware of are: 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. + 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 yourself! @@ -19471,11 +19483,11 @@ This Info file describes the GNU implementation of `awk', which follows the POSIX specification. Many long-time `awk' users learned `awk' programming with the original `awk' implementation in Version 7 Unix. (This implementation was the basis for `awk' in Berkeley Unix, through -4.3-Reno. Subsequent versions of Berkeley Unix, and systems derived -from 4.4BSD-Lite, use various versions of `gawk' for their `awk'.) -This major node briefly describes the evolution of the `awk' language, -with cross-references to other parts of the Info file where you can -find more information. +4.3-Reno. Subsequent versions of Berkeley Unix, and some systems +derived from 4.4BSD-Lite, use various versions of `gawk' for their +`awk'.) This major node briefly describes the evolution of the `awk' +language, with cross-references to other parts of the Info file where +you can find more information. * Menu: @@ -19524,7 +19536,7 @@ the changes, with cross-references to further details: * The `ARGC', `ARGV', `FNR', `RLENGTH', `RSTART', and `SUBSEP' built-in variables (*note Built-in Variables::). - * Assignable `$0'. + * Assignable `$0' (*note Changing Fields::). * The conditional expression using the ternary operator `?:' (*note Conditional Exp::). @@ -19615,8 +19627,8 @@ introduced the following changes into the language: * The concept of a numeric string and tighter comparison rules to go with it (*note Typing and Comparison::). - * The use of built-in variables as function names is forbidden - (*note Definition Syntax::. + * The use of built-in variables as function parameter names is + forbidden (*note Definition Syntax::. * More complete documentation of many of the previously undocumented features of the language. @@ -19669,7 +19681,7 @@ the current version of `gawk'. * Additional built-in variables: - The `ARGIND' `BINMODE', `ERRNO', `FIELDWIDTHS', `FPAT', - `IGNORECASE', `LINT', `PROCINFO', `TEXTDOMAIN', and `RT' + `IGNORECASE', `LINT', `PROCINFO', `RT', and `TEXTDOMAIN' variables (*note Built-in Variables::). * Special files in I/O redirections: @@ -19685,8 +19697,7 @@ the current version of `gawk'. - The `\x' escape sequence (*note Escape Sequences::). - - Full support for both POSIX and GNU regexps, with interval - expressions being matched by default. (*note Regexp::). + - Full support for both POSIX and GNU regexps (*note Regexp::). - The ability for `FS' and for the third argument to `split()' to be null strings (*note Single Character Fields::). @@ -19722,8 +19733,7 @@ the current version of `gawk'. one end of a two-way pipe to a coprocess (*note Two-way I/O::). - - POSIX compliance for `gsub()' and `sub()' (*note Gory - Details::). + - POSIX compliance for `gsub()' and `sub()'. - The `length()' function accepts an array argument and returns the number of elements in the array (*note String @@ -19742,8 +19752,8 @@ the current version of `gawk'. * Additional functions only in `gawk': - - The `and()', `or()', `xor()', `compl()', `lshift()', and - `rshift()', functions for bit manipulation (*note Bitwise + - The `and()', `compl()', `lshift()', `or()', `rshift()', and + `xor()' functions for bit manipulation (*note Bitwise Functions::). - The `asort()' and `asorti()' functions for sorting arrays @@ -19777,27 +19787,27 @@ the current version of `gawk'. `--use-lc-numeric' options (*note Options::). * Support for the following obsolete systems was removed from the - code and the documentation: + code and the documentation for `gawk' version 4.0: - - Amiga. + - Amiga - - Atari. + - Atari - - BeOS. + - BeOS - - Cray. + - Cray - - MIPS RiscOS. + - MIPS RiscOS - - MS-DOS with the Microsoft Compiler. + - MS-DOS with the Microsoft Compiler - - MS-Windows with the Microsoft Compiler. + - MS-Windows with the Microsoft Compiler - - NeXT. + - NeXT - - SunOS 3.x, Sun 386 (Road Runner). + - SunOS 3.x, Sun 386 (Road Runner) - - Tandem (non-POSIX). + - Tandem (non-POSIX) @@ -19807,7 +19817,7 @@ File: gawk.info, Node: Common Extensions, Next: Contributors, Prev: POSIX/GNU A.6 Common Extensions Summary ============================= -This minor node summarizes the common exceptions supported by `gawk', +This minor node summarizes the common extensions supported by `gawk', Brian Kernighan's `awk', and `mawk', the three most widely-used freely available versions of `awk' (*note Other Versions::). @@ -19868,6 +19878,7 @@ Info file, in approximate chronological order: * Pat Rankin provided the VMS port and its documentation. * Hal Peterson provided help in porting `gawk' to Cray systems. + (This is no longer supported.) * Kai Uwe Rommel provided the initial port to OS/2 and its documentation. @@ -19913,8 +19924,8 @@ Info file, in approximate chronological order: Automake and GNU `gettext'. * Alan J. Broder provided the initial version of the `asort()' - function as well as the code for the new optional third argument - to the `match()' function. + function as well as the code for the optional third argument to the + `match()' function. * Andreas Buening updated the `gawk' port for OS/2. @@ -19930,6 +19941,8 @@ Info file, in approximate chronological order: * John Haque reworked the `gawk' internals to use a byte-code engine, providing the `dgawk' debugger for `awk' programs. + * Efraim Yawitz contributed the original text for *note Debugger::. + * Arnold Robbins has been working on `gawk' since 1988, at first helping David Trueman, and as the primary maintainer since around 1994. @@ -24529,7 +24542,7 @@ Index * ampersand (&), && operator: Boolean Ops. (line 57) * ampersand (&), gsub()/gensub()/sub() functions and: Gory Details. (line 6) -* anagram.awk program: Anagram Program. (line 23) +* anagram.awk program: Anagram Program. (line 22) * AND bitwise operation: Bitwise Functions. (line 6) * and Boolean-logic operator: Boolean Ops. (line 6) * and() function (gawk): Bitwise Functions. (line 39) @@ -24750,7 +24763,7 @@ Index * BEGINFILE pattern, Boolean patterns and: Expression Patterns. (line 73) * beginfile() user-defined function: Filetrans Function. (line 62) -* Benzinger, Michael: Contributors. (line 94) +* Benzinger, Michael: Contributors. (line 95) * Berry, Karl: Acknowledgments. (line 33) * binary input/output: User-modified. (line 10) * bindtextdomain() function (C library): Explaining gettext. (line 49) @@ -24795,12 +24808,12 @@ Index * Brennan, Michael: Delete. (line 52) * Brian Kernighan's awk, extensions <1>: Other Versions. (line 13) * Brian Kernighan's awk, extensions: BTL. (line 6) -* Broder, Alan J.: Contributors. (line 85) -* Brown, Martin: Contributors. (line 79) +* Broder, Alan J.: Contributors. (line 86) +* Brown, Martin: Contributors. (line 80) * BSD-based operating systems: Glossary. (line 594) * bt debugger command (alias for backtrace): Dgawk Stack. (line 13) * Buening, Andreas <1>: Bugs. (line 71) -* Buening, Andreas <2>: Contributors. (line 89) +* Buening, Andreas <2>: Contributors. (line 90) * Buening, Andreas: Acknowledgments. (line 60) * buffering, input/output <1>: Two-way I/O. (line 70) * buffering, input/output: I/O Functions. (line 130) @@ -24850,7 +24863,7 @@ Index * chdir() function, implementing in gawk: Sample Library. (line 6) * chem utility: Glossary. (line 147) * chr() user-defined function: Ordinal Functions. (line 16) -* clear debugger command: Breakpoint Control. (line 33) +* clear debugger command: Breakpoint Control. (line 36) * Cliff random numbers: Cliff Random Function. (line 6) * cliff_rand() user-defined function: Cliff Random Function. @@ -24933,7 +24946,7 @@ Index * complement, bitwise: Bitwise Functions. (line 25) * compound statements, control statements and: Statements. (line 10) * concatenating: Concatenation. (line 9) -* condition debugger command: Breakpoint Control. (line 51) +* condition debugger command: Breakpoint Control. (line 54) * conditional expressions: Conditional Exp. (line 6) * configuration option, --disable-lint: Additional Configuration Options. (line 13) @@ -24975,7 +24988,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 60) +* d debugger command (alias for delete): Breakpoint Control. (line 63) * d.c., See dark corner: Conventions. (line 38) * dark corner <1>: Glossary. (line 189) * dark corner <2>: Truth Values. (line 24) @@ -25027,7 +25040,7 @@ Index * dates, converting to timestamps: Time Functions. (line 74) * dates, information related to, localization: Explaining gettext. (line 115) -* Davies, Stephen <1>: Contributors. (line 71) +* Davies, Stephen <1>: Contributors. (line 72) * Davies, Stephen: Acknowledgments. (line 60) * dcgettext() function (gawk) <1>: Programmer i18n. (line 19) * dcgettext() function (gawk): I18N Functions. (line 22) @@ -25044,22 +25057,22 @@ Index * debugger commands, bt (backtrace): Dgawk Stack. (line 13) * debugger commands, c (continue): Dgawk Execution Control. (line 33) -* debugger commands, clear: Breakpoint Control. (line 33) +* debugger commands, clear: Breakpoint Control. (line 36) * debugger commands, commands: Dgawk Execution Control. (line 10) -* debugger commands, condition: Breakpoint Control. (line 51) +* debugger commands, condition: Breakpoint Control. (line 54) * debugger commands, continue: Dgawk Execution Control. (line 33) -* debugger commands, d (delete): Breakpoint Control. (line 60) -* debugger commands, delete: Breakpoint Control. (line 60) -* debugger commands, disable: Breakpoint Control. (line 65) +* debugger commands, d (delete): Breakpoint Control. (line 63) +* debugger commands, delete: Breakpoint Control. (line 63) +* debugger commands, disable: Breakpoint Control. (line 68) * debugger commands, display: Viewing And Changing Data. (line 8) * debugger commands, down: Dgawk Stack. (line 21) * debugger commands, dump: Miscellaneous Dgawk Commands. (line 9) -* debugger commands, e (enable): Breakpoint Control. (line 69) -* debugger commands, enable: Breakpoint Control. (line 69) +* debugger commands, e (enable): Breakpoint Control. (line 72) +* debugger commands, enable: Breakpoint Control. (line 72) * debugger commands, end: Dgawk Execution Control. (line 10) * debugger commands, eval: Viewing And Changing Data. @@ -25073,7 +25086,7 @@ Index * debugger commands, help: Miscellaneous Dgawk Commands. (line 68) * debugger commands, i (info): Dgawk Info. (line 12) -* debugger commands, ignore: Breakpoint Control. (line 83) +* debugger commands, ignore: Breakpoint Control. (line 86) * debugger commands, info: Dgawk Info. (line 12) * debugger commands, l (list): Miscellaneous Dgawk Commands. (line 74) @@ -25117,8 +25130,8 @@ Index (line 68) * debugger commands, stepi: Dgawk Execution Control. (line 76) -* debugger commands, t (tbreak): Breakpoint Control. (line 86) -* debugger commands, tbreak: Breakpoint Control. (line 86) +* debugger commands, t (tbreak): Breakpoint Control. (line 89) +* debugger commands, tbreak: Breakpoint Control. (line 89) * debugger commands, trace: Miscellaneous Dgawk Commands. (line 110) * debugger commands, u (until): Dgawk Execution Control. @@ -25139,9 +25152,9 @@ Index * decrement operators: Increment Ops. (line 35) * default keyword: Switch Statement. (line 6) * Deifik, Scott <1>: Bugs. (line 70) -* Deifik, Scott <2>: Contributors. (line 53) +* Deifik, Scott <2>: Contributors. (line 54) * Deifik, Scott: Acknowledgments. (line 60) -* delete debugger command: Breakpoint Control. (line 60) +* delete debugger command: Breakpoint Control. (line 63) * delete statement: Delete. (line 6) * deleting elements in arrays: Delete. (line 6) * deleting entire arrays: Delete. (line 39) @@ -25216,7 +25229,7 @@ Index (line 6) * directories, searching <1>: Igawk Program. (line 364) * directories, searching: AWKPATH Variable. (line 6) -* disable debugger command: Breakpoint Control. (line 65) +* disable debugger command: Breakpoint Control. (line 68) * display debugger command: Viewing And Changing Data. (line 8) * division: Arithmetic Ops. (line 44) @@ -25241,7 +25254,7 @@ Index (line 9) * dupnode() internal function: Internals. (line 96) * dupword.awk program: Dupword Program. (line 31) -* e debugger command (alias for enable): Breakpoint Control. (line 69) +* e debugger command (alias for enable): Breakpoint Control. (line 72) * EBCDIC: Ordinal Functions. (line 45) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 23) @@ -25257,7 +25270,7 @@ Index * empty pattern: Empty. (line 6) * empty strings, See null strings: Regexp Field Splitting. (line 43) -* enable debugger command: Breakpoint Control. (line 69) +* enable debugger command: Breakpoint Control. (line 72) * end debugger command: Dgawk Execution Control. (line 10) * END pattern: BEGIN/END. (line 6) @@ -25470,7 +25483,7 @@ Index * files, Texinfo, extracting programs from: Extract Program. (line 6) * finish debugger command: Dgawk Execution Control. (line 39) -* Fish, Fred: Contributors. (line 50) +* 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) @@ -25736,7 +25749,7 @@ Index * GPL (General Public License): Manual History. (line 11) * GPL (General Public License), printing: Options. (line 85) * grcat program: Group Functions. (line 16) -* Grigera, Juan: Contributors. (line 55) +* Grigera, Juan: Contributors. (line 56) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) * groups, information about: Group Functions. (line 6) @@ -25747,13 +25760,13 @@ Index * gsub() function, escape processing: Gory Details. (line 6) * h debugger command (alias for help): Miscellaneous Dgawk Commands. (line 68) -* Hankerson, Darrel <1>: Contributors. (line 58) +* Hankerson, Darrel <1>: Contributors. (line 59) * Hankerson, Darrel: Acknowledgments. (line 60) -* Haque, John <1>: Contributors. (line 100) +* Haque, John <1>: Contributors. (line 101) * Haque, John: Acknowledgments. (line 60) * Hartholz, Elaine: Acknowledgments. (line 38) * Hartholz, Marshall: Acknowledgments. (line 38) -* Hasegawa, Isamu: Contributors. (line 91) +* Hasegawa, Isamu: Contributors. (line 92) * help debugger command: Miscellaneous Dgawk Commands. (line 68) * hexadecimal numbers: Nondecimal-numbers. (line 6) @@ -25775,7 +25788,7 @@ Index * 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 83) +* ignore debugger command: Breakpoint Control. (line 86) * IGNORECASE variable <1>: String Functions. (line 29) * IGNORECASE variable <2>: Array Sorting. (line 68) * IGNORECASE variable <3>: Array Intro. (line 92) @@ -25891,13 +25904,13 @@ Index * ISO 8859-1: Glossary. (line 137) * ISO Latin-1: Glossary. (line 137) * Jacobs, Andrew: Passwd Functions. (line 90) -* Jaegermann, Michal <1>: Contributors. (line 45) +* Jaegermann, Michal <1>: Contributors. (line 46) * Jaegermann, Michal: Acknowledgments. (line 60) * Java implementation of awk: Other Versions. (line 96) * jawk: Other Versions. (line 96) * Jedi knights: Undocumented. (line 6) * join() user-defined function: Join Function. (line 18) -* Kahrs, Ju"rgen <1>: Contributors. (line 67) +* Kahrs, Ju"rgen <1>: Contributors. (line 68) * Kahrs, Ju"rgen: Acknowledgments. (line 60) * Kasal, Stepan: Acknowledgments. (line 60) * Kenobi, Obi-Wan: Undocumented. (line 6) @@ -26029,7 +26042,7 @@ Index * matching, leftmost longest: Multiple Line. (line 26) * matching, null strings: Gory Details. (line 96) * mawk program: Other Versions. (line 35) -* McPhee, Patrick: Contributors. (line 97) +* McPhee, Patrick: Contributors. (line 98) * memory, releasing: Internals. (line 101) * message object files: Explaining gettext. (line 41) * message object files, converting from portable object files: I18N Example. @@ -26244,7 +26257,7 @@ Index * percent sign (%), %= operator: Assignment Ops. (line 129) * period (.): Regexp Operators. (line 43) * Perl: Future Extensions. (line 6) -* Peters, Arno: Contributors. (line 82) +* Peters, Arno: Contributors. (line 83) * Peterson, Hal: Contributors. (line 40) * pgawk program: Profiling. (line 6) * pgawk program, awkprof.out file: Profiling. (line 10) @@ -26536,7 +26549,7 @@ Index * RLENGTH variable, match() function and: String Functions. (line 205) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 32) -* Robbins, Arnold <3>: Contributors. (line 103) +* Robbins, Arnold <3>: Contributors. (line 106) * Robbins, Arnold <4>: Alarm Program. (line 6) * Robbins, Arnold <5>: Passwd Functions. (line 90) * Robbins, Arnold <6>: Getline/Pipe. (line 36) @@ -26550,7 +26563,7 @@ Index * Robbins, Miriam: Acknowledgments. (line 81) * Robinson, Will: Dynamic Extensions. (line 6) * robot, the: Dynamic Extensions. (line 6) -* Rommel, Kai Uwe: Contributors. (line 42) +* Rommel, Kai Uwe: Contributors. (line 43) * round() user-defined function: Round Function. (line 16) * rounding numbers: Round Function. (line 6) * RS variable <1>: User-modified. (line 134) @@ -26655,7 +26668,7 @@ Index * sleep utility: Alarm Program. (line 109) * Solaris, POSIX-compliant awk: Other Versions. (line 86) * sort function, arrays, sorting: Array Sorting. (line 6) -* sort utility: Word Sorting. (line 49) +* sort utility: Word Sorting. (line 50) * sort utility, coprocesses and: Two-way I/O. (line 83) * sorting characters in different languages: Explaining gettext. (line 93) @@ -26755,8 +26768,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 86) -* tbreak debugger command: Breakpoint Control. (line 86) +* t debugger command (alias for tbreak): Breakpoint Control. (line 89) +* tbreak debugger command: Breakpoint Control. (line 89) * Tcl: Library Names. (line 57) * TCP/IP: TCP/IP Networking. (line 6) * TCP/IP, support for: Special Network. (line 6) @@ -26952,7 +26965,7 @@ Index * whitespace, functions, calling: Calling Built-in. (line 10) * whitespace, newlines as: Options. (line 203) * Williams, Kent: Contributors. (line 35) -* Woehlke, Matthew: Contributors. (line 76) +* Woehlke, Matthew: Contributors. (line 77) * Woods, John: Contributors. (line 28) * word boundaries, matching: GNU Regexp Operators. (line 38) @@ -26960,7 +26973,7 @@ Index (line 6) * word-boundary operator (gawk): GNU Regexp Operators. (line 63) -* wordfreq.awk program: Word Sorting. (line 55) +* wordfreq.awk program: Word Sorting. (line 56) * words, counting: Wc Program. (line 6) * words, duplicate, searching for: Dupword Program. (line 6) * words, usage counts, generating: Word Sorting. (line 6) @@ -26971,11 +26984,12 @@ Index * XML (eXtensible Markup Language): Internals. (line 161) * XOR bitwise operation: Bitwise Functions. (line 6) * xor() function (gawk): Bitwise Functions. (line 54) +* Yawitz, Efraim: Contributors. (line 104) * Zaretskii, Eli <1>: Bugs. (line 70) * Zaretskii, Eli: Acknowledgments. (line 60) * zero, negative vs. positive: Unexpected Results. (line 28) * zerofile.awk program: Empty Files. (line 21) -* Zoulas, Christos: Contributors. (line 64) +* Zoulas, Christos: Contributors. (line 65) * {} (braces), actions and: Action Overview. (line 19) * {} (braces), pgawk program: Profiling. (line 137) * {} (braces), statements, grouping: Statements. (line 10) @@ -27221,188 +27235,189 @@ Ref: table-gensub-escapes478170 Node: I/O Functions479341 Ref: I/O Functions-Footnote-1485996 Node: Time Functions486143 -Ref: Time Functions-Footnote-1497038 -Ref: Time Functions-Footnote-2497106 -Ref: Time Functions-Footnote-3497264 -Ref: Time Functions-Footnote-4497375 -Ref: Time Functions-Footnote-5497487 -Ref: Time Functions-Footnote-6497714 -Node: Bitwise Functions497980 -Ref: table-bitwise-ops498538 -Ref: Bitwise Functions-Footnote-1502698 -Node: Type Functions502882 -Node: I18N Functions503352 -Node: User-defined504979 -Node: Definition Syntax505783 -Ref: Definition Syntax-Footnote-1510693 -Node: Function Example510762 -Node: Function Caveats513356 -Node: Calling A Function513777 -Node: Variable Scope514892 -Node: Pass By Value/Reference516867 -Node: Return Statement520307 -Node: Dynamic Typing523288 -Node: Indirect Calls524023 -Node: Internationalization533708 -Node: I18N and L10N535134 -Node: Explaining gettext535820 -Ref: Explaining gettext-Footnote-1540886 -Ref: Explaining gettext-Footnote-2541070 -Node: Programmer i18n541235 -Node: Translator i18n545435 -Node: String Extraction546228 -Ref: String Extraction-Footnote-1547189 -Node: Printf Ordering547275 -Ref: Printf Ordering-Footnote-1550059 -Node: I18N Portability550123 -Ref: I18N Portability-Footnote-1552572 -Node: I18N Example552635 -Ref: I18N Example-Footnote-1555270 -Node: Gawk I18N555342 -Node: Advanced Features555959 -Node: Nondecimal Data557278 -Node: Two-way I/O558859 -Ref: Two-way I/O-Footnote-1564293 -Node: TCP/IP Networking564363 -Node: Profiling567207 -Node: Library Functions574681 -Ref: Library Functions-Footnote-1577786 -Node: Library Names577957 -Ref: Library Names-Footnote-1581428 -Ref: Library Names-Footnote-2581648 -Node: General Functions581734 -Node: Nextfile Function582797 -Node: Strtonum Function587178 -Node: Assert Function590134 -Node: Round Function593460 -Node: Cliff Random Function595003 -Node: Ordinal Functions596019 -Ref: Ordinal Functions-Footnote-1599089 -Ref: Ordinal Functions-Footnote-2599341 -Node: Join Function599550 -Ref: Join Function-Footnote-1601321 -Node: Gettimeofday Function601521 -Node: Data File Management605236 -Node: Filetrans Function605868 -Node: Rewind Function610104 -Node: File Checking611557 -Node: Empty Files612651 -Node: Ignoring Assigns614881 -Node: Getopt Function616434 -Ref: Getopt Function-Footnote-1627738 -Node: Passwd Functions627941 -Ref: Passwd Functions-Footnote-1636916 -Node: Group Functions637004 -Node: Walking Arrays645088 -Node: Sample Programs646657 -Node: Running Examples647322 -Node: Clones648050 -Node: Cut Program649274 -Node: Egrep Program659123 -Ref: Egrep Program-Footnote-1666894 -Node: Id Program667004 -Node: Split Program670620 -Ref: Split Program-Footnote-1674139 -Node: Tee Program674267 -Node: Uniq Program677070 -Node: Wc Program684493 -Ref: Wc Program-Footnote-1688757 -Node: Miscellaneous Programs688957 -Node: Dupword Program690145 -Node: Alarm Program692176 -Node: Translate Program696933 -Ref: Translate Program-Footnote-1701312 -Ref: Translate Program-Footnote-2701540 -Node: Labels Program701674 -Ref: Labels Program-Footnote-1705045 -Node: Word Sorting705129 -Node: History Sorting709012 -Node: Extract Program710850 -Ref: Extract Program-Footnote-1718331 -Node: Simple Sed718459 -Node: Igawk Program721521 -Ref: Igawk Program-Footnote-1736553 -Ref: Igawk Program-Footnote-2736754 -Node: Anagram Program736892 -Node: Signature Program739990 -Node: Debugger741093 -Node: Debugging742004 -Node: Debugging Concepts742318 -Node: Debugging Terms744174 -Node: Awk Debugging746719 -Node: Sample dgawk session747611 -Node: dgawk invocation748103 -Node: Finding The Bug749285 -Node: List of Debugger Commands755770 -Node: Breakpoint Control757081 -Node: Dgawk Execution Control760557 -Node: Viewing And Changing Data763908 -Node: Dgawk Stack767217 -Node: Dgawk Info768677 -Node: Miscellaneous Dgawk Commands772625 -Node: Readline Support778056 -Node: Dgawk Limitations778883 -Node: Language History781022 -Node: V7/SVR3.1782454 -Node: SVR4784749 -Node: POSIX786191 -Node: BTL787189 -Node: POSIX/GNU787923 -Node: Common Extensions793109 -Node: Contributors794210 -Node: Installation798245 -Node: Gawk Distribution799139 -Node: Getting799623 -Node: Extracting800449 -Node: Distribution contents802140 -Node: Unix Installation807158 -Node: Quick Installation807775 -Node: Additional Configuration Options809737 -Node: Configuration Philosophy811214 -Node: Non-Unix Installation813556 -Node: PC Installation814014 -Node: PC Binary Installation815313 -Node: PC Compiling817161 -Node: PC Testing820105 -Node: PC Using821281 -Node: Cygwin825466 -Node: MSYS826463 -Node: VMS Installation826977 -Node: VMS Compilation827583 -Ref: VMS Compilation-Footnote-1828590 -Node: VMS Installation Details828648 -Node: VMS Running830283 -Node: VMS Old Gawk831890 -Node: Bugs832364 -Node: Other Versions836229 -Node: Notes841508 -Node: Compatibility Mode842200 -Node: Additions842983 -Node: Accessing The Source843795 -Node: Adding Code845218 -Node: New Ports850766 -Node: Dynamic Extensions854879 -Node: Internals856255 -Node: Plugin License865371 -Node: Sample Library866005 -Node: Internal File Description866691 -Node: Internal File Ops870398 -Ref: Internal File Ops-Footnote-1875166 -Node: Using Internal File Ops875314 -Node: Future Extensions877691 -Node: Basic Concepts880195 -Node: Basic High Level880952 -Ref: Basic High Level-Footnote-1884987 -Node: Basic Data Typing885172 -Node: Floating Point Issues889697 -Node: String Conversion Precision890780 -Ref: String Conversion Precision-Footnote-1892474 -Node: Unexpected Results892583 -Node: POSIX Floating Point Problems894409 -Ref: POSIX Floating Point Problems-Footnote-1898111 -Node: Glossary898149 -Node: Copying922292 -Node: GNU Free Documentation License959849 -Node: Index984986 +Ref: Time Functions-Footnote-1497035 +Ref: Time Functions-Footnote-2497103 +Ref: Time Functions-Footnote-3497261 +Ref: Time Functions-Footnote-4497372 +Ref: Time Functions-Footnote-5497484 +Ref: Time Functions-Footnote-6497711 +Node: Bitwise Functions497977 +Ref: table-bitwise-ops498535 +Ref: Bitwise Functions-Footnote-1502695 +Node: Type Functions502879 +Node: I18N Functions503349 +Node: User-defined504976 +Node: Definition Syntax505780 +Ref: Definition Syntax-Footnote-1510690 +Node: Function Example510759 +Node: Function Caveats513353 +Node: Calling A Function513774 +Node: Variable Scope514889 +Node: Pass By Value/Reference516864 +Node: Return Statement520304 +Node: Dynamic Typing523285 +Node: Indirect Calls524020 +Node: Internationalization533705 +Node: I18N and L10N535131 +Node: Explaining gettext535817 +Ref: Explaining gettext-Footnote-1540883 +Ref: Explaining gettext-Footnote-2541067 +Node: Programmer i18n541232 +Node: Translator i18n545432 +Node: String Extraction546225 +Ref: String Extraction-Footnote-1547186 +Node: Printf Ordering547272 +Ref: Printf Ordering-Footnote-1550056 +Node: I18N Portability550120 +Ref: I18N Portability-Footnote-1552569 +Node: I18N Example552632 +Ref: I18N Example-Footnote-1555267 +Node: Gawk I18N555339 +Node: Advanced Features555956 +Node: Nondecimal Data557275 +Node: Two-way I/O558856 +Ref: Two-way I/O-Footnote-1564290 +Node: TCP/IP Networking564360 +Node: Profiling567204 +Node: Library Functions574678 +Ref: Library Functions-Footnote-1577783 +Node: Library Names577954 +Ref: Library Names-Footnote-1581425 +Ref: Library Names-Footnote-2581645 +Node: General Functions581731 +Node: Nextfile Function582794 +Node: Strtonum Function587175 +Node: Assert Function590131 +Node: Round Function593457 +Node: Cliff Random Function595000 +Node: Ordinal Functions596016 +Ref: Ordinal Functions-Footnote-1599086 +Ref: Ordinal Functions-Footnote-2599338 +Node: Join Function599547 +Ref: Join Function-Footnote-1601318 +Node: Gettimeofday Function601518 +Node: Data File Management605233 +Node: Filetrans Function605865 +Node: Rewind Function610101 +Node: File Checking611554 +Node: Empty Files612648 +Node: Ignoring Assigns614878 +Node: Getopt Function616431 +Ref: Getopt Function-Footnote-1627735 +Node: Passwd Functions627938 +Ref: Passwd Functions-Footnote-1636913 +Node: Group Functions637001 +Node: Walking Arrays645085 +Node: Sample Programs646654 +Node: Running Examples647319 +Node: Clones648047 +Node: Cut Program649271 +Node: Egrep Program659116 +Ref: Egrep Program-Footnote-1666889 +Node: Id Program666999 +Node: Split Program670615 +Ref: Split Program-Footnote-1674134 +Node: Tee Program674262 +Node: Uniq Program677065 +Node: Wc Program684494 +Ref: Wc Program-Footnote-1688760 +Ref: Wc Program-Footnote-2688960 +Node: Miscellaneous Programs689052 +Node: Dupword Program690240 +Node: Alarm Program692271 +Node: Translate Program697020 +Ref: Translate Program-Footnote-1701407 +Ref: Translate Program-Footnote-2701635 +Node: Labels Program701769 +Ref: Labels Program-Footnote-1705140 +Node: Word Sorting705224 +Node: History Sorting709108 +Node: Extract Program710947 +Ref: Extract Program-Footnote-1718430 +Node: Simple Sed718558 +Node: Igawk Program721620 +Ref: Igawk Program-Footnote-1736653 +Ref: Igawk Program-Footnote-2736854 +Node: Anagram Program736992 +Node: Signature Program740060 +Node: Debugger741160 +Node: Debugging742071 +Node: Debugging Concepts742484 +Node: Debugging Terms744340 +Node: Awk Debugging746962 +Node: Sample dgawk session747854 +Node: dgawk invocation748346 +Node: Finding The Bug749528 +Node: List of Debugger Commands756014 +Node: Breakpoint Control757325 +Node: Dgawk Execution Control760961 +Node: Viewing And Changing Data764312 +Node: Dgawk Stack767649 +Node: Dgawk Info769109 +Node: Miscellaneous Dgawk Commands773057 +Node: Readline Support778485 +Node: Dgawk Limitations779323 +Node: Language History781512 +Node: V7/SVR3.1782950 +Node: SVR4785271 +Node: POSIX786713 +Node: BTL787721 +Node: POSIX/GNU788455 +Node: Common Extensions793556 +Node: Contributors794657 +Node: Installation798796 +Node: Gawk Distribution799690 +Node: Getting800174 +Node: Extracting801000 +Node: Distribution contents802691 +Node: Unix Installation807709 +Node: Quick Installation808326 +Node: Additional Configuration Options810288 +Node: Configuration Philosophy811765 +Node: Non-Unix Installation814107 +Node: PC Installation814565 +Node: PC Binary Installation815864 +Node: PC Compiling817712 +Node: PC Testing820656 +Node: PC Using821832 +Node: Cygwin826017 +Node: MSYS827014 +Node: VMS Installation827528 +Node: VMS Compilation828134 +Ref: VMS Compilation-Footnote-1829141 +Node: VMS Installation Details829199 +Node: VMS Running830834 +Node: VMS Old Gawk832441 +Node: Bugs832915 +Node: Other Versions836780 +Node: Notes842059 +Node: Compatibility Mode842751 +Node: Additions843534 +Node: Accessing The Source844346 +Node: Adding Code845769 +Node: New Ports851317 +Node: Dynamic Extensions855430 +Node: Internals856806 +Node: Plugin License865922 +Node: Sample Library866556 +Node: Internal File Description867242 +Node: Internal File Ops870949 +Ref: Internal File Ops-Footnote-1875717 +Node: Using Internal File Ops875865 +Node: Future Extensions878242 +Node: Basic Concepts880746 +Node: Basic High Level881503 +Ref: Basic High Level-Footnote-1885538 +Node: Basic Data Typing885723 +Node: Floating Point Issues890248 +Node: String Conversion Precision891331 +Ref: String Conversion Precision-Footnote-1893025 +Node: Unexpected Results893134 +Node: POSIX Floating Point Problems894960 +Ref: POSIX Floating Point Problems-Footnote-1898662 +Node: Glossary898700 +Node: Copying922843 +Node: GNU Free Documentation License960400 +Node: Index985537 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 0b410fc1..1b346289 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -16037,7 +16037,7 @@ the string. For example: @example $ date '+Today is %A, %B %d, %Y.' -@print{} Today is Wednesday, December 01, 2010. +@print{} Today is Wednesday, March 30, 2011. @end example Here is the @command{gawk} version of the @command{date} utility. @@ -21636,7 +21636,7 @@ supplied: # # -s Suppress lines without the delimiter # -# Requires getopt and join library functions +# Requires getopt() and join() library functions @group function usage( e1, e2) @@ -21789,7 +21789,7 @@ The @code{set_charlist()} function is more complicated than @code{set_fieldlist()}. The idea here is to use @command{gawk}'s @code{FIELDWIDTHS} variable (@pxref{Constant Size}), -which describes constant-width input. When using a bracket expression, that is +which describes constant-width input. When using a character list, that is exactly what we have. Setting up @code{FIELDWIDTHS} is more complicated than simply listing the @@ -21817,7 +21817,7 @@ function set_charlist( field, i, j, f, g, t, if (index(f[i], "-") != 0) @{ # range m = split(f[i], g, "-") if (m != 2 || g[1] >= g[2]) @{ - printf("bad bracket expression: %s\n", + printf("bad character list: %s\n", f[i]) > "/dev/stderr" exit 1 @} @@ -22056,9 +22056,9 @@ commented out since it is not necessary with @command{gawk}: The @code{beginfile()} function is called by the rule in @file{ftrans.awk} when each new file is processed. In this case, it is very simple; all it does is initialize a variable @code{fcount} to zero. @code{fcount} tracks -how many lines in the current file matched the pattern -(naming the parameter @code{junk} shows we know that @code{beginfile} -is called with a parameter, but that we're not interested in its value): +how many lines in the current file matched the pattern. +Naming the parameter @code{junk} shows we know that @code{beginfile()} +is called with a parameter, but that we're not interested in its value: @example @c file eg/prog/egrep.awk @@ -22687,17 +22687,17 @@ standard output, @file{/dev/stdout}: # uniq.awk --- do uniq in awk # # Requires getopt() and join() library functions -# @end group @c endfile @ignore @c file eg/prog/uniq.awk +# # Arnold Robbins, arnold@@skeeve.com, Public Domain # May 1993 - @c endfile @end ignore @c file eg/prog/uniq.awk + function usage( e) @{ e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" @@ -22726,7 +22726,7 @@ BEGIN \ else if (index("0123456789", c) != 0) @{ # getopt requires args to options # this messes us up for things like -5 - if (Optarg ~ /^[0-9]+$/) + if (Optarg ~ /^[[:digit:]]+$/) fcount = (c Optarg) + 0 else @{ fcount = c + 0 @@ -22736,7 +22736,7 @@ BEGIN \ usage() @} - if (ARGV[Optind] ~ /^\+[0-9]+$/) @{ + if (ARGV[Optind] ~ /^\+[[:digit:]]+$/) @{ charcount = substr(ARGV[Optind], 2) + 0 Optind++ @} @@ -23019,7 +23019,9 @@ function endfile(file) @end example There is one rule that is executed for each line. It adds the length of -the record, plus one, to @code{chars}. Adding one plus the record length +the record, plus one, to @code{chars}.@footnote{Since @command{gawk} +understands multibyte locales, this code counts characters, not bytes.} +Adding one plus the record length is needed because the newline character separating records (the value of @code{RS}) is not part of the record itself, and thus not included in its length. Next, @code{lines} is incremented for each line read, @@ -23094,7 +23096,11 @@ We hope you find them both interesting and enjoyable. A common error when writing large amounts of prose is to accidentally duplicate words. Typically you will see this in text as something like ``the the program does the following@dots{}'' When the text is online, often -the duplicated words occur at the end of one line and the beginning of +the duplicated words occur at the end of one line and the +@iftex +the +@end iftex +beginning of another, making them very difficult to spot. @c as here! @@ -23226,7 +23232,7 @@ BEGIN \ message = ARGV[2] break default: - if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]][[:digit:]]/) @{ + if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]]@{2@}/) @{ print usage1 > "/dev/stderr" print usage2 > "/dev/stderr" exit 1 @@ -23365,7 +23371,7 @@ and @code{gsub()} built-in functions program was written before @command{gawk} acquired the ability to split each character in a string into separate array elements.} @c Exercise: How might you use this new feature to simplify the program? -There are two functions. The first, @code{stranslate}, takes three +There are two functions. The first, @code{stranslate()}, takes three arguments: @table @code @@ -23385,12 +23391,12 @@ loop goes through @code{from}, one character at a time. For each character in @code{from}, if the character appears in @code{target}, it is replaced with the corresponding @code{to} character. -The @code{translate} function simply calls @code{stranslate} using @code{$0} +The @code{translate()} function simply calls @code{stranslate()} using @code{$0} as the target. The main program sets two global variables, @code{FROM} and @code{TO}, from the command line, and then changes @code{ARGV} so that @command{awk} reads from the standard input. -Finally, the processing rule simply calls @code{translate} for each record: +Finally, the processing rule simply calls @code{translate()} for each record: @cindex @code{translate.awk} program @example @@ -23617,6 +23623,7 @@ At first glance, a program like this would seem to do the job: @example # Print list of word frequencies + @{ for (i = 1; i <= NF; i++) freq[$i]++ @@ -23765,10 +23772,10 @@ The @code{END} rule simply prints out the lines, in order: # # Arnold Robbins, arnold@@skeeve.com, Public Domain # May 1993 - @c endfile @end ignore @c file eg/prog/histsort.awk + @group @{ if (data[$0]++ == 0) @@ -23776,10 +23783,12 @@ The @code{END} rule simply prints out the lines, in order: @} @end group +@group END @{ for (i = 1; i <= count; i++) print lines[i] @} +@end group @c endfile @end example @@ -24037,7 +24046,7 @@ sample source file (as has been done here!) without any hassle. The file is only closed when a new data @value{FN} is encountered or at the end of the input file. -Finally, the function @code{@w{unexpected_eof}} prints an appropriate +Finally, the function @code{@w{unexpected_eof()}} prints an appropriate error message and then exits. The @code{END} rule handles the final cleanup, closing the open file: @@ -24544,7 +24553,7 @@ the program is done: @} @}' # close quote ends `expand_prog' variable -processed_program=$(gawk -- "$expand_prog" /dev/stdin <<EOF +processed_program=$(gawk -- "$expand_prog" /dev/stdin << EOF $program EOF ) @@ -24688,9 +24697,9 @@ statements for the desired library functions. @subsection Finding Anagrams From A Dictionary An interesting programming challenge is to -read a word list (such as -@file{/usr/share/dict/words} on many GNU/Linux systems) -and find words that are @dfn{anagrams} of each other. +search for @dfn{anagrams} in a +word list (such as +@file{/usr/share/dict/words} on many GNU/Linux systems). One word is an anagram of another if both words contain the same letters (for example, ``babbling'' and ``blabbing''). @@ -24821,7 +24830,6 @@ The following program was written by Davide Brini @c (@email{dave_br@@gmx.com}) and is published on @uref{http://backreference.org/2011/02/03/obfuscated-awk/, his website}. - It serves as his signature in the Usenet group @code{comp.lang.awk}. He supplies the following copyright terms: @@ -24872,6 +24880,9 @@ command-line debugger. If you are familiar with GDB, learning @node Debugging @section Introduction to @command{dgawk} +This @value{SECTION} introduces debugging in general and begins +the discussion of debugging in @command{gawk}. + @menu * Debugging Concepts:: Debugging In General. * Debugging Terms:: Additional Debugging Concepts. @@ -24907,7 +24918,7 @@ having to change your source files. @item The chance to see the values of data in the program at any point in execution, and also to change that data on the fly, to see how that -effects what happens afterwards. (This often includes the ability +affects what happens afterwards. (This often includes the ability to look at internal data structures besides the variables you actually defined in your code.) @@ -24927,6 +24938,8 @@ functional program that you or someone else wrote). Before diving in to the details, we need to introduce several important concepts that apply to just about all debuggers, including @command{dgawk}. +The following list defines terms used thoughout the rest of +this @value{CHAPTER}. @table @dfn @item Stack Frame @@ -25079,7 +25092,7 @@ dgawk> @kbd{b are_equal} The debugger tells us the file and line number where the breakpoint is. Now type @samp{r} or @samp{run} and the program runs until it hits -the breakpoint the first time: +the breakpoint for the first time: @example dgawk> @kbd{r} @@ -25161,7 +25174,7 @@ dgawk> @kbd{p last} Everything we have done so far has verified that the program has worked as planned, up to and including the call to @code{are_equal()}, so the problem must -be inside this function. To investigate further, we have to begin +be inside this function. To investigate further, we must begin ``stepping through'' the lines of @code{are_equal()}. We start by typing @samp{n} (for ``next''): @@ -25361,11 +25374,14 @@ Set a breakpoint at entry to (the first instruction of) function @var{function}. @end table +Each breakpoint is assigned a number which can be used to delete it from +the breakpoint list using the @code{delete} command. + With a breakpoint, you may also supply a condition. This is an -@command{awk} expression that @command{dgawk} evaluates whenever -the breakpoint is reached. If the condition is true, then @command{dgawk} -stops execution and prompts for a command. Otherwise, @command{dgawk} -continues executing the program. +@command{awk} expression (enclosed in double quotes) that @command{dgawk} +evaluates whenever the breakpoint is reached. If the condition is true, +then @command{dgawk} stops execution and prompts for a command. Otherwise, +@command{dgawk} continues executing the program. @cindex debugger commands, @code{clear} @cindex @code{clear} debugger command @@ -25417,8 +25433,8 @@ any argument, disables all breakpoints. @cindex debugger commands, @code{enable} @cindex @code{enable} debugger command @cindex @code{e} debugger command (alias for @code{enable}) -@item @code{enable} [@code{once} | @code{del}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] -@itemx @code{e} [@code{once} | @code{del}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] +@item @code{enable} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] +@itemx @code{e} [@code{del} | @code{once}] [@var{n1 n2} @dots{}] [@var{n}--@var{m}] Enable specified breakpoints or a range of breakpoints. Without any argument, enables all breakpoints. Optionally, you can specify how to enable the breakpoint: @@ -25672,10 +25688,10 @@ number which can be used to delete it from the watch list using the @code{unwatch} command. With a watchpoint, you may also supply a condition. This is an -@command{awk} expression that @command{dgawk} evaluates whenever -the watchpoint is reached. If the condition is true, then @command{dgawk} -stops execution and prompts for a command. Otherwise, @command{dgawk} -continues executing the program. +@command{awk} expression (enclosed in double quotes) that @command{dgawk} +evaluates whenever the watchpoint is reached. If the condition is true, +then @command{dgawk} stops execution and prompts for a command. Otherwise, +@command{dgawk} continues executing the program. @cindex debugger commands, @code{undisplay} @cindex @code{undisplay} debugger command @@ -25947,8 +25963,8 @@ about the command @var{command}. @cindex debugger commands, @code{list} @cindex @code{list} debugger command @cindex @code{l} debugger command (alias for @code{list}) -@item @code{list} [@code{-} | @code{+} | @var{n} | @var{filename@code{:}n} | @var{n}---@var{m} | @var{function}] -@itemx @code{l} [@code{-} | @code{+} | @var{n} | @var{filename@code{:}n} | @var{n}---@var{m} | @var{function}] +@item @code{list} [@code{-} | @code{+} | @var{n} | @var{filename@code{:}n} | @var{n}--@var{m} | @var{function}] +@itemx @code{l} [@code{-} | @code{+} | @var{n} | @var{filename@code{:}n} | @var{n}--@var{m} | @var{function}] Print the specified lines (default 15) from the current source file or the file named @var{filename}. The possible arguments to @code{list} are as follows: @@ -25965,7 +25981,7 @@ Print lines after the lines last printed. @item @var{n} Print lines centered around line number @var{n}. -@item @var{n}---@var{m} +@item @var{n}--@var{m} Print lines from @var{n} to @var{m}. @item @var{filename@code{:}n} @@ -25991,7 +26007,7 @@ running a program, @command{dgawk} warns you if you accidentally type @cindex debugger commands, @code{trace} @cindex @code{trace} debugger command -@item @code{trace} @code{on} | @code{off} +@item @code{trace} @code{on} @r{|} @code{off} Turn on or off a continuous printing of instructions which are about to be executed, along with printing the @command{awk} line which they implement. The default is @code{off}. @@ -26006,7 +26022,7 @@ fairly self-explanatory, and using @code{stepi} and @code{nexti} while @section Readline Support If @command{dgawk} is compiled with the @code{readline} library, you -can take advantage of its command completion and history expansion +can take advantage of that library's command completion and history expansion features. The following types of completion are available: @table @asis @@ -26067,7 +26083,7 @@ this is to use more explicit variables at the debugging stage and then change back to obscure, perhaps more optimal code later. @item -There is no way right now to look ``inside'' the process of compiling +There is no way to look ``inside'' the process of compiling regular expressions to see if you got it right. As an @command{awk} programmer, you are expected to know what @code{/[^[:alnum:][:blank:]]/} means. @@ -26078,6 +26094,9 @@ parameters) on the command line, as described in @ref{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. + +@item +@command{dgawk} only accepts source supplied with the @option{-f} option. @end itemize Look forward to a future release when these and other missing features may @@ -26130,13 +26149,15 @@ the POSIX specification. Many long-time @command{awk} users learned @command{awk} programming with the original @command{awk} implementation in Version 7 Unix. (This implementation was the basis for @command{awk} in Berkeley Unix, -through 4.3-Reno. Subsequent versions of Berkeley Unix, and systems +through 4.3-Reno. Subsequent versions of Berkeley Unix, and some systems derived from 4.4BSD-Lite, use various versions of @command{gawk} for their @command{awk}.) This @value{CHAPTER} briefly describes the evolution of the @command{awk} language, with cross-references to other parts of the @value{DOCUMENT} where you can find more information. +@c FIXME: Try to determine whether it was 3.1 or 3.2 that had new awk. + @menu * V7/SVR3.1:: The major changes between V7 and System V Release 3.1. @@ -26196,7 +26217,7 @@ The @code{ARGC}, @code{ARGV}, @code{FNR}, @code{RLENGTH}, @code{RSTART}, and @code{SUBSEP} built-in variables (@pxref{Built-in Variables}). @item -Assignable @code{$0}. +Assignable @code{$0} (@pxref{Changing Fields}). @item The conditional expression using the ternary operator @samp{?:} @@ -26328,7 +26349,7 @@ The concept of a numeric string and tighter comparison rules to go with it (@pxref{Typing and Comparison}). @item -The use of built-in variables as function names is forbidden +The use of built-in variables as function parameter names is forbidden (@pxref{Definition Syntax}. @item @@ -26419,9 +26440,9 @@ The @code{IGNORECASE}, @code{LINT}, @code{PROCINFO}, -@code{TEXTDOMAIN}, +@code{RT}, and -@code{RT} +@code{TEXTDOMAIN} variables (@pxref{Built-in Variables}). @end itemize @@ -26451,8 +26472,7 @@ The @samp{\x} escape sequence (@pxref{Escape Sequences}). @item -Full support for both POSIX and GNU regexps, with interval -expressions being matched by default. +Full support for both POSIX and GNU regexps (@pxref{Regexp}). @item @@ -26513,8 +26533,7 @@ of a two-way pipe to a coprocess (@pxref{Two-way I/O}). @item -POSIX compliance for @code{gsub()} and @code{sub()} -(@pxref{Gory Details}). +POSIX compliance for @code{gsub()} and @code{sub()}. @item The @code{length()} function accepts an array argument @@ -26544,12 +26563,12 @@ Additional functions only in @command{gawk}: @item The @code{and()}, -@code{or()}, -@code{xor()}, @code{compl()}, @code{lshift()}, -and +@code{or()}, @code{rshift()}, +and +@code{xor()} functions for bit manipulation (@pxref{Bitwise Functions}). @@ -26621,39 +26640,39 @@ options @item Support for the following obsolete systems was removed from the code -and the documentation: +and the documentation for @command{gawk} @value{PVERSION} 4.0: @c nested table @itemize @minus @item -Amiga. +Amiga @item -Atari. +Atari @item -BeOS. +BeOS @item -Cray. +Cray @item -MIPS RiscOS. +MIPS RiscOS @item -MS-DOS with the Microsoft Compiler. +MS-DOS with the Microsoft Compiler @item -MS-Windows with the Microsoft Compiler. +MS-Windows with the Microsoft Compiler @item -NeXT. +NeXT @item -SunOS 3.x, Sun 386 (Road Runner). +SunOS 3.x, Sun 386 (Road Runner) @item -Tandem (non-POSIX). +Tandem (non-POSIX) @end itemize @@ -26668,7 +26687,7 @@ Tandem (non-POSIX). @node Common Extensions @appendixsec Common Extensions Summary -This @value{SECTION} summarizes the common exceptions supported +This @value{SECTION} summarizes the common extensions supported by @command{gawk}, Brian Kernighan's @command{awk}, and @command{mawk}, the three most widely-used freely available versions of @command{awk} (@pxref{Other Versions}). @@ -26769,6 +26788,7 @@ provided the VMS port and its documentation. @cindex Peterson, Hal Hal Peterson provided help in porting @command{gawk} to Cray systems. +(This is no longer supported.) @item @cindex Rommel, Kai Uwe @@ -26850,7 +26870,7 @@ GNU Automake and GNU @code{gettext}. @cindex Broder, Alan J.@: Alan J.@: Broder provided the initial version of the @code{asort()} function -as well as the code for the new optional third argument to the +as well as the code for the optional third argument to the @code{match()} function. @item @@ -26880,6 +26900,10 @@ reworked the @command{gawk} internals to use a byte-code engine, providing the @command{dgawk} debugger for @command{awk} programs. @item +@cindex Yawitz, Efraim +Efraim Yawitz contributed the original text for @ref{Debugger}. + +@item @cindex Robbins, Arnold Arnold Robbins has been working on @command{gawk} since 1988, at first |