diff options
Diffstat (limited to 'doc/gawk.info')
-rw-r--r-- | doc/gawk.info | 847 |
1 files changed, 434 insertions, 413 deletions
diff --git a/doc/gawk.info b/doc/gawk.info index e499337a..8e97bdd9 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3804,6 +3804,9 @@ matches `RS', is not part of either record. character. However, when `RS' is a regular expression, `RT' contains the actual input text that matched the regular expression. + If the input file ended without any text that matches `RS', then +`gawk' sets `RT' to the null string. + The following example illustrates both of these features. It sets `RS' equal to a regular expression that matches either a newline or a series of one or more uppercase letters with optional leading and/or @@ -4830,7 +4833,8 @@ based on the value of `RS'. (`==' means "is equal to.") POSIX standard.) In all cases, `gawk' sets `RT' to the input text that matched the -value specified by `RS'. +value specified by `RS'. But if the input file ended without any text +that matches `RS', then `gawk' sets `RT' to the null string. ---------- Footnotes ---------- @@ -17130,9 +17134,9 @@ File: gawk.info, Node: Labels Program, Next: Word Sorting, Prev: Translate Pr Here is a "real world"(1) program. This script reads lists of names and addresses and generates mailing labels. Each page of labels has 20 -labels on it, 2 across and 10 down. The addresses are guaranteed to be -no more than 5 lines of data. Each address is separated from the next -by a blank line. +labels on it, two across and 10 down. The addresses are guaranteed to +be no more than five lines of data. Each address is separated from the +next by a blank line. The basic idea is to read 20 labels worth of data. Each line of each label is stored in the `line' array. The single rule takes care @@ -17144,7 +17148,7 @@ splits records at blank lines (*note Records::). It sets `MAXLINES' to 100, since 100 is the maximum number of lines on the page (20 * 5 = 100). - Most of the work is done in the `printpage' function. The label + Most of the work is done in the `printpage()' function. The label lines are stored sequentially in the `line' array. But they have to print horizontally; `line[1]' next to `line[6]', `line[2]' next to `line[7]', and so on. Two loops are used to accomplish this. The @@ -17161,10 +17165,13 @@ output ends up looking something like this: line 5 line 10 ... +The `printf' format string `%-41s' left-aligns the data and prints it +within a fixed-width field. + As a final note, an extra blank line is printed at lines 21 and 61, to keep the output lined up on the labels. This is dependent on the particular brand of labels in use when the program was written. You -will also note that there are 2 blank lines at the top and 2 blank +will also note that there are two blank lines at the top and two blank lines at the bottom. The `END' rule arranges to flush the final page of labels; there may @@ -17198,8 +17205,7 @@ not have been an even multiple of 20 labels in the data: printf "\n\n" # footer - for (i in line) - line[i] = "" + delete line } # main rule @@ -17314,11 +17320,11 @@ decreasing frequency. The `awk' program suitably massages the data and produces a word frequency table, which is not ordered. The `awk' script's output is then sorted by the `sort' utility and -printed on the terminal. The options given to `sort' specify a sort -that uses the second field of each input line (skipping one field), -that the sort keys should be treated as numeric quantities (otherwise -`15' would come before `5'), and that the sorting should be done in -descending (reverse) order. +printed on the screen. The options given to `sort' specify a sort that +uses the second field of each input line (skipping one field), that the +sort keys should be treated as numeric quantities (otherwise `15' would +come before `5'), and that the sorting should be done in descending +(reverse) order. The `sort' could even be done from within the program, by changing the `END' action to: @@ -17393,10 +17399,10 @@ to experiment with these programs, it is tedious to have to type them in by hand. Here we present a program that can extract parts of a Texinfo input file into separate files. -This Info file is written in Texinfo, the GNU project's document -formatting language. A single Texinfo source file can be used to -produce both printed and online documentation. The Texinfo language is -described fully, starting with *note Top::. +This Info file is written in Texinfo (http://texinfo.org), the GNU +project's document formatting language. A single Texinfo source file +can be used to produce both printed and online documentation. The +Texinfo language is described fully, starting with *note Top::. For our purposes, it is enough to know three things about Texinfo input files: @@ -17412,7 +17418,7 @@ input files: * Lines containing `@group' and `@end group' commands bracket example text that should not be split across a page boundary. (Unfortunately, TeX isn't always smart enough to do things exactly - right, and we have to give it some help.) + right, so we have to give it some help.) The following program, `extract.awk', reads through a Texinfo source file and does two things, based on the special comments. Upon seeing @@ -17460,6 +17466,7 @@ with a zero exit status, signifying OK: # extract.awk --- extract files and run programs # from texinfo files + BEGIN { IGNORECASE = 1 } /^@c(omment)?[ \t]+system/ \ @@ -17480,7 +17487,7 @@ with a zero exit status, signifying OK: } } -The variable `e' is used so that the function fits nicely on the screen. +The variable `e' is used so that the rule fits nicely on the screen. The second rule handles moving data into files. It verifies that a file name is given in the directive. If the file named is not the @@ -17491,7 +17498,7 @@ simple. The `for' loop does the work. It reads lines using `getline' (*note Getline::). For an unexpected end of file, it calls the -`unexpected_eof' function. If the line is an "endfile" line, then it +`unexpected_eof()' function. If the line is an "endfile" line, then it breaks out of the loop. If the line is an `@group' or `@end group' line, then it ignores it and goes on to the next line. Similarly, comments within examples are also ignored. @@ -17504,7 +17511,7 @@ function (*note String Functions::). The `@' symbol is used as the separator character. Each element of `a' that is empty indicates two successive `@' symbols in the original line. For each two empty elements (`@@' in the original file), we have to add a single `@' -symbol back in. +symbol back in.(1) When the processing of the array is finished, `join()' is called with the value of `SUBSEP', to rejoin the pieces back into a single @@ -17562,7 +17569,8 @@ end of the input file. message and then exits. The `END' rule handles the final cleanup, closing the open file: - function unexpected_eof() { + function unexpected_eof() + { printf("%s:%d: unexpected EOF or error\n", FILENAME, FNR) > "/dev/stderr" exit 1 @@ -17573,6 +17581,11 @@ closing the open file: close(curfile) } + ---------- Footnotes ---------- + + (1) This program was written before `gawk' had the `gensub()' +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 @@ -17600,6 +17613,7 @@ process. If none are provided, the standard input is used: # awksed.awk --- do s/foo/bar/g using just print # Thanks to Michael Brennan for the idea + function usage() { print "usage: awksed pat repl [files...]" > "/dev/stderr" @@ -17659,14 +17673,20 @@ File: gawk.info, Node: Igawk Program, Next: Signature Program, Prev: Simple S 13.3.9 An Easy Way to Use Library Functions ------------------------------------------- -Using library functions in `awk' can be very beneficial. It encourages -code reuse and the writing of general functions. Programs are smaller -and therefore clearer. However, using library functions is only easy -when writing `awk' programs; it is painful when running them, requiring -multiple `-f' options. If `gawk' is unavailable, then so too is the -`AWKPATH' environment variable and the ability to put `awk' functions -into a library directory (*note Options::). It would be nice to be -able to write programs in the following manner: +In *note Include Files::, we saw how `gawk' provides a built-in +file-inclusion capability. However, this is a `gawk' extension. This +minor node provides the motivation for making file inclusion available +for standard `awk', and shows how to do it using a combination of shell +and `awk' programming. + + Using library functions in `awk' can be very beneficial. It +encourages code reuse and the writing of general functions. Programs are +smaller and therefore clearer. However, using library functions is +only easy when writing `awk' programs; it is painful when running them, +requiring multiple `-f' options. If `gawk' is unavailable, then so too +is the `AWKPATH' environment variable and the ability to put `awk' +functions into a library directory (*note Options::). It would be nice +to be able to write programs in the following manner: # library functions @include getopt.awk @@ -17718,7 +17738,7 @@ language.(1) It works as follows: command-line arguments that the user supplied (such as the data file names). - This program uses shell variables extensively; for storing command + This program uses shell variables extensively: for storing command line arguments, the text of the `awk' program that will expand the user's program, for the user's original program, and for the expanded program. Doing so removes some potential problems that might arise @@ -17773,6 +17793,7 @@ program. #! /bin/sh # igawk --- like gawk but do @include processing + if [ "$1" = debug ] then set -x @@ -17790,49 +17811,50 @@ program. while [ $# -ne 0 ] # loop over arguments do case $1 in - --) shift; break;; + --) shift + break ;; -W) shift # The ${x?'message here'} construct prints a # diagnostic if $x is the null string set -- -W"${@?'missing operand'}" - continue;; + continue ;; -[vF]) opts="$opts $1 '${2?'missing operand'}'" - shift;; + shift ;; -[vF]*) opts="$opts '$1'" ;; -f) program="$program$n@include ${2?'missing operand'}" - shift;; + shift ;; - -f*) f=`expr "$1" : '-f\(.*\)'` - program="$program$n@include $f";; + -f*) f=$(expr "$1" : '-f\(.*\)') + program="$program$n@include $f" ;; -[W-]file=*) - f=`expr "$1" : '-.file=\(.*\)'` - program="$program$n@include $f";; + f=$(expr "$1" : '-.file=\(.*\)') + program="$program$n@include $f" ;; -[W-]file) program="$program$n@include ${2?'missing operand'}" - shift;; + shift ;; -[W-]source=*) - t=`expr "$1" : '-.source=\(.*\)'` - program="$program$n$t";; + t=$(expr "$1" : '-.source=\(.*\)') + program="$program$n$t" ;; -[W-]source) program="$program$n${2?'missing operand'}" - shift;; + shift ;; -[W-]version) - echo igawk: version 2.0 1>&2 + echo igawk: version 3.0 1>&2 gawk --version exit 0 ;; -[W-]*) opts="$opts '$1'" ;; - *) break;; + *) break ;; esac shift done @@ -17856,14 +17878,14 @@ As each file is finished, the stack is "popped," and the previous input file becomes the current input file again. The process is started by making the original file the first one on the stack. - The `pathto' function does the work of finding the full path to a + The `pathto()' function does the work of finding the full path to a file. It simulates `gawk''s behavior when searching the `AWKPATH' environment variable (*note AWKPATH Variable::). If a file name has a `/' in it, no path search is done. Otherwise, the file name is concatenated with the name of each directory in the path, and an attempt is made to open the generated file name. The only way to test if a file can be read in `awk' is to go ahead and try to read it with -`getline'; this is what `pathto' does.(2) If the file can be read, it +`getline'; this is what `pathto()' does.(2) If the file can be read, it is closed and the file name is returned: expand_prog=' @@ -17885,9 +17907,9 @@ is closed and the file name is returned: } The main program is contained inside one `BEGIN' rule. The first -thing it does is set up the `pathlist' array that `pathto' uses. After -splitting the path on `:', null elements are replaced with `"."', which -represents the current directory: +thing it does is set up the `pathlist' array that `pathto()' uses. +After splitting the path on `:', null elements are replaced with `"."', +which represents the current directory: BEGIN { path = ENVIRON["AWKPATH"] @@ -17900,9 +17922,9 @@ represents the current directory: The stack is initialized with `ARGV[1]', which will be `/dev/stdin'. The main loop comes next. Input lines are read in succession. Lines that do not start with `@include' are printed verbatim. If the line -does start with `@include', the file name is in `$2'. `pathto' is -called to generate the full path. If it cannot, then we print an error -message and continue. +does start with `@include', the file name is in `$2'. `pathto()' is +called to generate the full path. If it cannot, then the program +prints an error message and continues. The next thing to check is if the file is included already. The `processed' array is indexed by the full file name of each included @@ -17941,10 +17963,10 @@ 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 - ` + ) The shell construct `COMMAND << MARKER' is called a "here document". Everything in the shell script up to the MARKER is fed to COMMAND as @@ -17952,10 +17974,10 @@ input. The shell processes the contents of the here document for variable and command substitution (and possibly other things as well, depending upon the shell). - The shell construct ``...`' is called "command substitution". The -output of the command between the two backquotes (grave accents) is -substituted into the command line. It is saved as a single string, -even if the results contain whitespace. + The shell construct `$(...)' is called "command substitution". The +output of the command inside the parentheses is substituted into the +command line. Because the result is used in a variable assignment, it +is saved as a single string, even if the results contain whitespace. The expanded program is saved in the variable `processed_program'. It's done in these steps: @@ -17979,14 +18001,14 @@ supplied. The `eval' command is a shell construct that reruns the shell's parsing process. This keeps things properly quoted. - This version of `igawk' represents my fourth attempt at this program. + This version of `igawk' represents my fifth version of this program. There are four key simplifications that make the program work better: * Using `@include' even for the files named with `-f' makes building the initial collected `awk' program much simpler; all the `@include' processing can be done once. - * Not trying to save the line read with `getline' in the `pathto' + * Not trying to save the line read with `getline' in the `pathto()' function when testing for the file's accessibility for use with the main program simplifies things considerably. @@ -18007,9 +18029,7 @@ and it is frequently easier to do certain kinds of string and argument manipulation using the shell than it is in `awk'. Finally, `igawk' shows that it is not always necessary to add new -features to a program; they can often be layered on top. With `igawk', -there is no real reason to build `@include' processing into `gawk' -itself. +features to a program; they can often be layered on top. As an additional example of this, consider the idea of having two files in a directory in the search path: @@ -24722,7 +24742,7 @@ Index (line 131) * advanced features, constants, values of: Nondecimal-numbers. (line 67) -* advanced features, data files as single record: Records. (line 172) +* 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 200) * advanced features, gawk: Advanced Features. (line 6) @@ -25218,7 +25238,7 @@ Index * dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps. (line 43) * dark corner, split() function: String Functions. (line 330) -* dark corner, strings, storing: Records. (line 188) +* dark corner, strings, storing: Records. (line 191) * dark corner, value of ARGV[0]: Auto-set. (line 35) * data, fixed-width: Constant Size. (line 9) * data-driven languages: Basic High Level. (line 85) @@ -25399,14 +25419,14 @@ Index (line 43) * differences in awk and gawk, regular expressions: Case-sensitivity. (line 26) -* differences in awk and gawk, RS/RT variables: Records. (line 164) +* differences in awk and gawk, RS/RT variables: Records. (line 167) * differences in awk and gawk, RT variable: Auto-set. (line 189) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. (line 318) * differences in awk and gawk, strings: Scalar Constants. (line 20) -* differences in awk and gawk, strings, storing: Records. (line 184) +* differences in awk and gawk, strings, storing: Records. (line 187) * differences in awk and gawk, strtonum() function (gawk): String Functions. (line 356) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. @@ -25416,7 +25436,7 @@ Index * directories, changing: Sample Library. (line 6) * directories, command line: Command line directories. (line 6) -* directories, searching <1>: Igawk Program. (line 358) +* directories, searching <1>: Igawk Program. (line 364) * directories, searching: AWKPATH Variable. (line 6) * disable debugger command: Breakpoint Control. (line 62) * display debugger command: Viewing And Changing Data. @@ -25612,7 +25632,7 @@ Index * files, /inet/ (gawk): TCP/IP Networking. (line 6) * files, /inet4/ (gawk): TCP/IP Networking. (line 6) * files, /inet6/ (gawk): TCP/IP Networking. (line 6) -* files, as single records: Records. (line 193) +* files, as single records: Records. (line 196) * files, awk programs in: Long. (line 6) * files, awkprof.out: Profiling. (line 10) * files, awkvars.out: Options. (line 91) @@ -25649,7 +25669,7 @@ Index * files, reading, multiline records: Multiple Line. (line 6) * files, searching for regular expressions: Egrep Program. (line 6) * files, skipping: File Checking. (line 6) -* files, source, search path for: Igawk Program. (line 358) +* files, source, search path for: Igawk Program. (line 364) * files, splitting: Split Program. (line 6) * files, Texinfo, extracting programs from: Extract Program. (line 6) * finish debugger command: Dgawk Execution Control. @@ -25929,7 +25949,7 @@ Index * 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 118) +* igawk.sh program: Igawk Program. (line 124) * ignore debugger command: Breakpoint Control. (line 80) * IGNORECASE variable <1>: User-modified. (line 82) * IGNORECASE variable: Case-sensitivity. (line 26) @@ -26036,7 +26056,7 @@ Index * Kwok, Conrad: Contributors. (line 37) * l debugger command (alias for list): Miscellaneous Dgawk Commands. (line 77) -* labels.awk program: Labels Program. (line 48) +* labels.awk program: Labels Program. (line 51) * languages, data-driven: Basic High Level. (line 85) * LC_ALL locale category: Explaining gettext. (line 120) * LC_COLLATE locale category: Explaining gettext. (line 93) @@ -26392,7 +26412,7 @@ Index (line 113) * portability, close() function and: Close Files And Pipes. (line 81) -* portability, data files as single record: Records. (line 172) +* portability, data files as single record: Records. (line 175) * portability, deleting array elements: Delete. (line 51) * portability, example programs: Library Functions. (line 31) * portability, fflush() function and: I/O Functions. (line 29) @@ -26575,7 +26595,7 @@ Index * records, printing: Print. (line 22) * records, splitting input into: Records. (line 6) * records, terminating: Records. (line 112) -* records, treating files as: Records. (line 193) +* records, treating files as: Records. (line 196) * recursive functions: Definition Syntax. (line 73) * redirection of input: Getline/File. (line 6) * redirection of output: Redirection. (line 6) @@ -26692,7 +26712,7 @@ Index * search paths <1>: VMS Running. (line 28) * search paths: PC Using. (line 11) * search paths, for source files <1>: VMS Running. (line 28) -* search paths, for source files <2>: Igawk Program. (line 358) +* search paths, for source files <2>: Igawk Program. (line 364) * search paths, for source files: AWKPATH Variable. (line 6) * searching: String Functions. (line 126) * searching, files for regular expressions: Egrep Program. (line 6) @@ -26769,7 +26789,7 @@ Index * source code, gawk: Gawk Distribution. (line 6) * source code, mawk: Other Versions. (line 34) * source code, mixing: Options. (line 105) -* source files, search path for: Igawk Program. (line 358) +* source files, search path for: Igawk Program. (line 364) * sparse arrays: Array Intro. (line 71) * Spencer, Henry: Glossary. (line 12) * split utility: Split Program. (line 6) @@ -27165,341 +27185,342 @@ Node: Computed Regexps155297 Node: Locales158714 Node: Reading Files162256 Node: Records164197 -Ref: Records-Footnote-1172763 -Node: Fields172800 -Ref: Fields-Footnote-1175832 -Node: Nonconstant Fields175918 -Node: Changing Fields178120 -Node: Field Separators183405 -Node: Default Field Splitting186034 -Node: Regexp Field Splitting187151 -Node: Single Character Fields190501 -Node: Command Line Field Separator191552 -Node: Field Splitting Summary194991 -Ref: Field Splitting Summary-Footnote-1198177 -Node: Constant Size198278 -Node: Splitting By Content202840 -Ref: Splitting By Content-Footnote-1206566 -Node: Multiple Line206606 -Ref: Multiple Line-Footnote-1212346 -Node: Getline212525 -Node: Plain Getline214753 -Node: Getline/Variable216842 -Node: Getline/File217983 -Node: Getline/Variable/File219305 -Ref: Getline/Variable/File-Footnote-1220904 -Node: Getline/Pipe220991 -Node: Getline/Variable/Pipe223539 -Node: Getline/Coprocess224646 -Node: Getline/Variable/Coprocess225889 -Node: Getline Notes226603 -Node: Getline Summary228545 -Ref: table-getline-variants228829 -Node: Command line directories229734 -Node: Printing230359 -Node: Print231990 -Node: Print Examples233327 -Node: Output Separators236111 -Node: OFMT237870 -Node: Printf239228 -Node: Basic Printf240134 -Node: Control Letters241671 -Node: Format Modifiers245483 -Node: Printf Examples251494 -Node: Redirection254209 -Node: Special Files261187 -Node: Special FD261720 -Ref: Special FD-Footnote-1265295 -Node: Special Network265369 -Node: Special Caveats266224 -Node: Close Files And Pipes267018 -Ref: Close Files And Pipes-Footnote-1273962 -Ref: Close Files And Pipes-Footnote-2274110 -Node: Expressions274260 -Node: Values275329 -Node: Constants276005 -Node: Scalar Constants276685 -Ref: Scalar Constants-Footnote-1277544 -Node: Nondecimal-numbers277726 -Node: Regexp Constants280785 -Node: Using Constant Regexps281260 -Node: Variables284265 -Node: Using Variables284920 -Node: Assignment Options286647 -Node: Conversion288528 -Ref: table-locale-affects293902 -Ref: Conversion-Footnote-1294526 -Node: All Operators294635 -Node: Arithmetic Ops295265 -Node: Concatenation297764 -Ref: Concatenation-Footnote-1300557 -Node: Assignment Ops300676 -Ref: table-assign-ops305664 -Node: Increment Ops307065 -Node: Truth Values and Conditions310543 -Node: Truth Values311626 -Node: Typing and Comparison312674 -Node: Variable Typing313463 -Ref: Variable Typing-Footnote-1317360 -Node: Comparison Operators317482 -Ref: table-relational-ops317892 -Node: POSIX String Comparison321441 -Ref: POSIX String Comparison-Footnote-1322398 -Node: Boolean Ops322536 -Ref: Boolean Ops-Footnote-1326614 -Node: Conditional Exp326705 -Node: Function Calls328437 -Node: Precedence331996 -Node: Patterns and Actions335649 -Node: Pattern Overview336703 -Node: Regexp Patterns338369 -Node: Expression Patterns338912 -Node: Ranges342486 -Node: BEGIN/END345452 -Node: Using BEGIN/END346202 -Ref: Using BEGIN/END-Footnote-1348933 -Node: I/O And BEGIN/END349047 -Node: Empty351316 -Node: BEGINFILE/ENDFILE351650 -Node: Using Shell Variables354475 -Node: Action Overview356754 -Node: Statements359111 -Node: If Statement360970 -Node: While Statement362469 -Node: Do Statement364513 -Node: For Statement365669 -Node: Switch Statement368821 -Node: Break Statement370918 -Node: Continue Statement372894 -Node: Next Statement374595 -Node: Nextfile Statement376977 -Node: Exit Statement379495 -Node: Built-in Variables381826 -Node: User-modified382921 -Ref: User-modified-Footnote-1390922 -Node: Auto-set390984 -Ref: Auto-set-Footnote-1399967 -Node: ARGC and ARGV400172 -Node: Arrays403931 -Node: Array Basics405502 -Node: Array Intro406213 -Node: Reference to Elements410531 -Node: Assigning Elements412801 -Node: Array Example413292 -Node: Scanning an Array415024 -Node: Delete417301 -Ref: Delete-Footnote-1419699 -Node: Numeric Array Subscripts419756 -Node: Uninitialized Subscripts421939 -Node: Multi-dimensional423567 -Node: Multi-scanning426658 -Node: Array Sorting428242 -Ref: Array Sorting-Footnote-1431440 -Node: Arrays of Arrays431634 -Node: Functions435796 -Node: Built-in436618 -Node: Calling Built-in437632 -Node: Numeric Functions439608 -Ref: Numeric Functions-Footnote-1443317 -Ref: Numeric Functions-Footnote-2443653 -Ref: Numeric Functions-Footnote-3443701 -Node: String Functions443970 -Ref: String Functions-Footnote-1465769 -Ref: String Functions-Footnote-2465898 -Ref: String Functions-Footnote-3466146 -Node: Gory Details466233 -Ref: table-sub-escapes467890 -Ref: table-posix-sub469204 -Ref: table-gensub-escapes470104 -Node: I/O Functions471275 -Ref: I/O Functions-Footnote-1477972 -Node: Time Functions478119 -Ref: Time Functions-Footnote-1488986 -Ref: Time Functions-Footnote-2489054 -Ref: Time Functions-Footnote-3489212 -Ref: Time Functions-Footnote-4489323 -Ref: Time Functions-Footnote-5489435 -Ref: Time Functions-Footnote-6489662 -Node: Bitwise Functions489928 -Ref: table-bitwise-ops490486 -Ref: Bitwise Functions-Footnote-1494646 -Node: I18N Functions494830 -Node: User-defined496460 -Node: Definition Syntax497264 -Ref: Definition Syntax-Footnote-1501894 -Node: Function Example501963 -Node: Function Caveats504557 -Node: Calling A Function504978 -Node: Variable Scope506067 -Node: Pass By Value/Reference507995 -Node: Return Statement511435 -Node: Dynamic Typing514377 -Node: Indirect Calls515114 -Node: Internationalization524799 -Node: I18N and L10N526227 -Node: Explaining gettext526913 -Ref: Explaining gettext-Footnote-1531975 -Ref: Explaining gettext-Footnote-2532158 -Node: Programmer i18n532323 -Node: Translator i18n536586 -Node: String Extraction537379 -Ref: String Extraction-Footnote-1538340 -Node: Printf Ordering538426 -Ref: Printf Ordering-Footnote-1541210 -Node: I18N Portability541274 -Ref: I18N Portability-Footnote-1543723 -Node: I18N Example543786 -Ref: I18N Example-Footnote-1546421 -Node: Gawk I18N546493 -Node: Advanced Features547062 -Node: Nondecimal Data548381 -Node: Two-way I/O549942 -Ref: Two-way I/O-Footnote-1555356 -Node: TCP/IP Networking555433 -Node: Profiling558205 -Node: Library Functions565605 -Ref: Library Functions-Footnote-1568575 -Node: Library Names568746 -Ref: Library Names-Footnote-1572217 -Ref: Library Names-Footnote-2572437 -Node: General Functions572523 -Node: Nextfile Function573586 -Node: Strtonum Function577967 -Node: Assert Function580918 -Node: Round Function584244 -Node: Cliff Random Function585785 -Node: Ordinal Functions586801 -Ref: Ordinal Functions-Footnote-1589871 -Ref: Ordinal Functions-Footnote-2590123 -Node: Join Function590339 -Ref: Join Function-Footnote-1592110 -Node: Gettimeofday Function592310 -Node: Data File Management596025 -Node: Filetrans Function596657 -Node: Rewind Function600894 -Node: File Checking602347 -Node: Empty Files603441 -Node: Ignoring Assigns605671 -Node: Getopt Function607224 -Ref: Getopt Function-Footnote-1618549 -Node: Passwd Functions618752 -Ref: Passwd Functions-Footnote-1627740 -Node: Group Functions627828 -Node: Sample Programs635908 -Node: Running Examples636573 -Node: Clones637301 -Node: Cut Program638424 -Node: Egrep Program648265 -Ref: Egrep Program-Footnote-1656036 -Node: Id Program656146 -Node: Split Program659762 -Ref: Split Program-Footnote-1663281 -Node: Tee Program663409 -Node: Uniq Program666212 -Node: Wc Program673635 -Ref: Wc Program-Footnote-1677899 -Node: Miscellaneous Programs678099 -Node: Dupword Program679219 -Node: Alarm Program681250 -Node: Translate Program685972 -Ref: Translate Program-Footnote-1690351 -Ref: Translate Program-Footnote-2690579 -Node: Labels Program690713 -Ref: Labels Program-Footnote-1694004 -Node: Word Sorting694088 -Node: History Sorting698435 -Node: Extract Program700273 -Node: Simple Sed707636 -Node: Igawk Program710697 -Ref: Igawk Program-Footnote-1725432 -Ref: Igawk Program-Footnote-2725633 -Node: Signature Program725771 -Node: Debugger726851 -Node: Debugging727727 -Node: Debugging Concepts728041 -Node: Debugging Terms729894 -Node: Awk Debugging732442 -Node: Sample dgawk session733334 -Node: dgawk invocation733826 -Node: Finding The Bug735010 -Node: List of Debugger Commands741541 -Node: Breakpoint Control742856 -Node: Dgawk Execution Control746066 -Node: Viewing And Changing Data749415 -Node: Dgawk Stack752711 -Node: Dgawk Info754172 -Node: Miscellaneous Dgawk Commands758110 -Node: Readline Support763826 -Node: Dgawk Limitations764642 -Node: Language History766814 -Node: V7/SVR3.1768191 -Node: SVR4770486 -Node: POSIX771931 -Node: BTL773643 -Node: POSIX/GNU775333 -Node: Contributors785139 -Node: Installation788748 -Node: Gawk Distribution789719 -Node: Getting790203 -Node: Extracting791029 -Node: Distribution contents792417 -Node: Unix Installation797490 -Node: Quick Installation798081 -Node: Additional Configuration Options799783 -Node: Configuration Philosophy801546 -Node: Non-Unix Installation803910 -Node: PC Installation804375 -Node: PC Binary Installation805650 -Node: PC Compiling807493 -Node: PC Testing810899 -Node: PC Using811720 -Node: Cygwin815887 -Node: MSYS816880 -Node: VMS Installation817388 -Node: VMS Compilation817992 -Node: VMS Installation Details819569 -Node: VMS Running821199 -Node: VMS POSIX822796 -Node: VMS Old Gawk824094 -Node: Unsupported824563 -Node: Atari Installation825025 -Node: Atari Compiling826312 -Node: Atari Using828201 -Node: BeOS Installation831048 -Node: Tandem Installation832193 -Node: Bugs833872 -Node: Other Versions837704 -Node: Notes843067 -Node: Compatibility Mode843759 -Node: Additions844542 -Node: Adding Code845292 -Node: New Ports851344 -Node: Dynamic Extensions855476 -Node: Internals856857 -Node: Plugin License867262 -Node: Sample Library867896 -Node: Internal File Description868560 -Node: Internal File Ops872255 -Ref: Internal File Ops-Footnote-1877131 -Node: Using Internal File Ops877279 -Node: Future Extensions879304 -Node: Basic Concepts883341 -Node: Basic High Level884098 -Ref: Basic High Level-Footnote-1888217 -Node: Basic Data Typing888411 -Node: Floating Point Issues892848 -Node: String Conversion Precision893931 -Ref: String Conversion Precision-Footnote-1895625 -Node: Unexpected Results895734 -Node: POSIX Floating Point Problems897560 -Ref: POSIX Floating Point Problems-Footnote-1901259 -Node: Glossary901297 -Node: Copying925080 -Node: GNU Free Documentation License962637 -Node: next-edition987781 -Node: unresolved988133 -Node: revision988633 -Node: consistency989056 -Node: Index992409 +Ref: Records-Footnote-1172869 +Node: Fields172906 +Ref: Fields-Footnote-1175938 +Node: Nonconstant Fields176024 +Node: Changing Fields178226 +Node: Field Separators183511 +Node: Default Field Splitting186140 +Node: Regexp Field Splitting187257 +Node: Single Character Fields190607 +Node: Command Line Field Separator191658 +Node: Field Splitting Summary195097 +Ref: Field Splitting Summary-Footnote-1198283 +Node: Constant Size198384 +Node: Splitting By Content202946 +Ref: Splitting By Content-Footnote-1206672 +Node: Multiple Line206712 +Ref: Multiple Line-Footnote-1212559 +Node: Getline212738 +Node: Plain Getline214966 +Node: Getline/Variable217055 +Node: Getline/File218196 +Node: Getline/Variable/File219518 +Ref: Getline/Variable/File-Footnote-1221117 +Node: Getline/Pipe221204 +Node: Getline/Variable/Pipe223752 +Node: Getline/Coprocess224859 +Node: Getline/Variable/Coprocess226102 +Node: Getline Notes226816 +Node: Getline Summary228758 +Ref: table-getline-variants229042 +Node: Command line directories229947 +Node: Printing230572 +Node: Print232203 +Node: Print Examples233540 +Node: Output Separators236324 +Node: OFMT238083 +Node: Printf239441 +Node: Basic Printf240347 +Node: Control Letters241884 +Node: Format Modifiers245696 +Node: Printf Examples251707 +Node: Redirection254422 +Node: Special Files261400 +Node: Special FD261933 +Ref: Special FD-Footnote-1265508 +Node: Special Network265582 +Node: Special Caveats266437 +Node: Close Files And Pipes267231 +Ref: Close Files And Pipes-Footnote-1274175 +Ref: Close Files And Pipes-Footnote-2274323 +Node: Expressions274473 +Node: Values275542 +Node: Constants276218 +Node: Scalar Constants276898 +Ref: Scalar Constants-Footnote-1277757 +Node: Nondecimal-numbers277939 +Node: Regexp Constants280998 +Node: Using Constant Regexps281473 +Node: Variables284478 +Node: Using Variables285133 +Node: Assignment Options286860 +Node: Conversion288741 +Ref: table-locale-affects294115 +Ref: Conversion-Footnote-1294739 +Node: All Operators294848 +Node: Arithmetic Ops295478 +Node: Concatenation297977 +Ref: Concatenation-Footnote-1300770 +Node: Assignment Ops300889 +Ref: table-assign-ops305877 +Node: Increment Ops307278 +Node: Truth Values and Conditions310756 +Node: Truth Values311839 +Node: Typing and Comparison312887 +Node: Variable Typing313676 +Ref: Variable Typing-Footnote-1317573 +Node: Comparison Operators317695 +Ref: table-relational-ops318105 +Node: POSIX String Comparison321654 +Ref: POSIX String Comparison-Footnote-1322611 +Node: Boolean Ops322749 +Ref: Boolean Ops-Footnote-1326827 +Node: Conditional Exp326918 +Node: Function Calls328650 +Node: Precedence332209 +Node: Patterns and Actions335862 +Node: Pattern Overview336916 +Node: Regexp Patterns338582 +Node: Expression Patterns339125 +Node: Ranges342699 +Node: BEGIN/END345665 +Node: Using BEGIN/END346415 +Ref: Using BEGIN/END-Footnote-1349146 +Node: I/O And BEGIN/END349260 +Node: Empty351529 +Node: BEGINFILE/ENDFILE351863 +Node: Using Shell Variables354688 +Node: Action Overview356967 +Node: Statements359324 +Node: If Statement361183 +Node: While Statement362682 +Node: Do Statement364726 +Node: For Statement365882 +Node: Switch Statement369034 +Node: Break Statement371131 +Node: Continue Statement373107 +Node: Next Statement374808 +Node: Nextfile Statement377190 +Node: Exit Statement379708 +Node: Built-in Variables382039 +Node: User-modified383134 +Ref: User-modified-Footnote-1391135 +Node: Auto-set391197 +Ref: Auto-set-Footnote-1400180 +Node: ARGC and ARGV400385 +Node: Arrays404144 +Node: Array Basics405715 +Node: Array Intro406426 +Node: Reference to Elements410744 +Node: Assigning Elements413014 +Node: Array Example413505 +Node: Scanning an Array415237 +Node: Delete417514 +Ref: Delete-Footnote-1419912 +Node: Numeric Array Subscripts419969 +Node: Uninitialized Subscripts422152 +Node: Multi-dimensional423780 +Node: Multi-scanning426871 +Node: Array Sorting428455 +Ref: Array Sorting-Footnote-1431653 +Node: Arrays of Arrays431847 +Node: Functions436009 +Node: Built-in436831 +Node: Calling Built-in437845 +Node: Numeric Functions439821 +Ref: Numeric Functions-Footnote-1443530 +Ref: Numeric Functions-Footnote-2443866 +Ref: Numeric Functions-Footnote-3443914 +Node: String Functions444183 +Ref: String Functions-Footnote-1465982 +Ref: String Functions-Footnote-2466111 +Ref: String Functions-Footnote-3466359 +Node: Gory Details466446 +Ref: table-sub-escapes468103 +Ref: table-posix-sub469417 +Ref: table-gensub-escapes470317 +Node: I/O Functions471488 +Ref: I/O Functions-Footnote-1478185 +Node: Time Functions478332 +Ref: Time Functions-Footnote-1489199 +Ref: Time Functions-Footnote-2489267 +Ref: Time Functions-Footnote-3489425 +Ref: Time Functions-Footnote-4489536 +Ref: Time Functions-Footnote-5489648 +Ref: Time Functions-Footnote-6489875 +Node: Bitwise Functions490141 +Ref: table-bitwise-ops490699 +Ref: Bitwise Functions-Footnote-1494859 +Node: I18N Functions495043 +Node: User-defined496673 +Node: Definition Syntax497477 +Ref: Definition Syntax-Footnote-1502107 +Node: Function Example502176 +Node: Function Caveats504770 +Node: Calling A Function505191 +Node: Variable Scope506280 +Node: Pass By Value/Reference508208 +Node: Return Statement511648 +Node: Dynamic Typing514590 +Node: Indirect Calls515327 +Node: Internationalization525012 +Node: I18N and L10N526440 +Node: Explaining gettext527126 +Ref: Explaining gettext-Footnote-1532188 +Ref: Explaining gettext-Footnote-2532371 +Node: Programmer i18n532536 +Node: Translator i18n536799 +Node: String Extraction537592 +Ref: String Extraction-Footnote-1538553 +Node: Printf Ordering538639 +Ref: Printf Ordering-Footnote-1541423 +Node: I18N Portability541487 +Ref: I18N Portability-Footnote-1543936 +Node: I18N Example543999 +Ref: I18N Example-Footnote-1546634 +Node: Gawk I18N546706 +Node: Advanced Features547275 +Node: Nondecimal Data548594 +Node: Two-way I/O550155 +Ref: Two-way I/O-Footnote-1555569 +Node: TCP/IP Networking555646 +Node: Profiling558418 +Node: Library Functions565818 +Ref: Library Functions-Footnote-1568788 +Node: Library Names568959 +Ref: Library Names-Footnote-1572430 +Ref: Library Names-Footnote-2572650 +Node: General Functions572736 +Node: Nextfile Function573799 +Node: Strtonum Function578180 +Node: Assert Function581131 +Node: Round Function584457 +Node: Cliff Random Function585998 +Node: Ordinal Functions587014 +Ref: Ordinal Functions-Footnote-1590084 +Ref: Ordinal Functions-Footnote-2590336 +Node: Join Function590552 +Ref: Join Function-Footnote-1592323 +Node: Gettimeofday Function592523 +Node: Data File Management596238 +Node: Filetrans Function596870 +Node: Rewind Function601107 +Node: File Checking602560 +Node: Empty Files603654 +Node: Ignoring Assigns605884 +Node: Getopt Function607437 +Ref: Getopt Function-Footnote-1618762 +Node: Passwd Functions618965 +Ref: Passwd Functions-Footnote-1627953 +Node: Group Functions628041 +Node: Sample Programs636121 +Node: Running Examples636786 +Node: Clones637514 +Node: Cut Program638637 +Node: Egrep Program648478 +Ref: Egrep Program-Footnote-1656249 +Node: Id Program656359 +Node: Split Program659975 +Ref: Split Program-Footnote-1663494 +Node: Tee Program663622 +Node: Uniq Program666425 +Node: Wc Program673848 +Ref: Wc Program-Footnote-1678112 +Node: Miscellaneous Programs678312 +Node: Dupword Program679432 +Node: Alarm Program681463 +Node: Translate Program686185 +Ref: Translate Program-Footnote-1690564 +Ref: Translate Program-Footnote-2690792 +Node: Labels Program690926 +Ref: Labels Program-Footnote-1694297 +Node: Word Sorting694381 +Node: History Sorting698726 +Node: Extract Program700564 +Ref: Extract Program-Footnote-1707990 +Node: Simple Sed708118 +Node: Igawk Program711180 +Ref: Igawk Program-Footnote-1726214 +Ref: Igawk Program-Footnote-2726415 +Node: Signature Program726553 +Node: Debugger727633 +Node: Debugging728509 +Node: Debugging Concepts728823 +Node: Debugging Terms730676 +Node: Awk Debugging733224 +Node: Sample dgawk session734116 +Node: dgawk invocation734608 +Node: Finding The Bug735792 +Node: List of Debugger Commands742323 +Node: Breakpoint Control743638 +Node: Dgawk Execution Control746848 +Node: Viewing And Changing Data750197 +Node: Dgawk Stack753493 +Node: Dgawk Info754954 +Node: Miscellaneous Dgawk Commands758892 +Node: Readline Support764608 +Node: Dgawk Limitations765424 +Node: Language History767596 +Node: V7/SVR3.1768973 +Node: SVR4771268 +Node: POSIX772713 +Node: BTL774425 +Node: POSIX/GNU776115 +Node: Contributors785921 +Node: Installation789530 +Node: Gawk Distribution790501 +Node: Getting790985 +Node: Extracting791811 +Node: Distribution contents793199 +Node: Unix Installation798272 +Node: Quick Installation798863 +Node: Additional Configuration Options800565 +Node: Configuration Philosophy802328 +Node: Non-Unix Installation804692 +Node: PC Installation805157 +Node: PC Binary Installation806432 +Node: PC Compiling808275 +Node: PC Testing811681 +Node: PC Using812502 +Node: Cygwin816669 +Node: MSYS817662 +Node: VMS Installation818170 +Node: VMS Compilation818774 +Node: VMS Installation Details820351 +Node: VMS Running821981 +Node: VMS POSIX823578 +Node: VMS Old Gawk824876 +Node: Unsupported825345 +Node: Atari Installation825807 +Node: Atari Compiling827094 +Node: Atari Using828983 +Node: BeOS Installation831830 +Node: Tandem Installation832975 +Node: Bugs834654 +Node: Other Versions838486 +Node: Notes843849 +Node: Compatibility Mode844541 +Node: Additions845324 +Node: Adding Code846074 +Node: New Ports852126 +Node: Dynamic Extensions856258 +Node: Internals857639 +Node: Plugin License868044 +Node: Sample Library868678 +Node: Internal File Description869342 +Node: Internal File Ops873037 +Ref: Internal File Ops-Footnote-1877913 +Node: Using Internal File Ops878061 +Node: Future Extensions880086 +Node: Basic Concepts884123 +Node: Basic High Level884880 +Ref: Basic High Level-Footnote-1888999 +Node: Basic Data Typing889193 +Node: Floating Point Issues893630 +Node: String Conversion Precision894713 +Ref: String Conversion Precision-Footnote-1896407 +Node: Unexpected Results896516 +Node: POSIX Floating Point Problems898342 +Ref: POSIX Floating Point Problems-Footnote-1902041 +Node: Glossary902079 +Node: Copying925862 +Node: GNU Free Documentation License963419 +Node: next-edition988563 +Node: unresolved988915 +Node: revision989415 +Node: consistency989838 +Node: Index993191 End Tag Table |