diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-06-13 08:09:13 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-06-13 08:09:13 +0300 |
commit | bc63f89e6cc42d55c6f98cd506d9cf0336f94196 (patch) | |
tree | d56f03282297ba5b5005573c618e1add3ba5f0ca | |
parent | af22ae5e8cfbea8a31583975bc6b5daf1d9a6c48 (diff) | |
parent | 4f04830cdcef50ac2449b6dbc97c67acc4ec238d (diff) | |
download | egawk-bc63f89e6cc42d55c6f98cd506d9cf0336f94196.tar.gz egawk-bc63f89e6cc42d55c6f98cd506d9cf0336f94196.tar.bz2 egawk-bc63f89e6cc42d55c6f98cd506d9cf0336f94196.zip |
Merge branch 'gawk-4.1-stable'
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 1501 | ||||
-rw-r--r-- | doc/gawk.texi | 156 | ||||
-rw-r--r-- | doc/gawktexi.in | 154 |
4 files changed, 913 insertions, 903 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog index cd175516..79e49f7e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-06-13 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Fix typos from changes of 3 June when macros were + added for filename, data file, etc. Ooops. + 2014-06-12 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: More "Summary" sections. Through chapter 14. diff --git a/doc/gawk.info b/doc/gawk.info index 33dc1f01..1ed56125 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -1490,7 +1490,7 @@ tell `awk' to use that file for its program, you type: awk -f SOURCE-FILE INPUT-FILE1 INPUT-FILE2 ... The `-f' instructs the `awk' utility to get the `awk' program from -the file SOURCE-FILE. Any FN can be used for SOURCE-FILE. For +the file SOURCE-FILE. Any file name can be used for SOURCE-FILE. For example, you could put the program: BEGIN { print "Don't Panic!" } @@ -1504,15 +1504,16 @@ does the same thing as this one: awk "BEGIN { print \"Don't Panic!\" }" This was explained earlier (*note Read Terminal::). Note that you -don't usually need single quotes around the FN that you specify with -`-f', because most FNs don't contain any of the shell's special -characters. Notice that in `advice', the `awk' program did not have -single quotes around it. The quotes are only needed for programs that -are provided on the `awk' command line. +don't usually need single quotes around the file name that you specify +with `-f', because most file names don't contain any of the shell's +special characters. Notice that in `advice', the `awk' program did not +have single quotes around it. The quotes are only needed for programs +that are provided on the `awk' command line. If you want to clearly identify your `awk' program files as such, -you can add the extension `.awk' to the FN. This doesn't affect the -execution of the `awk' program but it does make "housekeeping" easier. +you can add the extension `.awk' to the file name. This doesn't affect +the execution of the `awk' program but it does make "housekeeping" +easier. File: gawk.info, Node: Executable Scripts, Next: Comments, Prev: Long, Up: Running gawk @@ -1567,14 +1568,14 @@ the name of your script (`advice'). (d.c.) Don't rely on the value of (1) The `#!' mechanism works on GNU/Linux systems, BSD-based systems and commercial Unix systems. - (2) The line beginning with `#!' lists the full FN of an interpreter -to run and an optional initial command-line argument to pass to that -interpreter. The operating system then runs the interpreter with the -given argument and the full argument list of the executed program. The -first argument in the list is the full FN of the `awk' program. The -rest of the argument list contains either options to `awk', or data -files, or both. Note that on many systems `awk' may be found in -`/usr/bin' instead of in `/bin'. Caveat Emptor. + (2) The line beginning with `#!' lists the full file name of an +interpreter to run and an optional initial command-line argument to +pass to that interpreter. The operating system then runs the +interpreter with the given argument and the full argument list of the +executed program. The first argument in the list is the full file name +of the `awk' program. The rest of the argument list contains either +options to `awk', or data files, or both. Note that on many systems +`awk' may be found in `/usr/bin' instead of in `/bin'. Caveat Emptor. File: gawk.info, Node: Comments, Next: Quoting, Prev: Executable Scripts, Up: Running gawk @@ -1714,9 +1715,9 @@ the quoting rules. awk -F"" 'PROGRAM' FILES # wrong! In the second case, `awk' will attempt to use the text of the - program as the value of `FS', and the first FN as the text of the - program! This results in syntax errors at best, and confusing - behavior at worst. + program as the value of `FS', and the first file name as the text + of the program! This results in syntax errors at best, and + confusing behavior at worst. Mixing single and double quotes is difficult. You have to resort to shell quoting tricks, like this: @@ -1895,9 +1896,9 @@ description of the program will give you a good idea of what is going on, but please read the rest of the Info file to become an `awk' expert!) Most of the examples use a data file named `data'. This is just a placeholder; if you use these programs yourself, substitute your -own FNs for `data'. For future reference, note that there is often -more than one way to do things in `awk'. At some point, you may want -to look back at these examples and see if you can come up with +own file names for `data'. For future reference, note that there is +often more than one way to do things in `awk'. At some point, you may +want to look back at these examples and see if you can come up with different ways to do the same things shown here: * Print the length of the longest input line: @@ -2041,7 +2042,7 @@ identifies the owner of the file. The fourth field identifies the group of the file. The fifth field contains the size of the file in bytes. The sixth, seventh, and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field -contains the FN.(1) +contains the file name.(1) The `$6 == "Nov"' in our `awk' program is an expression that tests whether the sixth field of the output from `ls -l' matches the string @@ -2380,10 +2381,10 @@ The following list describes options mandated by the POSIX standard: This interpretation of `--' follows the POSIX argument parsing conventions. - This is useful if you have FNs that start with `-', or in shell - scripts, if you have FNs that will be specified by the user that - could start with `-'. It is also useful for passing options on to - the `awk' program; see *note Getopt Function::. + This is useful if you have file names that start with `-', or in + shell scripts, if you have file names that will be specified by + the user that could start with `-'. It is also useful for passing + options on to the `awk' program; see *note Getopt Function::. The following list describes `gawk'-specific options: @@ -2548,8 +2549,8 @@ The following list describes options mandated by the POSIX standard: Enable pretty-printing of `awk' programs. By default, output program is created in a file named `awkprof.out' (*note Profiling::). The optional FILE argument allows you to specify a - different FN for the output. No space is allowed between the `-o' - and FILE, if FILE is supplied. + different file name for the output. No space is allowed between + the `-o' and FILE, if FILE is supplied. NOTE: Due to the way `gawk' has evolved, with this option your program is still executed. This will change in the next @@ -2565,9 +2566,9 @@ The following list describes options mandated by the POSIX standard: `--profile'[`='FILE] Enable profiling of `awk' programs (*note Profiling::). By default, profiles are created in a file named `awkprof.out'. The - optional FILE argument allows you to specify a different FN for - the profile file. No space is allowed between the `-p' and FILE, - if FILE is supplied. + optional FILE argument allows you to specify a different file name + for the profile file. No space is allowed between the `-p' and + FILE, if FILE is supplied. The profile contains execution counts for each statement in the program in the left margin, and function call counts for each @@ -2708,11 +2709,11 @@ arguments, including variable assignments, are included. As each element of `ARGV' is processed, `gawk' sets the variable `ARGIND' to the index in `ARGV' of the current element. - The distinction between FN arguments and variable-assignment + The distinction between file name arguments and variable-assignment arguments is made when `awk' is about to open the next input file. At -that point in execution, it checks the FN to see whether it is really a -variable assignment; if so, `awk' sets the variable instead of reading -a file. +that point in execution, it checks the file name to see whether it is +really a variable assignment; if so, `awk' sets the variable instead of +reading a file. Therefore, the variables actually receive the given values after all previously specified files have been read. In particular, the values of @@ -2724,13 +2725,13 @@ begins scanning the argument list. escape sequences (*note Escape Sequences::). (d.c.) In some very early implementations of `awk', when a variable -assignment occurred before any FNs, the assignment would happen _before_ -the `BEGIN' rule was executed. `awk''s behavior was thus inconsistent; -some command-line assignments were available inside the `BEGIN' rule, -while others were not. Unfortunately, some applications came to depend -upon this "feature." When `awk' was changed to be more consistent, the -`-v' option was added to accommodate applications that depended upon -the old behavior. +assignment occurred before any file names, the assignment would happen +_before_ the `BEGIN' rule was executed. `awk''s behavior was thus +inconsistent; some command-line assignments were available inside the +`BEGIN' rule, while others were not. Unfortunately, some applications +came to depend upon this "feature." When `awk' was changed to be more +consistent, the `-v' option was added to accommodate applications that +depended upon the old behavior. The variable assignment feature is most useful for assigning to variables such as `RS', `OFS', and `ORS', which control input and @@ -2766,11 +2767,11 @@ SOME_COMMAND, and finally it reads `file2'. You may also use `"-"' to name standard input when reading files with `getline' (*note Getline/File::). - In addition, `gawk' allows you to specify the special FN + In addition, `gawk' allows you to specify the special file name `/dev/stdin', both on the command line and with `getline'. Some other versions of `awk' also support this, but it is not standard. (Some operating systems provide a `/dev/stdin' file in the file system; -however, `gawk' always processes this FN itself.) +however, `gawk' always processes this file name itself.) File: gawk.info, Node: Environment Variables, Next: Exit Status, Prev: Naming Standard Input, Up: Invoking Gawk @@ -2798,7 +2799,7 @@ The previous minor node described how `awk' program files can be named on the command-line with the `-f' option. In most `awk' implementations, you must supply a precise path name for each program file, unless the file is in the current directory. But in `gawk', if -the FN supplied to the `-f' or `-i' options does not contain a +the file name supplied to the `-f' or `-i' options does not contain a directory separator `/', then `gawk' searches a list of directories (called the "search path"), one by one, looking for a file with the specified name. @@ -2811,8 +2812,8 @@ variable. If that variable does not exist, `gawk' uses a default path, The search path feature is particularly helpful for building libraries of useful `awk' functions. The library files can be placed in a standard directory in the default path and then specified on the -command line with a short FN. Otherwise, the full FN would have to be -typed for each file. +command line with a short file name. Otherwise, the full file name +would have to be typed for each file. By using the `-i' option, or the `--source' and `-f' options, your command-line `awk' programs can use facilities in `awk' library files @@ -3020,8 +3021,8 @@ and here is `test2': use `@include' followed by the name of the file to be included, enclosed in double quotes. - NOTE: Keep in mind that this is a language construct and the FN - cannot be a string variable, but rather just a literal string + NOTE: Keep in mind that this is a language construct and the file + name cannot be a string variable, but rather just a literal string constant in double quotes. The files to be included may be nested; e.g., given a third script, @@ -3039,7 +3040,7 @@ Running `gawk' with the `test3' script produces the following results: -| This is file test2. -| This is file test3. - The FN can, of course, be a pathname. For example: + The file name can, of course, be a pathname. For example: @include "../io_funcs" @@ -5432,11 +5433,11 @@ File: gawk.info, Node: Getline/File, Next: Getline/Variable/File, Prev: Getli --------------------------------- Use `getline < FILE' to read the next record from FILE. Here FILE is a -string-valued expression that specifies the FN. `< FILE' is called a -"redirection" because it directs input to come from a different place. -For example, the following program reads its input record from the file -`secondary.input' when it encounters a first field with a value equal -to 10 in the current input file: +string-valued expression that specifies the file name. `< FILE' is +called a "redirection" because it directs input to come from a +different place. For example, the following program reads its input +record from the file `secondary.input' when it encounters a first field +with a value equal to 10 in the current input file: { if ($1 == 10) { @@ -5938,8 +5939,8 @@ OFMT::.) For printing with specifications, you need the `printf' statement (*note Printf::). Besides basic and formatted printing, this major node also covers -I/O redirections to files and pipes, introduces the special FNs that -`gawk' processes internally, and discusses the `close()' built-in +I/O redirections to files and pipes, introduces the special file names +that `gawk' processes internally, and discusses the `close()' built-in function. * Menu: @@ -6576,8 +6577,9 @@ work identically for `printf': `print ITEMS > OUTPUT-FILE' This redirection prints the items into the output file named - OUTPUT-FILE. The FN OUTPUT-FILE can be any expression. Its value - is changed to a string and then used as a FN (*note Expressions::). + OUTPUT-FILE. The file name OUTPUT-FILE can be any expression. + Its value is changed to a string and then used as a file name + (*note Expressions::). When this type of redirection is used, the OUTPUT-FILE is erased before the first output is written to it. Subsequent writes to @@ -6695,9 +6697,9 @@ underlying operating system permits. A particularly powerful way to use redirection is to build command lines and pipe them into the shell, `sh'. For example, suppose you -have a list of files brought over from a system where all the FNs are -stored in uppercase, and you wish to rename them to have names in all -lowercase. The following program is both simple and efficient: +have a list of files brought over from a system where all the file names +are stored in uppercase, and you wish to rename them to have names in +all lowercase. The following program is both simple and efficient: { printf("mv %s %s\n", $0, tolower($0)) | "sh" } @@ -6714,9 +6716,9 @@ File: gawk.info, Node: Special Files, Next: Close Files And Pipes, Prev: Redi 5.7 Special File Name in `gawk' =============================== -`gawk' provides a number of special FNs that it interprets internally. -These FNs provide access to standard file descriptors and TCP/IP -networking. +`gawk' provides a number of special file names that it interprets +internally. These file names provide access to standard file +descriptors and TCP/IP networking. * Menu: @@ -6762,13 +6764,13 @@ happens, writing to the screen is not correct. In fact, if `awk' is run from a background job, it may not have a terminal at all. Then opening `/dev/tty' fails. - `gawk' provides special FNs for accessing the three standard + `gawk' provides special file names for accessing the three standard streams. (c.e.) It also provides syntax for accessing any other -inherited open files. If the FN matches one of these special names -when `gawk' redirects input or output, then it directly uses the stream -that the FN stands for. These special FNs work for all operating -systems that `gawk' has been ported to, not just those that are -POSIX-compliant: +inherited open files. If the file name matches one of these special +names when `gawk' redirects input or output, then it directly uses the +stream that the file name stands for. These special file names work +for all operating systems that `gawk' has been ported to, not just +those that are POSIX-compliant: `/dev/stdin' The standard input (file descriptor 0). @@ -6785,18 +6787,18 @@ POSIX-compliant: the shell). Unless special pains are taken in the shell from which `gawk' is invoked, only descriptors 0, 1, and 2 are available. - The FNs `/dev/stdin', `/dev/stdout', and `/dev/stderr' are aliases -for `/dev/fd/0', `/dev/fd/1', and `/dev/fd/2', respectively. However, -they are more self-explanatory. The proper way to write an error -message in a `gawk' program is to use `/dev/stderr', like this: + The file names `/dev/stdin', `/dev/stdout', and `/dev/stderr' are +aliases for `/dev/fd/0', `/dev/fd/1', and `/dev/fd/2', respectively. +However, they are more self-explanatory. The proper way to write an +error message in a `gawk' program is to use `/dev/stderr', like this: print "Serious error detected!" > "/dev/stderr" - Note the use of quotes around the FN. Like any other redirection, -the value must be a string. It is a common error to omit the quotes, -which leads to confusing results. + Note the use of quotes around the file name. Like any other +redirection, the value must be a string. It is a common error to omit +the quotes, which leads to confusing results. - Finally, using the `close()' function on a FN of the form + Finally, using the `close()' function on a file name of the form `"/dev/fd/N"', for file descriptor numbers above two, does actually close the given file descriptor. @@ -6814,15 +6816,16 @@ File: gawk.info, Node: Special Network, Next: Special Caveats, Prev: Special ---------------------------------------------- `gawk' programs can open a two-way TCP/IP connection, acting as either -a client or a server. This is done using a special FN of the form: +a client or a server. This is done using a special file name of the +form: `/NET-TYPE/PROTOCOL/LOCAL-PORT/REMOTE-HOST/REMOTE-PORT' The NET-TYPE is one of `inet', `inet4' or `inet6'. The PROTOCOL is one of `tcp' or `udp', and the other fields represent the other essential pieces of information for making a networking connection. -These FNs are used with the `|&' operator for communicating with a -coprocess (*note Two-way I/O::). This is an advanced feature, +These file names are used with the `|&' operator for communicating with +a coprocess (*note Two-way I/O::). This is an advanced feature, mentioned here only for completeness. Full discussion is delayed until *note TCP/IP Networking::. @@ -6832,15 +6835,15 @@ File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Fi 5.7.3 Special File Name Caveats ------------------------------- -Here is a list of things to bear in mind when using the special FNs -that `gawk' provides: +Here is a list of things to bear in mind when using the special file +names that `gawk' provides: - * Recognition of these special FNs is disabled if `gawk' is in + * Recognition of these special file names is disabled if `gawk' is in compatibility mode (*note Options::). - * `gawk' _always_ interprets these special FNs. For example, using - `/dev/fd/4' for output actually writes on file descriptor 4, and - not on a new file descriptor that is `dup()''ed from file + * `gawk' _always_ interprets these special file names. For example, + using `/dev/fd/4' for output actually writes on file descriptor 4, + and not on a new file descriptor that is `dup()''ed from file descriptor 4. Most of the time this does not matter; however, it is important to _not_ close any of the files related to file descriptors 0, 1, and 2. Doing so results in unpredictable @@ -6852,17 +6855,17 @@ File: gawk.info, Node: Close Files And Pipes, Next: Output Summary, Prev: Spe 5.8 Closing Input and Output Redirections ========================================= -If the same FN or the same shell command is used with `getline' more -than once during the execution of an `awk' program (*note Getline::), -the file is opened (or the command is executed) the first time only. -At that time, the first record of input is read from that file or -command. The next time the same file or command is used with `getline', -another record is read from it, and so on. +If the same file name or the same shell command is used with `getline' +more than once during the execution of an `awk' program (*note +Getline::), the file is opened (or the command is executed) the first +time only. At that time, the first record of input is read from that +file or command. The next time the same file or command is used with +`getline', another record is read from it, and so on. Similarly, when a file or pipe is opened for output, `awk' remembers -the FN or command associated with it, and subsequent writes to the same -file or command are appended to the previous writes. The file or pipe -stays open until `awk' exits. +the file name or command associated with it, and subsequent writes to +the same file or command are appended to the previous writes. The file +or pipe stays open until `awk' exits. This implies that special steps are necessary in order to read the same file again from the beginning, or to rerun a shell command (rather @@ -6891,8 +6894,8 @@ file or command, or the next `print' or `printf' to that file or command, reopens the file or reruns the command. Because the expression that you use to close a file or pipeline must exactly match the expression used to open the file or run the command, it is good -practice to use a variable to store the FN or command. The previous -example becomes the following: +practice to use a valueiable to store the file name or command. The +previous example becomes the following: sortcom = "sort -r names" sortcom | getline foo @@ -7374,11 +7377,11 @@ option, as in the following: the variable is set at the very beginning, even before the `BEGIN' rules execute. The `-v' option and its assignment must precede all the -FN arguments, as well as the program text. (*Note Options::, for more -information about the `-v' option.) Otherwise, the variable assignment -is performed at a time determined by its position among the input file -arguments--after the processing of the preceding input file argument. -For example: +file name arguments, as well as the program text. (*Note Options::, +for more information about the `-v' option.) Otherwise, the variable +assignment is performed at a time determined by its position among the +input file arguments--after the processing of the preceding input file +argument. For example: awk '{ print $n }' n=4 inventory-shipped n=2 mail-list @@ -10058,13 +10061,14 @@ Options::), they are not special. `ARGIND #' The index in `ARGV' of the current file being processed. Every time `gawk' opens a new data file for processing, it sets `ARGIND' - to the index in `ARGV' of the FN. When `gawk' is processing the - input files, `FILENAME == ARGV[ARGIND]' is always true. + to the index in `ARGV' of the file name. When `gawk' is + processing the input files, `FILENAME == ARGV[ARGIND]' is always + true. This variable is useful in file processing; it allows you to tell how far along you are in the list of data files as well as to - distinguish between successive instances of the same FN on the - command line. + distinguish between successive instances of the same file name on + the command line. While you can change the value of `ARGIND' within your `awk' program, `gawk' automatically sets it to a new value when the next @@ -10399,13 +10403,13 @@ incrementing `ARGC' causes additional files to be read. If the value of `ARGC' is decreased, that eliminates input files from the end of the list. By recording the old value of `ARGC' elsewhere, a program can treat the eliminated arguments as something -other than FNs. +other than file names. To eliminate a file from the middle of the list, store the null string (`""') into `ARGV' in place of the file's name. As a special -feature, `awk' ignores FNs that have been replaced with the null string. -Another option is to use the `delete' statement to remove elements from -`ARGV' (*note Delete::). +feature, `awk' ignores file names that have been replaced with the null +string. Another option is to use the `delete' statement to remove +elements from `ARGV' (*note Delete::). All of these actions are typically done in the `BEGIN' rule, before actual processing of the input begins. *Note Split Program::, and see @@ -14840,16 +14844,16 @@ does so _portably_; this works with any implementation of `awk': the rule it supplies is executed first. This rule relies on `awk''s `FILENAME' variable that automatically -changes for each new data file. The current FN is saved in a private -variable, `_oldfilename'. If `FILENAME' does not equal `_oldfilename', -then a new data file is being processed and it is necessary to call -`endfile()' for the old file. Because `endfile()' should only be -called if a file has been processed, the program first checks to make -sure that `_oldfilename' is not the null string. The program then -assigns the current FN to `_oldfilename' and calls `beginfile()' for -the file. Because, like all `awk' variables, `_oldfilename' is -initialized to the null string, this rule executes correctly even for -the first data file. +changes for each new data file. The current file name is saved in a +private variable, `_oldfilename'. If `FILENAME' does not equal +`_oldfilename', then a new data file is being processed and it is +necessary to call `endfile()' for the old file. Because `endfile()' +should only be called if a file has been processed, the program first +checks to make sure that `_oldfilename' is not the null string. The +program then assigns the current file name to `_oldfilename' and calls +`beginfile()' for the file. Because, like all `awk' variables, +`_oldfilename' is initialized to the null string, this rule executes +correctly even for the first data file. The program also supplies an `END' rule to do the final processing for the last file. Because this `END' rule comes before any `END' rules @@ -14986,8 +14990,8 @@ program code. possible to detect when an empty data file has been skipped. Similar to the library file presented in *note Filetrans Function::, the following library file calls a function named `zerofile()' that the -user must provide. The arguments passed are the FN and the position in -`ARGV' where it was found: +user must provide. The arguments passed are the file name and the +position in `ARGV' where it was found: # zerofile.awk --- library file to process empty input files @@ -15033,8 +15037,8 @@ File: gawk.info, Node: Ignoring Assigns, Prev: Empty Files, Up: Data File Man Occasionally, you might not want `awk' to process command-line variable assignments (*note Assignment Options::). In particular, if you have a -FN that contains an `=' character, `awk' treats the FN as an -assignment, and does not process it. +file name that contains an `=' character, `awk' treats the file name as +an assignment, and does not process it. Some users have suggested an additional command-line option for `gawk' to disable command-line assignments. However, some simple @@ -15061,7 +15065,7 @@ programming with a library file does the trick: The function works by looping through the arguments. It prepends `./' to any argument that matches the form of a variable assignment, -turning that argument into a FN. +turning that argument into a file name. The use of `No_command_assign' allows you to disable command-line assignments at invocation time, by giving the variable a true value. @@ -15350,7 +15354,7 @@ that it does not try to interpret the `-a', etc., as its own options. NOTE: After `getopt()' is through, it is the responsibility of the user level code to clear out all the elements of `ARGV' from 1 to `Optind', so that `awk' does not try to process the command-line - options as FNs. + options as file names. Several of the sample programs presented in *note Sample Programs::, use `getopt()' to process their arguments. @@ -16132,7 +16136,7 @@ we want them to be separated with individual spaces. Also remember that after `getopt()' is through (as described in *note Getopt Function::), we have to clear out all the elements of `ARGV' from 1 to `Optind', so that `awk' does not try to process the command-line options -as FNs. +as file names. After dealing with the command-line options, the program verifies that the options make sense. Only one or the other of `-c' and `-f' @@ -16289,9 +16293,10 @@ expressions that are almost identical to those available in `awk' The PATTERN is a regular expression. In typical usage, the regular expression is quoted to prevent the shell from expanding any of the -special characters as FN wildcards. Normally, `egrep' prints the lines -that matched. If multiple FNs are provided on the command line, each -output line is preceded by the name of the file and a colon. +special characters as file name wildcards. Normally, `egrep' prints +the lines that matched. If multiple file names are provided on the +command line, each output line is preceded by the name of the file and +a colon. The options to `egrep' are as follows: @@ -16363,8 +16368,8 @@ pattern is supplied with `-e', the first nonoption on the command line is used. The `awk' command-line arguments up to `ARGV[Optind]' are cleared, so that `awk' won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are -specified, we make sure to note this so that the FNs can precede the -matched lines in the output: +specified, we make sure to note this so that the file names can precede +the matched lines in the output: if (pattern == "") pattern = ARGV[Optind++] @@ -16445,9 +16450,9 @@ just moves on to the next record. are not counting lines. First, if the user only wants exit status (`no_print' is true), then it is enough to know that _one_ line in this file matched, and we can skip on to the next file with `nextfile'. -Similarly, if we are only printing FNs, we can print the FN, and then -skip to the next file with `nextfile'. Finally, each line is printed, -with a leading FN and colon if necessary: +Similarly, if we are only printing file names, we can print the file +name, and then skip to the next file with `nextfile'. Finally, each +line is printed, with a leading file name and colon if necessary: { matches = ($0 ~ pattern) @@ -16633,7 +16638,7 @@ To change the number of lines in each file, supply a number on the command line preceded with a minus; e.g., `-500' for files with 500 lines in them instead of 1000. To change the name of the output files to something like `myfileaa', `myfileab', and so on, supply an -additional argument that specifies the FN prefix. +additional argument that specifies the file name prefix. Here is a version of `split' in `awk'. It uses the `ord()' and `chr()' functions presented in *note Ordinal Functions::. @@ -22989,7 +22994,7 @@ File: gawk.info, Node: Exit Callback Functions, Next: Extension Version String .............................................. An "exit callback" function is a function that `gawk' calls before it -exits. Such functions are useful if you have general "clean up" tasks +exits. Such functions are useful if you have general "cleanup" tasks that should be performed in your extension (such as closing data base connections or other resource deallocations). You can register such a function with `gawk' using the following function. @@ -23746,7 +23751,7 @@ of the usage. When a variable's value changes, `gawk' simply decrements the reference count on the old value and updates the variable to use the new value. - Finally, as part of your clean up action (*note Exit Callback + Finally, as part of your cleanup action (*note Exit Callback Functions::) you should release any cached values that you created, using `release_value()'. @@ -25261,10 +25266,10 @@ constant (`FNM_NOMATCH'), and an array of flag values named `FNM'. The arguments to `fnmatch()' are: `pattern' - The FN wildcard to match. + The file name wildcard to match. `string' - The FN string. + The file name string. `flag' Either zero, or the bitwise OR of one or more of the flags in the @@ -25356,8 +25361,8 @@ standard output to a temporary file configured to have the same owner and permissions as the original. After the file has been processed, the extension restores standard output to its original destination. If `INPLACE_SUFFIX' is not an empty string, the original file is linked to -a backup FN created by appending that suffix. Finally, the temporary -file is renamed to the original FN. +a backup file name created by appending that suffix. Finally, the +temporary file is renamed to the original file name. If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. @@ -25417,9 +25422,9 @@ on the command line (or with `getline'), they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode -number and the FN, separated by a forward slash character. On systems -where the directory entry contains the file type, the record has a -third field (also separated by a slash) which is a single letter +number and the file name, separated by a forward slash character. On +systems where the directory entry contains the file type, the record +has a third field (also separated by a slash) which is a single letter indicating the type of the file. The letters are file types are shown in *note table-readdir-file-types::. @@ -27506,8 +27511,8 @@ or: $ MMK/DESCRIPTION=[.vms]descrip.mms gawk `MMK' is an open source, free, near-clone of `MMS' and can better -handle ODS-5 volumes with upper- and lowercase FNs. `MMK' is available -from `https://github.com/endlesssoftware/mmk'. +handle ODS-5 volumes with upper- and lowercase file names. `MMK' is +available from `https://github.com/endlesssoftware/mmk'. With ODS-5 volumes and extended parsing enabled, the case of the target parameter may need to be exact. @@ -27627,9 +27632,9 @@ has no device or directory path information in it, `gawk' looks in the current directory first, then in the directory specified by the translation of `AWK_LIBRARY' if the file is not found. If, after searching in both directories, the file still is not found, `gawk' -appends the suffix `.awk' to the FN and retries the file search. If -`AWK_LIBRARY' has no definition, a default value of `SYS$LIBRARY:' is -used for it. +appends the suffix `.awk' to the file name and retries the file search. +If `AWK_LIBRARY' has no definition, a default value of `SYS$LIBRARY:' +is used for it. File: gawk.info, Node: VMS Running, Next: VMS GNV, Prev: VMS Installation Details, Up: VMS Installation @@ -28589,7 +28594,7 @@ provided: hook into input processing, output processing, and two-way I/O. * An extension should be able to provide a "call back" function to - perform clean up actions when `gawk' exits. + perform cleanup actions when `gawk' exits. * An extension should be able to provide a version string so that `gawk''s `--version' option can provide information about @@ -30748,7 +30753,7 @@ Index * Menu: * ! (exclamation point), ! operator: Boolean Ops. (line 67) -* ! (exclamation point), ! operator <1>: Egrep Program. (line 174) +* ! (exclamation point), ! operator <1>: Egrep Program. (line 175) * ! (exclamation point), ! operator <2>: Ranges. (line 48) * ! (exclamation point), ! operator: Precedence. (line 52) * ! (exclamation point), != operator <1>: Precedence. (line 65) @@ -30943,7 +30948,7 @@ Index * > (right angle bracket), >= operator: Comparison Operators. (line 11) * > (right angle bracket), >> operator (I/O) <1>: Precedence. (line 65) -* > (right angle bracket), >> operator (I/O): Redirection. (line 49) +* > (right angle bracket), >> operator (I/O): Redirection. (line 50) * ? (question mark), ?: operator: Precedence. (line 92) * ? (question mark), regexp operator <1>: GNU Regexp Operators. (line 59) @@ -30984,7 +30989,7 @@ Index (line 38) * \ (backslash), as field separator: Command Line Field Separator. (line 27) -* \ (backslash), continuing lines and <1>: Egrep Program. (line 222) +* \ (backslash), continuing lines and <1>: Egrep Program. (line 223) * \ (backslash), continuing lines and: Statements/Lines. (line 19) * \ (backslash), continuing lines and, comments and: Statements/Lines. (line 76) @@ -31191,7 +31196,7 @@ Index * awk, gawk and <1>: This Manual. (line 14) * awk, gawk and: Preface. (line 23) * awk, history of: History. (line 17) -* awk, implementation issues, pipes: Redirection. (line 134) +* awk, implementation issues, pipes: Redirection. (line 135) * awk, implementations: Other Versions. (line 6) * awk, implementations, limits: Getline Notes. (line 14) * awk, invoking: Command Line. (line 6) @@ -31258,7 +31263,7 @@ Index (line 38) * backslash (\), as field separator: Command Line Field Separator. (line 27) -* backslash (\), continuing lines and <1>: Egrep Program. (line 222) +* backslash (\), continuing lines and <1>: Egrep Program. (line 223) * backslash (\), continuing lines and: Statements/Lines. (line 19) * backslash (\), continuing lines and, comments and: Statements/Lines. (line 76) @@ -31569,7 +31574,7 @@ Index (line 6) * cookie: Glossary. (line 149) * coprocesses <1>: Two-way I/O. (line 44) -* coprocesses: Redirection. (line 101) +* coprocesses: Redirection. (line 102) * coprocesses, closing: Close Files And Pipes. (line 6) * coprocesses, getline from: Getline/Coprocess. (line 6) @@ -31612,9 +31617,9 @@ Index * dark corner, exit statement: Exit Statement. (line 30) * dark corner, field separators: Field Splitting Summary. (line 46) -* dark corner, FILENAME variable <1>: Auto-set. (line 97) +* dark corner, FILENAME variable <1>: Auto-set. (line 98) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 308) +* dark corner, FNR/NR variables: Auto-set. (line 309) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -31798,25 +31803,25 @@ Index (line 81) * differences in awk and gawk, command line directories: Command line directories. (line 6) -* differences in awk and gawk, ERRNO variable: Auto-set. (line 81) +* differences in awk and gawk, ERRNO variable: Auto-set. (line 82) * differences in awk and gawk, error messages: Special FD. (line 16) * differences in awk and gawk, FIELDWIDTHS variable: User-modified. (line 37) * differences in awk and gawk, FPAT variable: User-modified. (line 43) -* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 122) +* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 123) * differences in awk and gawk, function arguments (gawk): Calling Built-in. (line 16) * differences in awk and gawk, getline command: Getline. (line 19) * differences in awk and gawk, IGNORECASE variable: User-modified. (line 76) * differences in awk and gawk, implementation limitations <1>: Redirection. - (line 134) + (line 135) * differences in awk and gawk, implementation limitations: Getline Notes. (line 14) * differences in awk and gawk, indirect function calls: Indirect Calls. (line 6) * differences in awk and gawk, input/output operators <1>: Redirection. - (line 101) + (line 102) * differences in awk and gawk, input/output operators: Getline/Coprocess. (line 6) * differences in awk and gawk, line continuations: Conditional Exp. @@ -31826,7 +31831,7 @@ Index (line 260) * differences in awk and gawk, print/printf statements: Format Modifiers. (line 13) -* differences in awk and gawk, PROCINFO array: Auto-set. (line 135) +* differences in awk and gawk, PROCINFO array: Auto-set. (line 136) * differences in awk and gawk, read timeouts: Read Timeout. (line 6) * differences in awk and gawk, record separators: awk split records. (line 124) @@ -31836,7 +31841,7 @@ Index (line 26) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 264) +* differences in awk and gawk, RT variable: Auto-set. (line 265) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -31844,7 +31849,7 @@ Index * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 268) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 269) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 152) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -31885,11 +31890,11 @@ Index * dynamically loaded extensions: Dynamic Extensions. (line 6) * e debugger command (alias for enable): Breakpoint Control. (line 73) * EBCDIC: Ordinal Functions. (line 45) -* effective group ID of gawk user: Auto-set. (line 140) -* effective user ID of gawk user: Auto-set. (line 144) +* effective group ID of gawk user: Auto-set. (line 141) +* effective user ID of gawk user: Auto-set. (line 145) * egrep utility <1>: Egrep Program. (line 6) * egrep utility: Bracket Expressions. (line 24) -* egrep.awk program: Egrep Program. (line 53) +* egrep.awk program: Egrep Program. (line 54) * elements in arrays, assigning values: Assigning Elements. (line 6) * elements in arrays, deleting: Delete. (line 6) * elements in arrays, order of access by in operator: Scanning an Array. @@ -31914,7 +31919,7 @@ Index * END pattern, and profiling: Profiling. (line 62) * END pattern, assert() user-defined function and: Assert Function. (line 75) -* END pattern, backslash continuation and: Egrep Program. (line 222) +* END pattern, backslash continuation and: Egrep Program. (line 223) * END pattern, Boolean patterns and: Expression Patterns. (line 70) * END pattern, exit statement and: Exit Statement. (line 12) * END pattern, next/nextfile statements and <1>: Next Statement. @@ -31931,10 +31936,10 @@ Index * endpwent() function (C library): Passwd Functions. (line 210) * endpwent() user-defined function: Passwd Functions. (line 213) * English, Steve: Advanced Features. (line 6) -* ENVIRON array: Auto-set. (line 59) +* ENVIRON array: Auto-set. (line 60) * environment variables used by gawk: Environment Variables. (line 6) -* environment variables, in ENVIRON array: Auto-set. (line 59) +* environment variables, in ENVIRON array: Auto-set. (line 60) * epoch, definition of: Glossary. (line 234) * equals sign (=), = operator: Assignment Ops. (line 6) * equals sign (=), == operator <1>: Precedence. (line 65) @@ -31942,13 +31947,13 @@ Index (line 11) * EREs (Extended Regular Expressions): Bracket Expressions. (line 24) * ERRNO variable <1>: TCP/IP Networking. (line 54) -* ERRNO variable: Auto-set. (line 81) +* ERRNO variable: Auto-set. (line 82) * ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26) * ERRNO variable, with close() function: Close Files And Pipes. (line 139) * ERRNO variable, with getline command: Getline. (line 19) * error handling: Special FD. (line 16) -* error handling, ERRNO variable and: Auto-set. (line 81) +* error handling, ERRNO variable and: Auto-set. (line 82) * error output: Special FD. (line 6) * escape processing, gsub()/gensub()/sub() functions: Gory Details. (line 6) @@ -31961,7 +31966,7 @@ Index * evaluation order, concatenation: Concatenation. (line 41) * evaluation order, functions: Calling Built-in. (line 30) * examining fields: Fields. (line 6) -* exclamation point (!), ! operator <1>: Egrep Program. (line 174) +* exclamation point (!), ! operator <1>: Egrep Program. (line 175) * exclamation point (!), ! operator <2>: Precedence. (line 52) * exclamation point (!), ! operator: Boolean Ops. (line 67) * exclamation point (!), != operator <1>: Precedence. (line 65) @@ -32002,7 +32007,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 231) +* extension API, version number: Auto-set. (line 232) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32078,10 +32083,10 @@ Index * FIELDWIDTHS variable <1>: User-modified. (line 37) * FIELDWIDTHS variable: Constant Size. (line 23) * file descriptors: Special FD. (line 6) -* file names, distinguishing: Auto-set. (line 55) +* file names, distinguishing: Auto-set. (line 56) * file names, in compatibility mode: Special Caveats. (line 9) * file names, standard streams in gawk: Special FD. (line 46) -* FILENAME variable <1>: Auto-set. (line 97) +* FILENAME variable <1>: Auto-set. (line 98) * FILENAME variable: Reading Files. (line 6) * FILENAME variable, getline, setting with: Getline Notes. (line 19) * filenames, assignments as: Ignoring Assigns. (line 6) @@ -32127,7 +32132,7 @@ Index * files, portable object, converting to message object files: I18N Example. (line 63) * files, portable object, generating: Options. (line 147) -* files, processing, ARGIND variable and: Auto-set. (line 50) +* files, processing, ARGIND variable and: Auto-set. (line 51) * files, reading: Rewind Function. (line 6) * files, reading, multiline records: Multiple Line. (line 6) * files, searching for regular expressions: Egrep Program. (line 6) @@ -32151,9 +32156,9 @@ Index * flush buffered output: I/O Functions. (line 28) * fnmatch() extension function: Extension Sample Fnmatch. (line 12) -* FNR variable <1>: Auto-set. (line 106) +* FNR variable <1>: Auto-set. (line 107) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 308) +* FNR variable, changing: Auto-set. (line 309) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32203,7 +32208,7 @@ Index * FSF (Free Software Foundation): Manual History. (line 6) * fts() extension function: Extension Sample File Functions. (line 61) -* FUNCTAB array: Auto-set. (line 122) +* FUNCTAB array: Auto-set. (line 123) * function calls: Function Calls. (line 6) * function calls, indirect: Indirect Calls. (line 6) * function definition example: Function Example. (line 6) @@ -32253,7 +32258,7 @@ Index * G-d: Acknowledgments. (line 78) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 179) -* gawk version: Auto-set. (line 206) +* gawk version: Auto-set. (line 207) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 23) @@ -32274,7 +32279,7 @@ Index * gawk, distribution: Distribution contents. (line 6) * gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54) -* gawk, ERRNO variable in <2>: Auto-set. (line 81) +* gawk, ERRNO variable in <2>: Auto-set. (line 82) * gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26) * gawk, ERRNO variable in <4>: Close Files And Pipes. (line 139) @@ -32291,7 +32296,7 @@ Index * gawk, FPAT variable in <1>: User-modified. (line 43) * gawk, FPAT variable in: Splitting By Content. (line 27) -* gawk, FUNCTAB array in: Auto-set. (line 122) +* gawk, FUNCTAB array in: Auto-set. (line 123) * gawk, function arguments and: Calling Built-in. (line 16) * gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42) * gawk, IGNORECASE variable in <1>: Array Sorting Functions. @@ -32305,7 +32310,7 @@ Index * gawk, implementation issues, downward compatibility: Compatibility Mode. (line 6) * gawk, implementation issues, limits: Getline Notes. (line 14) -* gawk, implementation issues, pipes: Redirection. (line 134) +* gawk, implementation issues, pipes: Redirection. (line 135) * gawk, installing: Installation. (line 6) * gawk, internationalization and, See internationalization: Internationalization. (line 13) @@ -32322,7 +32327,7 @@ Index * gawk, OS/2 version of: PC Using. (line 16) * gawk, PROCINFO array in <1>: Two-way I/O. (line 117) * gawk, PROCINFO array in <2>: Time Functions. (line 47) -* gawk, PROCINFO array in: Auto-set. (line 135) +* gawk, PROCINFO array in: Auto-set. (line 136) * gawk, regexp constants and: Using Constant Regexps. (line 28) * gawk, regular expressions, case sensitivity: Case-sensitivity. @@ -32330,14 +32335,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 162) -* gawk, RT variable in <1>: Auto-set. (line 264) +* gawk, RT variable in <1>: Auto-set. (line 265) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 124) * gawk, See Also awk: Preface. (line 36) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 88) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 268) +* gawk, SYMTAB array in: Auto-set. (line 269) * gawk, TEXTDOMAIN variable in: User-modified. (line 152) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 36) @@ -32424,7 +32429,7 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 179) +* group ID of gawk user: Auto-set. (line 180) * groups, information about: Group Functions. (line 6) * gsub <1>: String Functions. (line 139) * gsub: Using Constant Regexps. @@ -32477,7 +32482,7 @@ Index * Illumos, POSIX-compliant awk: Other Versions. (line 105) * implementation issues, gawk: Notes. (line 6) * implementation issues, gawk, debugging: Compatibility Mode. (line 6) -* implementation issues, gawk, limits <1>: Redirection. (line 134) +* implementation issues, gawk, limits <1>: Redirection. (line 135) * implementation issues, gawk, limits: Getline Notes. (line 14) * in operator <1>: For Statement. (line 75) * in operator <2>: Precedence. (line 83) @@ -32721,7 +32726,7 @@ Index * mawk utility <3>: Concatenation. (line 36) * mawk utility <4>: Getline/Pipe. (line 62) * mawk utility: Escape Sequences. (line 124) -* maximum precision supported by MPFR library: Auto-set. (line 220) +* maximum precision supported by MPFR library: Auto-set. (line 221) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -32734,7 +32739,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 130) -* minimum precision supported by MPFR library: Auto-set. (line 223) +* minimum precision supported by MPFR library: Auto-set. (line 224) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -32788,7 +32793,7 @@ Index (line 47) * nexti debugger command: Debugger Execution Control. (line 49) -* NF variable <1>: Auto-set. (line 111) +* NF variable <1>: Auto-set. (line 112) * NF variable: Fields. (line 33) * NF variable, decrementing: Changing Fields. (line 107) * ni debugger command (alias for nexti): Debugger Execution Control. @@ -32797,9 +32802,9 @@ Index * non-existent array elements: Reference to Elements. (line 23) * not Boolean-logic operator: Boolean Ops. (line 6) -* NR variable <1>: Auto-set. (line 130) +* NR variable <1>: Auto-set. (line 131) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 308) +* NR variable, changing: Auto-set. (line 309) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -32907,14 +32912,14 @@ Index (line 6) * output, format specifier, OFMT: OFMT. (line 15) * output, formatted: Printf. (line 6) -* output, pipes: Redirection. (line 56) +* output, pipes: Redirection. (line 57) * output, printing, See printing: Printing. (line 6) * output, records: Output Separators. (line 20) * output, standard: Special FD. (line 6) * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 129) -* parent process ID of gawk process: Auto-set. (line 188) +* parent process ID of gawk process: Auto-set. (line 189) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 80) * password file: Passwd Functions. (line 16) @@ -32944,7 +32949,7 @@ Index * pipe, closing: Close Files And Pipes. (line 6) * pipe, input: Getline/Pipe. (line 9) -* pipe, output: Redirection. (line 56) +* pipe, output: Redirection. (line 57) * Pitts, Dave <1>: Bugs. (line 71) * Pitts, Dave: Acknowledgments. (line 60) * Plauger, P.J.: Library Functions. (line 12) @@ -33079,24 +33084,24 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 182) -* process ID of gawk process: Auto-set. (line 185) +* process group idIDof gawk process: Auto-set. (line 183) +* process ID of gawk process: Auto-set. (line 186) * processes, two-way communications with: Two-way I/O. (line 23) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) * PROCINFO array <2>: Time Functions. (line 47) -* PROCINFO array: Auto-set. (line 135) +* PROCINFO array: Auto-set. (line 136) * PROCINFO array, and communications via ptys: Two-way I/O. (line 117) * PROCINFO array, and group membership: Group Functions. (line 6) * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 161) -* PROCINFO array, uses: Auto-set. (line 241) +* PROCINFO array, uses: Auto-set. (line 242) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) * profiling awk programs, dynamically: Profiling. (line 179) -* program identifiers: Auto-set. (line 153) +* program identifiers: Auto-set. (line 154) * program, definition of: Getting Started. (line 21) * programmers, attractiveness of: Two-way I/O. (line 6) * programming conventions, --non-decimal-data option: Nondecimal Data. @@ -33252,11 +33257,11 @@ Index * right angle bracket (>), >= operator: Comparison Operators. (line 11) * right angle bracket (>), >> operator (I/O) <1>: Precedence. (line 65) -* right angle bracket (>), >> operator (I/O): Redirection. (line 49) +* right angle bracket (>), >> operator (I/O): Redirection. (line 50) * right shift: Bitwise Functions. (line 52) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 251) +* RLENGTH variable: Auto-set. (line 252) * RLENGTH variable, match() function and: String Functions. (line 224) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 32) @@ -33285,9 +33290,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 52) -* RSTART variable: Auto-set. (line 257) +* RSTART variable: Auto-set. (line 258) * RSTART variable, match() function and: String Functions. (line 224) -* RT variable <1>: Auto-set. (line 264) +* RT variable <1>: Auto-set. (line 265) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 124) * Rubin, Paul <1>: Contributors. (line 15) @@ -33307,7 +33312,7 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 134) -* Schorr, Andrew <2>: Auto-set. (line 291) +* Schorr, Andrew <2>: Auto-set. (line 292) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) @@ -33357,7 +33362,7 @@ Index * shadowing of variable values: Definition Syntax. (line 61) * shell quoting, double quote: Read Terminal. (line 25) * shell quoting, rules for: Quoting. (line 6) -* shells, piping commands into: Redirection. (line 141) +* shells, piping commands into: Redirection. (line 142) * shells, quoting: Using Shell Variables. (line 12) * shells, quoting, rules for: Quoting. (line 18) @@ -33395,7 +33400,7 @@ Index (line 110) * sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary. (line 38) -* sidebar, Changing NR and FNR: Auto-set. (line 306) +* sidebar, Changing NR and FNR: Auto-set. (line 307) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. @@ -33406,7 +33411,7 @@ Index (line 107) * sidebar, Matching the Null String: Gory Details. (line 162) * sidebar, Operator Evaluation Order: Increment Ops. (line 58) -* sidebar, Piping into sh: Redirection. (line 139) +* sidebar, Piping into sh: Redirection. (line 140) * sidebar, Portability Issues with #!: Executable Scripts. (line 31) * sidebar, Recipe For A Programming Language: History. (line 6) * sidebar, RS = "\0" Is Not Portable: gawk split records. (line 63) @@ -33557,9 +33562,9 @@ Index * substr: String Functions. (line 479) * substring: String Functions. (line 479) * Sumner, Andrew: Other Versions. (line 64) -* supplementary groups of gawk process: Auto-set. (line 236) +* supplementary groups of gawk process: Auto-set. (line 237) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 268) +* SYMTAB array: Auto-set. (line 269) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) * system: I/O Functions. (line 75) @@ -33643,7 +33648,7 @@ Index * troubleshooting, match() function: String Functions. (line 289) * troubleshooting, print statement, omitting commas: Print Examples. (line 31) -* troubleshooting, printing: Redirection. (line 117) +* troubleshooting, printing: Redirection. (line 118) * troubleshooting, quotes with file names: Special FD. (line 68) * troubleshooting, readable data files: File Checking. (line 6) * troubleshooting, regexp constants vs. string constants: Computed Regexps. @@ -33737,10 +33742,10 @@ Index * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 206) -* version of gawk extension API: Auto-set. (line 231) -* version of GNU MP library: Auto-set. (line 217) -* version of GNU MPFR library: Auto-set. (line 213) +* version of gawk: Auto-set. (line 207) +* version of gawk extension API: Auto-set. (line 232) +* version of GNU MP library: Auto-set. (line 218) +* version of GNU MPFR library: Auto-set. (line 214) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -33805,11 +33810,11 @@ Index * {} (braces), statements, grouping: Statements. (line 10) * | (vertical bar): Regexp Operators. (line 70) * | (vertical bar), | operator (I/O) <1>: Precedence. (line 65) -* | (vertical bar), | operator (I/O) <2>: Redirection. (line 56) +* | (vertical bar), | operator (I/O) <2>: Redirection. (line 57) * | (vertical bar), | operator (I/O): Getline/Pipe. (line 9) * | (vertical bar), |& operator (I/O) <1>: Two-way I/O. (line 44) * | (vertical bar), |& operator (I/O) <2>: Precedence. (line 65) -* | (vertical bar), |& operator (I/O) <3>: Redirection. (line 101) +* | (vertical bar), |& operator (I/O) <3>: Redirection. (line 102) * | (vertical bar), |& operator (I/O): Getline/Coprocess. (line 6) * | (vertical bar), |& operator (I/O), pipes, closing: Close Files And Pipes. (line 119) @@ -33850,529 +33855,529 @@ Node: Read Terminal74778 Ref: Read Terminal-Footnote-176428 Ref: Read Terminal-Footnote-276704 Node: Long76875 -Node: Executable Scripts78223 -Ref: Executable Scripts-Footnote-180056 -Ref: Executable Scripts-Footnote-280158 -Node: Comments80691 -Node: Quoting83158 -Node: DOS Quoting88467 -Node: Sample Data Files89142 -Node: Very Simple91657 -Node: Two Rules96288 -Node: More Complex98183 -Ref: More Complex-Footnote-1101108 -Node: Statements/Lines101193 -Ref: Statements/Lines-Footnote-1105648 -Node: Other Features105913 -Node: When106841 -Node: Intro Summary109011 -Node: Invoking Gawk109777 -Node: Command Line111292 -Node: Options112083 -Ref: Options-Footnote-1127867 -Node: Other Arguments127892 -Node: Naming Standard Input130533 -Node: Environment Variables131613 -Node: AWKPATH Variable132171 -Ref: AWKPATH Variable-Footnote-1135022 -Ref: AWKPATH Variable-Footnote-2135067 -Node: AWKLIBPATH Variable135327 -Node: Other Environment Variables136086 -Node: Exit Status139741 -Node: Include Files140416 -Node: Loading Shared Libraries143980 -Node: Obsolete145364 -Node: Undocumented146061 -Node: Invoking Summary146328 -Node: Regexp147908 -Node: Regexp Usage149358 -Node: Escape Sequences151391 -Node: Regexp Operators157058 -Ref: Regexp Operators-Footnote-1164538 -Ref: Regexp Operators-Footnote-2164685 -Node: Bracket Expressions164783 -Ref: table-char-classes166673 -Node: GNU Regexp Operators169196 -Node: Case-sensitivity172919 -Ref: Case-sensitivity-Footnote-1175811 -Ref: Case-sensitivity-Footnote-2176046 -Node: Leftmost Longest176154 -Node: Computed Regexps177355 -Node: Regexp Summary180727 -Node: Reading Files182199 -Node: Records184248 -Node: awk split records184991 -Node: gawk split records189849 -Ref: gawk split records-Footnote-1194370 -Node: Fields194407 -Ref: Fields-Footnote-1197371 -Node: Nonconstant Fields197457 -Ref: Nonconstant Fields-Footnote-1199687 -Node: Changing Fields199889 -Node: Field Separators205843 -Node: Default Field Splitting208545 -Node: Regexp Field Splitting209662 -Node: Single Character Fields213003 -Node: Command Line Field Separator214062 -Node: Full Line Fields217404 -Ref: Full Line Fields-Footnote-1217912 -Node: Field Splitting Summary217958 -Ref: Field Splitting Summary-Footnote-1221057 -Node: Constant Size221158 -Node: Splitting By Content225765 -Ref: Splitting By Content-Footnote-1229515 -Node: Multiple Line229555 -Ref: Multiple Line-Footnote-1235411 -Node: Getline235590 -Node: Plain Getline237806 -Node: Getline/Variable239901 -Node: Getline/File241048 -Node: Getline/Variable/File242424 -Ref: Getline/Variable/File-Footnote-1244023 -Node: Getline/Pipe244110 -Node: Getline/Variable/Pipe246809 -Node: Getline/Coprocess247916 -Node: Getline/Variable/Coprocess249168 -Node: Getline Notes249905 -Node: Getline Summary252709 -Ref: table-getline-variants253117 -Node: Read Timeout254029 -Ref: Read Timeout-Footnote-1257856 -Node: Command line directories257914 -Node: Input Summary258818 -Node: Printing261932 -Node: Print263604 -Node: Print Examples264945 -Node: Output Separators267724 -Node: OFMT269740 -Node: Printf271098 -Node: Basic Printf272004 -Node: Control Letters273543 -Node: Format Modifiers277397 -Node: Printf Examples283424 -Node: Redirection286131 -Node: Special Files293078 -Node: Special FD293594 -Ref: Special FD-Footnote-1297169 -Node: Special Network297243 -Node: Special Caveats298079 -Node: Close Files And Pipes298854 -Ref: Close Files And Pipes-Footnote-1305993 -Ref: Close Files And Pipes-Footnote-2306141 -Node: Output Summary306291 -Node: Expressions307263 -Node: Values308448 -Node: Constants309124 -Node: Scalar Constants309804 -Ref: Scalar Constants-Footnote-1310663 -Node: Nondecimal-numbers310913 -Node: Regexp Constants313913 -Node: Using Constant Regexps314388 -Node: Variables317458 -Node: Using Variables318113 -Node: Assignment Options319837 -Node: Conversion321704 -Ref: table-locale-affects327140 -Ref: Conversion-Footnote-1327764 -Node: All Operators327873 -Node: Arithmetic Ops328503 -Node: Concatenation331008 -Ref: Concatenation-Footnote-1333804 -Node: Assignment Ops333924 -Ref: table-assign-ops338907 -Node: Increment Ops340224 -Node: Truth Values and Conditions343662 -Node: Truth Values344745 -Node: Typing and Comparison345794 -Node: Variable Typing346587 -Ref: Variable Typing-Footnote-1350487 -Node: Comparison Operators350609 -Ref: table-relational-ops351019 -Node: POSIX String Comparison354569 -Ref: POSIX String Comparison-Footnote-1355653 -Node: Boolean Ops355791 -Ref: Boolean Ops-Footnote-1359861 -Node: Conditional Exp359952 -Node: Function Calls361679 -Node: Precedence365437 -Node: Locales369106 -Node: Expressions Summary370737 -Node: Patterns and Actions373234 -Node: Pattern Overview374350 -Node: Regexp Patterns376027 -Node: Expression Patterns376570 -Node: Ranges380351 -Node: BEGIN/END383457 -Node: Using BEGIN/END384219 -Ref: Using BEGIN/END-Footnote-1386955 -Node: I/O And BEGIN/END387061 -Node: BEGINFILE/ENDFILE389346 -Node: Empty392277 -Node: Using Shell Variables392594 -Node: Action Overview394877 -Node: Statements397204 -Node: If Statement399052 -Node: While Statement400550 -Node: Do Statement402594 -Node: For Statement403750 -Node: Switch Statement406902 -Node: Break Statement409005 -Node: Continue Statement411060 -Node: Next Statement412853 -Node: Nextfile Statement415243 -Node: Exit Statement417898 -Node: Built-in Variables420302 -Node: User-modified421429 -Ref: User-modified-Footnote-1429114 -Node: Auto-set429176 -Ref: Auto-set-Footnote-1442059 -Ref: Auto-set-Footnote-2442264 -Node: ARGC and ARGV442320 -Node: Pattern Action Summary446159 -Node: Arrays448382 -Node: Array Basics449931 -Node: Array Intro450757 -Ref: figure-array-elements452730 -Node: Reference to Elements455137 -Node: Assigning Elements457410 -Node: Array Example457901 -Node: Scanning an Array459633 -Node: Controlling Scanning462648 -Ref: Controlling Scanning-Footnote-1467821 -Node: Delete468137 -Ref: Delete-Footnote-1470902 -Node: Numeric Array Subscripts470959 -Node: Uninitialized Subscripts473142 -Node: Multidimensional474767 -Node: Multiscanning477860 -Node: Arrays of Arrays479449 -Node: Arrays Summary484112 -Node: Functions486217 -Node: Built-in487090 -Node: Calling Built-in488168 -Node: Numeric Functions490156 -Ref: Numeric Functions-Footnote-1493990 -Ref: Numeric Functions-Footnote-2494347 -Ref: Numeric Functions-Footnote-3494395 -Node: String Functions494664 -Ref: String Functions-Footnote-1517675 -Ref: String Functions-Footnote-2517804 -Ref: String Functions-Footnote-3518052 -Node: Gory Details518139 -Ref: table-sub-escapes519808 -Ref: table-sub-posix-92521162 -Ref: table-sub-proposed522513 -Ref: table-posix-sub523867 -Ref: table-gensub-escapes525412 -Ref: Gory Details-Footnote-1526588 -Ref: Gory Details-Footnote-2526639 -Node: I/O Functions526790 -Ref: I/O Functions-Footnote-1533913 -Node: Time Functions534060 -Ref: Time Functions-Footnote-1544524 -Ref: Time Functions-Footnote-2544592 -Ref: Time Functions-Footnote-3544750 -Ref: Time Functions-Footnote-4544861 -Ref: Time Functions-Footnote-5544973 -Ref: Time Functions-Footnote-6545200 -Node: Bitwise Functions545466 -Ref: table-bitwise-ops546028 -Ref: Bitwise Functions-Footnote-1550273 -Node: Type Functions550457 -Node: I18N Functions551599 -Node: User-defined553244 -Node: Definition Syntax554048 -Ref: Definition Syntax-Footnote-1558973 -Node: Function Example559042 -Ref: Function Example-Footnote-1561686 -Node: Function Caveats561708 -Node: Calling A Function562226 -Node: Variable Scope563181 -Node: Pass By Value/Reference566169 -Node: Return Statement569677 -Node: Dynamic Typing572661 -Node: Indirect Calls573590 -Node: Functions Summary583303 -Node: Library Functions585842 -Ref: Library Functions-Footnote-1589417 -Ref: Library Functions-Footnote-2589560 -Node: Library Names589731 -Ref: Library Names-Footnote-1593204 -Ref: Library Names-Footnote-2593424 -Node: General Functions593510 -Node: Strtonum Function594538 -Node: Assert Function597468 -Node: Round Function600794 -Node: Cliff Random Function602335 -Node: Ordinal Functions603351 -Ref: Ordinal Functions-Footnote-1606428 -Ref: Ordinal Functions-Footnote-2606680 -Node: Join Function606891 -Ref: Join Function-Footnote-1608662 -Node: Getlocaltime Function608862 -Node: Readfile Function612598 -Node: Data File Management614437 -Node: Filetrans Function615069 -Node: Rewind Function619124 -Node: File Checking620511 -Ref: File Checking-Footnote-1621643 -Node: Empty Files621844 -Node: Ignoring Assigns624067 -Node: Getopt Function625600 -Ref: Getopt Function-Footnote-1636896 -Node: Passwd Functions637099 -Ref: Passwd Functions-Footnote-1646078 -Node: Group Functions646166 -Ref: Group Functions-Footnote-1654108 -Node: Walking Arrays654321 -Node: Library Functions Summary656491 -Node: Sample Programs657853 -Node: Running Examples658580 -Node: Clones659308 -Node: Cut Program660532 -Node: Egrep Program670393 -Ref: Egrep Program-Footnote-1678322 -Node: Id Program678432 -Node: Split Program682096 -Ref: Split Program-Footnote-1685627 -Node: Tee Program685755 -Node: Uniq Program688562 -Node: Wc Program695992 -Ref: Wc Program-Footnote-1700260 -Ref: Wc Program-Footnote-2700460 -Node: Miscellaneous Programs700552 -Node: Dupword Program701765 -Node: Alarm Program703796 -Node: Translate Program708610 -Ref: Translate Program-Footnote-1713001 -Ref: Translate Program-Footnote-2713271 -Node: Labels Program713405 -Ref: Labels Program-Footnote-1716776 -Node: Word Sorting716860 -Node: History Sorting720903 -Node: Extract Program722739 -Ref: Extract Program-Footnote-1730314 -Node: Simple Sed730443 -Node: Igawk Program733505 -Ref: Igawk Program-Footnote-1748681 -Ref: Igawk Program-Footnote-2748882 -Node: Anagram Program749020 -Node: Signature Program752088 -Node: Programs Summary753335 -Node: Advanced Features754523 -Node: Nondecimal Data756471 -Node: Array Sorting758048 -Node: Controlling Array Traversal758745 -Node: Array Sorting Functions767025 -Ref: Array Sorting Functions-Footnote-1770932 -Node: Two-way I/O771126 -Ref: Two-way I/O-Footnote-1776642 -Node: TCP/IP Networking776724 -Node: Profiling779568 -Node: Advanced Features Summary787110 -Node: Internationalization788974 -Node: I18N and L10N790454 -Node: Explaining gettext791140 -Ref: Explaining gettext-Footnote-1796280 -Ref: Explaining gettext-Footnote-2796464 -Node: Programmer i18n796629 -Node: Translator i18n800854 -Node: String Extraction801648 -Ref: String Extraction-Footnote-1802609 -Node: Printf Ordering802695 -Ref: Printf Ordering-Footnote-1805477 -Node: I18N Portability805541 -Ref: I18N Portability-Footnote-1807990 -Node: I18N Example808053 -Ref: I18N Example-Footnote-1810775 -Node: Gawk I18N810847 -Node: I18N Summary811485 -Node: Debugger812824 -Node: Debugging813846 -Node: Debugging Concepts814287 -Node: Debugging Terms816143 -Node: Awk Debugging818740 -Node: Sample Debugging Session819632 -Node: Debugger Invocation820152 -Node: Finding The Bug821485 -Node: List of Debugger Commands827967 -Node: Breakpoint Control829299 -Node: Debugger Execution Control832963 -Node: Viewing And Changing Data836323 -Node: Execution Stack839681 -Node: Debugger Info841194 -Node: Miscellaneous Debugger Commands845188 -Node: Readline Support850372 -Node: Limitations851264 -Node: Debugging Summary853538 -Node: Arbitrary Precision Arithmetic854702 -Ref: Arbitrary Precision Arithmetic-Footnote-1856351 -Node: General Arithmetic856499 -Node: Floating Point Issues858219 -Node: String Conversion Precision859100 -Ref: String Conversion Precision-Footnote-1860805 -Node: Unexpected Results860914 -Node: POSIX Floating Point Problems863067 -Ref: POSIX Floating Point Problems-Footnote-1866888 -Node: Integer Programming866926 -Node: Floating-point Programming868737 -Ref: Floating-point Programming-Footnote-1875065 -Ref: Floating-point Programming-Footnote-2875335 -Node: Floating-point Representation875599 -Node: Floating-point Context876764 -Ref: table-ieee-formats877603 -Node: Rounding Mode878987 -Ref: table-rounding-modes879466 -Ref: Rounding Mode-Footnote-1882481 -Node: Gawk and MPFR882660 -Node: Arbitrary Precision Floats884069 -Ref: Arbitrary Precision Floats-Footnote-1886512 -Node: Setting Precision886833 -Ref: table-predefined-precision-strings887517 -Node: Setting Rounding Mode889662 -Ref: table-gawk-rounding-modes890066 -Node: Floating-point Constants891253 -Node: Changing Precision892705 -Ref: Changing Precision-Footnote-1894097 -Node: Exact Arithmetic894271 -Node: Arbitrary Precision Integers897405 -Ref: Arbitrary Precision Integers-Footnote-1900420 -Node: Dynamic Extensions900567 -Node: Extension Intro902025 -Node: Plugin License903290 -Node: Extension Mechanism Outline903975 -Ref: figure-load-extension904399 -Ref: figure-load-new-function905884 -Ref: figure-call-new-function906886 -Node: Extension API Description908870 -Node: Extension API Functions Introduction910320 -Node: General Data Types915186 -Ref: General Data Types-Footnote-1920879 -Node: Requesting Values921178 -Ref: table-value-types-returned921915 -Node: Memory Allocation Functions922873 -Ref: Memory Allocation Functions-Footnote-1925620 -Node: Constructor Functions925716 -Node: Registration Functions927474 -Node: Extension Functions928159 -Node: Exit Callback Functions930461 -Node: Extension Version String931711 -Node: Input Parsers932361 -Node: Output Wrappers942164 -Node: Two-way processors946680 -Node: Printing Messages948884 -Ref: Printing Messages-Footnote-1949961 -Node: Updating `ERRNO'950113 -Node: Accessing Parameters950852 -Node: Symbol Table Access952082 -Node: Symbol table by name952596 -Node: Symbol table by cookie954572 -Ref: Symbol table by cookie-Footnote-1958705 -Node: Cached values958768 -Ref: Cached values-Footnote-1962273 -Node: Array Manipulation962364 -Ref: Array Manipulation-Footnote-1963462 -Node: Array Data Types963501 -Ref: Array Data Types-Footnote-1966204 -Node: Array Functions966296 -Node: Flattening Arrays970170 -Node: Creating Arrays977022 -Node: Extension API Variables981753 -Node: Extension Versioning982389 -Node: Extension API Informational Variables984290 -Node: Extension API Boilerplate985376 -Node: Finding Extensions989180 -Node: Extension Example989740 -Node: Internal File Description990470 -Node: Internal File Ops994561 -Ref: Internal File Ops-Footnote-11006107 -Node: Using Internal File Ops1006247 -Ref: Using Internal File Ops-Footnote-11008594 -Node: Extension Samples1008862 -Node: Extension Sample File Functions1010386 -Node: Extension Sample Fnmatch1017954 -Node: Extension Sample Fork1019421 -Node: Extension Sample Inplace1020634 -Node: Extension Sample Ord1022400 -Node: Extension Sample Readdir1023236 -Ref: table-readdir-file-types1024085 -Node: Extension Sample Revout1024884 -Node: Extension Sample Rev2way1025475 -Node: Extension Sample Read write array1026216 -Node: Extension Sample Readfile1028095 -Node: Extension Sample API Tests1029195 -Node: Extension Sample Time1029720 -Node: gawkextlib1031035 -Node: Language History1033822 -Node: V7/SVR3.11035416 -Node: SVR41037736 -Node: POSIX1039178 -Node: BTL1040564 -Node: POSIX/GNU1041298 -Node: Feature History1046897 -Node: Common Extensions1060009 -Node: Ranges and Locales1061321 -Ref: Ranges and Locales-Footnote-11065938 -Ref: Ranges and Locales-Footnote-21065965 -Ref: Ranges and Locales-Footnote-31066199 -Node: Contributors1066420 -Node: Installation1071858 -Node: Gawk Distribution1072752 -Node: Getting1073236 -Node: Extracting1074062 -Node: Distribution contents1075704 -Node: Unix Installation1081421 -Node: Quick Installation1082038 -Node: Additional Configuration Options1084480 -Node: Configuration Philosophy1086218 -Node: Non-Unix Installation1088569 -Node: PC Installation1089027 -Node: PC Binary Installation1090338 -Node: PC Compiling1092186 -Ref: PC Compiling-Footnote-11095185 -Node: PC Testing1095290 -Node: PC Using1096466 -Node: Cygwin1100624 -Node: MSYS1101433 -Node: VMS Installation1101947 -Node: VMS Compilation1102743 -Ref: VMS Compilation-Footnote-11103958 -Node: VMS Dynamic Extensions1104016 -Node: VMS Installation Details1105389 -Node: VMS Running1107635 -Node: VMS GNV1110469 -Node: VMS Old Gawk1111192 -Node: Bugs1111662 -Node: Other Versions1115666 -Node: Notes1121891 -Node: Compatibility Mode1122691 -Node: Additions1123473 -Node: Accessing The Source1124398 -Node: Adding Code1125834 -Node: New Ports1132012 -Node: Derived Files1136493 -Ref: Derived Files-Footnote-11141574 -Ref: Derived Files-Footnote-21141608 -Ref: Derived Files-Footnote-31142204 -Node: Future Extensions1142318 -Node: Implementation Limitations1142924 -Node: Extension Design1144172 -Node: Old Extension Problems1145326 -Ref: Old Extension Problems-Footnote-11146843 -Node: Extension New Mechanism Goals1146900 -Ref: Extension New Mechanism Goals-Footnote-11150261 -Node: Extension Other Design Decisions1150450 -Node: Extension Future Growth1152556 -Node: Old Extension Mechanism1153392 -Node: Basic Concepts1155132 -Node: Basic High Level1155813 -Ref: figure-general-flow1156085 -Ref: figure-process-flow1156684 -Ref: Basic High Level-Footnote-11159913 -Node: Basic Data Typing1160098 -Node: Glossary1163425 -Node: Copying1188577 -Node: GNU Free Documentation License1226133 -Node: Index1251269 +Node: Executable Scripts78251 +Ref: Executable Scripts-Footnote-180084 +Ref: Executable Scripts-Footnote-280186 +Node: Comments80733 +Node: Quoting83200 +Node: DOS Quoting88516 +Node: Sample Data Files89191 +Node: Very Simple91706 +Node: Two Rules96344 +Node: More Complex98239 +Ref: More Complex-Footnote-1101171 +Node: Statements/Lines101256 +Ref: Statements/Lines-Footnote-1105711 +Node: Other Features105976 +Node: When106904 +Node: Intro Summary109074 +Node: Invoking Gawk109840 +Node: Command Line111355 +Node: Options112146 +Ref: Options-Footnote-1127958 +Node: Other Arguments127983 +Node: Naming Standard Input130645 +Node: Environment Variables131739 +Node: AWKPATH Variable132297 +Ref: AWKPATH Variable-Footnote-1135169 +Ref: AWKPATH Variable-Footnote-2135214 +Node: AWKLIBPATH Variable135474 +Node: Other Environment Variables136233 +Node: Exit Status139888 +Node: Include Files140563 +Node: Loading Shared Libraries144141 +Node: Obsolete145525 +Node: Undocumented146222 +Node: Invoking Summary146489 +Node: Regexp148069 +Node: Regexp Usage149519 +Node: Escape Sequences151552 +Node: Regexp Operators157219 +Ref: Regexp Operators-Footnote-1164699 +Ref: Regexp Operators-Footnote-2164846 +Node: Bracket Expressions164944 +Ref: table-char-classes166834 +Node: GNU Regexp Operators169357 +Node: Case-sensitivity173080 +Ref: Case-sensitivity-Footnote-1175972 +Ref: Case-sensitivity-Footnote-2176207 +Node: Leftmost Longest176315 +Node: Computed Regexps177516 +Node: Regexp Summary180888 +Node: Reading Files182360 +Node: Records184409 +Node: awk split records185152 +Node: gawk split records190010 +Ref: gawk split records-Footnote-1194531 +Node: Fields194568 +Ref: Fields-Footnote-1197532 +Node: Nonconstant Fields197618 +Ref: Nonconstant Fields-Footnote-1199848 +Node: Changing Fields200050 +Node: Field Separators206004 +Node: Default Field Splitting208706 +Node: Regexp Field Splitting209823 +Node: Single Character Fields213164 +Node: Command Line Field Separator214223 +Node: Full Line Fields217565 +Ref: Full Line Fields-Footnote-1218073 +Node: Field Splitting Summary218119 +Ref: Field Splitting Summary-Footnote-1221218 +Node: Constant Size221319 +Node: Splitting By Content225926 +Ref: Splitting By Content-Footnote-1229676 +Node: Multiple Line229716 +Ref: Multiple Line-Footnote-1235572 +Node: Getline235751 +Node: Plain Getline237967 +Node: Getline/Variable240062 +Node: Getline/File241209 +Node: Getline/Variable/File242593 +Ref: Getline/Variable/File-Footnote-1244192 +Node: Getline/Pipe244279 +Node: Getline/Variable/Pipe246978 +Node: Getline/Coprocess248085 +Node: Getline/Variable/Coprocess249337 +Node: Getline Notes250074 +Node: Getline Summary252878 +Ref: table-getline-variants253286 +Node: Read Timeout254198 +Ref: Read Timeout-Footnote-1258025 +Node: Command line directories258083 +Node: Input Summary258987 +Node: Printing262101 +Node: Print263780 +Node: Print Examples265121 +Node: Output Separators267900 +Node: OFMT269916 +Node: Printf271274 +Node: Basic Printf272180 +Node: Control Letters273719 +Node: Format Modifiers277573 +Node: Printf Examples283600 +Node: Redirection286307 +Node: Special Files293279 +Node: Special FD293810 +Ref: Special FD-Footnote-1297434 +Node: Special Network297508 +Node: Special Caveats298358 +Node: Close Files And Pipes299154 +Ref: Close Files And Pipes-Footnote-1306317 +Ref: Close Files And Pipes-Footnote-2306465 +Node: Output Summary306615 +Node: Expressions307587 +Node: Values308772 +Node: Constants309448 +Node: Scalar Constants310128 +Ref: Scalar Constants-Footnote-1310987 +Node: Nondecimal-numbers311237 +Node: Regexp Constants314237 +Node: Using Constant Regexps314712 +Node: Variables317782 +Node: Using Variables318437 +Node: Assignment Options320161 +Node: Conversion322036 +Ref: table-locale-affects327472 +Ref: Conversion-Footnote-1328096 +Node: All Operators328205 +Node: Arithmetic Ops328835 +Node: Concatenation331340 +Ref: Concatenation-Footnote-1334136 +Node: Assignment Ops334256 +Ref: table-assign-ops339239 +Node: Increment Ops340556 +Node: Truth Values and Conditions343994 +Node: Truth Values345077 +Node: Typing and Comparison346126 +Node: Variable Typing346919 +Ref: Variable Typing-Footnote-1350819 +Node: Comparison Operators350941 +Ref: table-relational-ops351351 +Node: POSIX String Comparison354901 +Ref: POSIX String Comparison-Footnote-1355985 +Node: Boolean Ops356123 +Ref: Boolean Ops-Footnote-1360193 +Node: Conditional Exp360284 +Node: Function Calls362011 +Node: Precedence365769 +Node: Locales369438 +Node: Expressions Summary371069 +Node: Patterns and Actions373566 +Node: Pattern Overview374682 +Node: Regexp Patterns376359 +Node: Expression Patterns376902 +Node: Ranges380683 +Node: BEGIN/END383789 +Node: Using BEGIN/END384551 +Ref: Using BEGIN/END-Footnote-1387287 +Node: I/O And BEGIN/END387393 +Node: BEGINFILE/ENDFILE389678 +Node: Empty392609 +Node: Using Shell Variables392926 +Node: Action Overview395209 +Node: Statements397536 +Node: If Statement399384 +Node: While Statement400882 +Node: Do Statement402926 +Node: For Statement404082 +Node: Switch Statement407234 +Node: Break Statement409337 +Node: Continue Statement411392 +Node: Next Statement413185 +Node: Nextfile Statement415575 +Node: Exit Statement418230 +Node: Built-in Variables420634 +Node: User-modified421761 +Ref: User-modified-Footnote-1429446 +Node: Auto-set429508 +Ref: Auto-set-Footnote-1442410 +Ref: Auto-set-Footnote-2442615 +Node: ARGC and ARGV442671 +Node: Pattern Action Summary446525 +Node: Arrays448748 +Node: Array Basics450297 +Node: Array Intro451123 +Ref: figure-array-elements453096 +Node: Reference to Elements455503 +Node: Assigning Elements457776 +Node: Array Example458267 +Node: Scanning an Array459999 +Node: Controlling Scanning463014 +Ref: Controlling Scanning-Footnote-1468187 +Node: Delete468503 +Ref: Delete-Footnote-1471268 +Node: Numeric Array Subscripts471325 +Node: Uninitialized Subscripts473508 +Node: Multidimensional475133 +Node: Multiscanning478226 +Node: Arrays of Arrays479815 +Node: Arrays Summary484478 +Node: Functions486583 +Node: Built-in487456 +Node: Calling Built-in488534 +Node: Numeric Functions490522 +Ref: Numeric Functions-Footnote-1494356 +Ref: Numeric Functions-Footnote-2494713 +Ref: Numeric Functions-Footnote-3494761 +Node: String Functions495030 +Ref: String Functions-Footnote-1518041 +Ref: String Functions-Footnote-2518170 +Ref: String Functions-Footnote-3518418 +Node: Gory Details518505 +Ref: table-sub-escapes520174 +Ref: table-sub-posix-92521528 +Ref: table-sub-proposed522879 +Ref: table-posix-sub524233 +Ref: table-gensub-escapes525778 +Ref: Gory Details-Footnote-1526954 +Ref: Gory Details-Footnote-2527005 +Node: I/O Functions527156 +Ref: I/O Functions-Footnote-1534279 +Node: Time Functions534426 +Ref: Time Functions-Footnote-1544890 +Ref: Time Functions-Footnote-2544958 +Ref: Time Functions-Footnote-3545116 +Ref: Time Functions-Footnote-4545227 +Ref: Time Functions-Footnote-5545339 +Ref: Time Functions-Footnote-6545566 +Node: Bitwise Functions545832 +Ref: table-bitwise-ops546394 +Ref: Bitwise Functions-Footnote-1550639 +Node: Type Functions550823 +Node: I18N Functions551965 +Node: User-defined553610 +Node: Definition Syntax554414 +Ref: Definition Syntax-Footnote-1559339 +Node: Function Example559408 +Ref: Function Example-Footnote-1562052 +Node: Function Caveats562074 +Node: Calling A Function562592 +Node: Variable Scope563547 +Node: Pass By Value/Reference566535 +Node: Return Statement570043 +Node: Dynamic Typing573027 +Node: Indirect Calls573956 +Node: Functions Summary583669 +Node: Library Functions586208 +Ref: Library Functions-Footnote-1589783 +Ref: Library Functions-Footnote-2589926 +Node: Library Names590097 +Ref: Library Names-Footnote-1593570 +Ref: Library Names-Footnote-2593790 +Node: General Functions593876 +Node: Strtonum Function594904 +Node: Assert Function597834 +Node: Round Function601160 +Node: Cliff Random Function602701 +Node: Ordinal Functions603717 +Ref: Ordinal Functions-Footnote-1606794 +Ref: Ordinal Functions-Footnote-2607046 +Node: Join Function607257 +Ref: Join Function-Footnote-1609028 +Node: Getlocaltime Function609228 +Node: Readfile Function612964 +Node: Data File Management614803 +Node: Filetrans Function615435 +Node: Rewind Function619504 +Node: File Checking620891 +Ref: File Checking-Footnote-1622023 +Node: Empty Files622224 +Node: Ignoring Assigns624454 +Node: Getopt Function626008 +Ref: Getopt Function-Footnote-1637311 +Node: Passwd Functions637514 +Ref: Passwd Functions-Footnote-1646493 +Node: Group Functions646581 +Ref: Group Functions-Footnote-1654523 +Node: Walking Arrays654736 +Node: Library Functions Summary656906 +Node: Sample Programs658268 +Node: Running Examples658995 +Node: Clones659723 +Node: Cut Program660947 +Node: Egrep Program670815 +Ref: Egrep Program-Footnote-1678786 +Node: Id Program678896 +Node: Split Program682560 +Ref: Split Program-Footnote-1686098 +Node: Tee Program686226 +Node: Uniq Program689033 +Node: Wc Program696463 +Ref: Wc Program-Footnote-1700731 +Ref: Wc Program-Footnote-2700931 +Node: Miscellaneous Programs701023 +Node: Dupword Program702236 +Node: Alarm Program704267 +Node: Translate Program709081 +Ref: Translate Program-Footnote-1713472 +Ref: Translate Program-Footnote-2713742 +Node: Labels Program713876 +Ref: Labels Program-Footnote-1717247 +Node: Word Sorting717331 +Node: History Sorting721374 +Node: Extract Program723210 +Ref: Extract Program-Footnote-1730785 +Node: Simple Sed730914 +Node: Igawk Program733976 +Ref: Igawk Program-Footnote-1749152 +Ref: Igawk Program-Footnote-2749353 +Node: Anagram Program749491 +Node: Signature Program752559 +Node: Programs Summary753806 +Node: Advanced Features754994 +Node: Nondecimal Data756942 +Node: Array Sorting758519 +Node: Controlling Array Traversal759216 +Node: Array Sorting Functions767496 +Ref: Array Sorting Functions-Footnote-1771403 +Node: Two-way I/O771597 +Ref: Two-way I/O-Footnote-1777113 +Node: TCP/IP Networking777195 +Node: Profiling780039 +Node: Advanced Features Summary787581 +Node: Internationalization789445 +Node: I18N and L10N790925 +Node: Explaining gettext791611 +Ref: Explaining gettext-Footnote-1796751 +Ref: Explaining gettext-Footnote-2796935 +Node: Programmer i18n797100 +Node: Translator i18n801325 +Node: String Extraction802119 +Ref: String Extraction-Footnote-1803080 +Node: Printf Ordering803166 +Ref: Printf Ordering-Footnote-1805948 +Node: I18N Portability806012 +Ref: I18N Portability-Footnote-1808461 +Node: I18N Example808524 +Ref: I18N Example-Footnote-1811246 +Node: Gawk I18N811318 +Node: I18N Summary811956 +Node: Debugger813295 +Node: Debugging814317 +Node: Debugging Concepts814758 +Node: Debugging Terms816614 +Node: Awk Debugging819211 +Node: Sample Debugging Session820103 +Node: Debugger Invocation820623 +Node: Finding The Bug821956 +Node: List of Debugger Commands828438 +Node: Breakpoint Control829770 +Node: Debugger Execution Control833434 +Node: Viewing And Changing Data836794 +Node: Execution Stack840152 +Node: Debugger Info841665 +Node: Miscellaneous Debugger Commands845659 +Node: Readline Support850843 +Node: Limitations851735 +Node: Debugging Summary854009 +Node: Arbitrary Precision Arithmetic855173 +Ref: Arbitrary Precision Arithmetic-Footnote-1856822 +Node: General Arithmetic856970 +Node: Floating Point Issues858690 +Node: String Conversion Precision859571 +Ref: String Conversion Precision-Footnote-1861276 +Node: Unexpected Results861385 +Node: POSIX Floating Point Problems863538 +Ref: POSIX Floating Point Problems-Footnote-1867359 +Node: Integer Programming867397 +Node: Floating-point Programming869208 +Ref: Floating-point Programming-Footnote-1875536 +Ref: Floating-point Programming-Footnote-2875806 +Node: Floating-point Representation876070 +Node: Floating-point Context877235 +Ref: table-ieee-formats878074 +Node: Rounding Mode879458 +Ref: table-rounding-modes879937 +Ref: Rounding Mode-Footnote-1882952 +Node: Gawk and MPFR883131 +Node: Arbitrary Precision Floats884540 +Ref: Arbitrary Precision Floats-Footnote-1886983 +Node: Setting Precision887304 +Ref: table-predefined-precision-strings887988 +Node: Setting Rounding Mode890133 +Ref: table-gawk-rounding-modes890537 +Node: Floating-point Constants891724 +Node: Changing Precision893176 +Ref: Changing Precision-Footnote-1894568 +Node: Exact Arithmetic894742 +Node: Arbitrary Precision Integers897876 +Ref: Arbitrary Precision Integers-Footnote-1900891 +Node: Dynamic Extensions901038 +Node: Extension Intro902496 +Node: Plugin License903761 +Node: Extension Mechanism Outline904446 +Ref: figure-load-extension904870 +Ref: figure-load-new-function906355 +Ref: figure-call-new-function907357 +Node: Extension API Description909341 +Node: Extension API Functions Introduction910791 +Node: General Data Types915657 +Ref: General Data Types-Footnote-1921350 +Node: Requesting Values921649 +Ref: table-value-types-returned922386 +Node: Memory Allocation Functions923344 +Ref: Memory Allocation Functions-Footnote-1926091 +Node: Constructor Functions926187 +Node: Registration Functions927945 +Node: Extension Functions928630 +Node: Exit Callback Functions930932 +Node: Extension Version String932181 +Node: Input Parsers932831 +Node: Output Wrappers942634 +Node: Two-way processors947150 +Node: Printing Messages949354 +Ref: Printing Messages-Footnote-1950431 +Node: Updating `ERRNO'950583 +Node: Accessing Parameters951322 +Node: Symbol Table Access952552 +Node: Symbol table by name953066 +Node: Symbol table by cookie955042 +Ref: Symbol table by cookie-Footnote-1959175 +Node: Cached values959238 +Ref: Cached values-Footnote-1962742 +Node: Array Manipulation962833 +Ref: Array Manipulation-Footnote-1963931 +Node: Array Data Types963970 +Ref: Array Data Types-Footnote-1966673 +Node: Array Functions966765 +Node: Flattening Arrays970639 +Node: Creating Arrays977491 +Node: Extension API Variables982222 +Node: Extension Versioning982858 +Node: Extension API Informational Variables984759 +Node: Extension API Boilerplate985845 +Node: Finding Extensions989649 +Node: Extension Example990209 +Node: Internal File Description990939 +Node: Internal File Ops995030 +Ref: Internal File Ops-Footnote-11006576 +Node: Using Internal File Ops1006716 +Ref: Using Internal File Ops-Footnote-11009063 +Node: Extension Samples1009331 +Node: Extension Sample File Functions1010855 +Node: Extension Sample Fnmatch1018423 +Node: Extension Sample Fork1019904 +Node: Extension Sample Inplace1021117 +Node: Extension Sample Ord1022897 +Node: Extension Sample Readdir1023733 +Ref: table-readdir-file-types1024589 +Node: Extension Sample Revout1025388 +Node: Extension Sample Rev2way1025979 +Node: Extension Sample Read write array1026720 +Node: Extension Sample Readfile1028599 +Node: Extension Sample API Tests1029699 +Node: Extension Sample Time1030224 +Node: gawkextlib1031539 +Node: Language History1034326 +Node: V7/SVR3.11035920 +Node: SVR41038240 +Node: POSIX1039682 +Node: BTL1041068 +Node: POSIX/GNU1041802 +Node: Feature History1047401 +Node: Common Extensions1060513 +Node: Ranges and Locales1061825 +Ref: Ranges and Locales-Footnote-11066442 +Ref: Ranges and Locales-Footnote-21066469 +Ref: Ranges and Locales-Footnote-31066703 +Node: Contributors1066924 +Node: Installation1072362 +Node: Gawk Distribution1073256 +Node: Getting1073740 +Node: Extracting1074566 +Node: Distribution contents1076208 +Node: Unix Installation1081925 +Node: Quick Installation1082542 +Node: Additional Configuration Options1084984 +Node: Configuration Philosophy1086722 +Node: Non-Unix Installation1089073 +Node: PC Installation1089531 +Node: PC Binary Installation1090842 +Node: PC Compiling1092690 +Ref: PC Compiling-Footnote-11095689 +Node: PC Testing1095794 +Node: PC Using1096970 +Node: Cygwin1101128 +Node: MSYS1101937 +Node: VMS Installation1102451 +Node: VMS Compilation1103247 +Ref: VMS Compilation-Footnote-11104469 +Node: VMS Dynamic Extensions1104527 +Node: VMS Installation Details1105900 +Node: VMS Running1108152 +Node: VMS GNV1110986 +Node: VMS Old Gawk1111709 +Node: Bugs1112179 +Node: Other Versions1116183 +Node: Notes1122408 +Node: Compatibility Mode1123208 +Node: Additions1123990 +Node: Accessing The Source1124915 +Node: Adding Code1126351 +Node: New Ports1132529 +Node: Derived Files1137010 +Ref: Derived Files-Footnote-11142091 +Ref: Derived Files-Footnote-21142125 +Ref: Derived Files-Footnote-31142721 +Node: Future Extensions1142835 +Node: Implementation Limitations1143441 +Node: Extension Design1144689 +Node: Old Extension Problems1145843 +Ref: Old Extension Problems-Footnote-11147360 +Node: Extension New Mechanism Goals1147417 +Ref: Extension New Mechanism Goals-Footnote-11150777 +Node: Extension Other Design Decisions1150966 +Node: Extension Future Growth1153072 +Node: Old Extension Mechanism1153908 +Node: Basic Concepts1155648 +Node: Basic High Level1156329 +Ref: figure-general-flow1156601 +Ref: figure-process-flow1157200 +Ref: Basic High Level-Footnote-11160429 +Node: Basic Data Typing1160614 +Node: Glossary1163941 +Node: Copying1189093 +Node: GNU Free Documentation License1226649 +Node: Index1251785 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index ba6be294..9a1868a8 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -1698,7 +1698,7 @@ emphasized @emph{like this}, and if a point needs to be made strongly, it is done @strong{like this}. The first occurrence of a new term is usually its @dfn{definition} and appears in the same font as the previous occurrence of ``definition'' in this sentence. -Finally, @var{FN}s are indicated like this: @file{/path/to/ourfile}. +Finally, @value{FN}s are indicated like this: @file{/path/to/ourfile}. @end ifnotinfo Characters that you type at the keyboard look @kbd{like this}. In particular, @@ -2354,7 +2354,7 @@ awk -f @var{source-file} @var{input-file1} @var{input-file2} @dots{} @cindex @option{-f} option @cindex command line, option @option{-f} The @option{-f} instructs the @command{awk} utility to get the @command{awk} program -from the file @var{source-file}. Any @var{FN} can be used for +from the file @var{source-file}. Any @value{FN} can be used for @var{source-file}. For example, you could put the program: @example @@ -2379,8 +2379,8 @@ awk "BEGIN @{ print \"Don't Panic!\" @}" @noindent This was explained earlier (@pxref{Read Terminal}). -Note that you don't usually need single quotes around the @var{FN} that you -specify with @option{-f}, because most @var{FN}s don't contain any of the shell's +Note that you don't usually need single quotes around the @value{FN} that you +specify with @option{-f}, because most @value{FN}s don't contain any of the shell's special characters. Notice that in @file{advice}, the @command{awk} program did not have single quotes around it. The quotes are only needed for programs that are provided on the @command{awk} command line. @@ -2390,7 +2390,7 @@ for programs that are provided on the @command{awk} command line. @c STARTOFRANGE qs2x @cindex @code{'} (single quote) in @command{gawk} command lines If you want to clearly identify your @command{awk} program files as such, -you can add the extension @file{.awk} to the @var{FN}. This doesn't +you can add the extension @file{.awk} to the @value{FN}. This doesn't affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. @@ -2417,11 +2417,11 @@ BEGIN @{ print "Don't Panic!" @} After making this file executable (with the @command{chmod} utility), simply type @samp{advice} at the shell and the system arranges to run @command{awk}@footnote{The -line beginning with @samp{#!} lists the full @var{FN} of an interpreter +line beginning with @samp{#!} lists the full @value{FN} of an interpreter to run and an optional initial command-line argument to pass to that interpreter. The operating system then runs the interpreter with the given argument and the full argument list of the executed program. The first argument -in the list is the full @var{FN} of the @command{awk} program. +in the list is the full @value{FN} of the @command{awk} program. The rest of the argument list contains either options to @command{awk}, or @value{DF}s, or both. Note that on many systems @command{awk} may be found in @@ -2694,7 +2694,7 @@ awk -F"" '@var{program}' @var{files} # wrong! @noindent In the second case, @command{awk} will attempt to use the text of the program -as the value of @code{FS}, and the first @var{FN} as the text of the program! +as the value of @code{FS}, and the first @value{FN} as the text of the program! This results in syntax errors at best, and confusing behavior at worst. @end itemize @@ -2944,7 +2944,7 @@ of the program will give you a good idea of what is going on, but please read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) Most of the examples use a @value{DF} named @file{data}. This is just a placeholder; if you use these programs yourself, substitute -your own @var{FN}s for @file{data}. +your own @value{FN}s for @file{data}. For future reference, note that there is often more than one way to do things in @command{awk}. At some point, you may want to look back at these examples and see if @@ -3136,7 +3136,7 @@ the file. The fourth field identifies the group of the file. The fifth field contains the size of the file in bytes. The sixth, seventh, and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field -contains the @var{FN}.@footnote{The @samp{LC_ALL=C} is +contains the @value{FN}.@footnote{The @samp{LC_ALL=C} is needed to produce this traditional-style output from @command{ls}.} @c @cindex automatic initialization @@ -3573,8 +3573,8 @@ conventions. @cindex @code{-} (hyphen), filenames beginning with @cindex hyphen (@code{-}), filenames beginning with -This is useful if you have @var{FN}s that start with @samp{-}, -or in shell scripts, if you have @var{FN}s that will be specified +This is useful if you have @value{FN}s that start with @samp{-}, +or in shell scripts, if you have @value{FN}s that will be specified by the user that could start with @samp{-}. It is also useful for passing options on to the @command{awk} program; see @ref{Getopt Function}. @@ -3819,7 +3819,7 @@ Enable pretty-printing of @command{awk} programs. By default, output program is created in a file named @file{awkprof.out} (@pxref{Profiling}). The optional @var{file} argument allows you to specify a different -@var{FN} for the output. +@value{FN} for the output. No space is allowed between the @option{-o} and @var{file}, if @var{file} is supplied. @@ -3846,7 +3846,7 @@ Enable profiling of @command{awk} programs (@pxref{Profiling}). By default, profiles are created in a file named @file{awkprof.out}. The optional @var{file} argument allows you to specify a different -@var{FN} for the profile file. +@value{FN} for the profile file. No space is allowed between the @option{-p} and @var{file}, if @var{file} is supplied. @@ -4058,9 +4058,9 @@ current element. @cindex input files, variable assignments and @cindex variable assignments and input files -The distinction between @var{FN} arguments and variable-assignment +The distinction between @value{FN} arguments and variable-assignment arguments is made when @command{awk} is about to open the next input file. -At that point in execution, it checks the @var{FN} to see whether +At that point in execution, it checks the @value{FN} to see whether it is really a variable assignment; if so, @command{awk} sets the variable instead of reading a file. @@ -4077,7 +4077,7 @@ sequences (@pxref{Escape Sequences}). @value{DARKCORNER} In some very early implementations of @command{awk}, when a variable assignment -occurred before any @var{FN}s, the assignment would happen @emph{before} +occurred before any @value{FN}s, the assignment would happen @emph{before} the @code{BEGIN} rule was executed. @command{awk}'s behavior was thus inconsistent; some command-line assignments were available inside the @code{BEGIN} rule, while others were not. Unfortunately, @@ -4125,13 +4125,13 @@ You may also use @code{"-"} to name standard input when reading files with @code{getline} (@pxref{Getline/File}). In addition, @command{gawk} allows you to specify the special -@var{FN} @file{/dev/stdin}, both on the command line and +@value{FN} @file{/dev/stdin}, both on the command line and with @code{getline}. Some other versions of @command{awk} also support this, but it is not standard. (Some operating systems provide a @file{/dev/stdin} file in the file system; however, @command{gawk} always processes -this @var{FN} itself.) +this @value{FN} itself.) @node Environment Variables @section The Environment Variables @command{gawk} Uses @@ -4161,7 +4161,7 @@ on the command-line with the @option{-f} option. In most @command{awk} implementations, you must supply a precise path name for each program file, unless the file is in the current directory. -But in @command{gawk}, if the @var{FN} supplied to the @option{-f} +But in @command{gawk}, if the @value{FN} supplied to the @option{-f} or @option{-i} options does not contain a directory separator @samp{/}, then @command{gawk} searches a list of directories (called the @dfn{search path}), one by one, looking for a @@ -4181,7 +4181,7 @@ though.} The search path feature is particularly helpful for building libraries of useful @command{awk} functions. The library files can be placed in a standard directory in the default path and then specified on -the command line with a short @var{FN}. Otherwise, the full @var{FN} +the command line with a short @value{FN}. Otherwise, the full @value{FN} would have to be typed for each file. By using the @option{-i} option, or the @option{--source} and @option{-f} options, your command-line @@ -4408,7 +4408,7 @@ use @code{@@include} followed by the name of the file to be included, enclosed in double quotes. @quotation NOTE -Keep in mind that this is a language construct and the @var{FN} cannot +Keep in mind that this is a language construct and the @value{FN} cannot be a string variable, but rather just a literal string constant in double quotes. @end quotation @@ -4433,7 +4433,7 @@ $ @kbd{gawk -f test3} @print{} This is file test3. @end example -The @var{FN} can, of course, be a pathname. For example: +The @value{FN} can, of course, be a pathname. For example: @example @@include "../io_funcs" @@ -7988,7 +7988,7 @@ the value of @code{NF} do not change. @cindex operators, input/output Use @samp{getline < @var{file}} to read the next record from @var{file}. Here @var{file} is a string-valued expression that -specifies the @var{FN}. @samp{< @var{file}} is called a @dfn{redirection} +specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection} because it directs input to come from a different place. For example, the following program reads its input record from the file @file{secondary.input} when it @@ -8606,7 +8606,7 @@ For printing with specifications, you need the @code{printf} statement @cindex @code{printf} statement Besides basic and formatted printing, this @value{CHAPTER} also covers I/O redirections to files and pipes, introduces -the special @var{FN}s that @command{gawk} processes internally, +the special @value{FN}s that @command{gawk} processes internally, and discusses the @code{close()} built-in function. @menu @@ -9415,9 +9415,9 @@ but they work identically for @code{printf}: @cindex operators, input/output @item print @var{items} > @var{output-file} This redirection prints the items into the output file named -@var{output-file}. The @var{FN} @var{output-file} can be any +@var{output-file}. The @value{FN} @var{output-file} can be any expression. Its value is changed to a string and then used as a -@var{FN} (@pxref{Expressions}). +@value{FN} (@pxref{Expressions}). When this type of redirection is used, the @var{output-file} is erased before the first output is written to it. Subsequent writes to the same @@ -9590,7 +9590,7 @@ open as many pipelines as the underlying operating system permits. A particularly powerful way to use redirection is to build command lines and pipe them into the shell, @command{sh}. For example, suppose you -have a list of files brought over from a system where all the @var{FN}s +have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: @@ -9622,7 +9622,7 @@ It then sends the list to the shell for execution. A particularly powerful way to use redirection is to build command lines and pipe them into the shell, @command{sh}. For example, suppose you -have a list of files brought over from a system where all the @var{FN}s +have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: @@ -9649,8 +9649,8 @@ It then sends the list to the shell for execution. @c STARTOFRANGE gfn @cindex @command{gawk}, file names in -@command{gawk} provides a number of special @var{FN}s that it interprets -internally. These @var{FN}s provide access to standard file descriptors +@command{gawk} provides a number of special @value{FN}s that it interprets +internally. These @value{FN}s provide access to standard file descriptors and TCP/IP networking. @menu @@ -9714,12 +9714,12 @@ that happens, writing to the screen is not correct. In fact, if terminal at all. Then opening @file{/dev/tty} fails. -@command{gawk} provides special @var{FN}s for accessing the three standard +@command{gawk} provides special @value{FN}s for accessing the three standard streams. @value{COMMONEXT} It also provides syntax for accessing -any other inherited open files. If the @var{FN} matches +any other inherited open files. If the @value{FN} matches one of these special names when @command{gawk} redirects input or output, -then it directly uses the stream that the @var{FN} stands for. -These special @var{FN}s work for all operating systems that @command{gawk} +then it directly uses the stream that the @value{FN} stands for. +These special @value{FN}s work for all operating systems that @command{gawk} has been ported to, not just those that are POSIX-compliant: @cindex common extensions, @code{/dev/stdin} special file @@ -9749,7 +9749,7 @@ the shell). Unless special pains are taken in the shell from which @command{gawk} is invoked, only descriptors 0, 1, and 2 are available. @end table -The @var{FN}s @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} +The @value{FN}s @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} are aliases for @file{/dev/fd/0}, @file{/dev/fd/1}, and @file{/dev/fd/2}, respectively. However, they are more self-explanatory. The proper way to write an error message in a @command{gawk} program @@ -9760,13 +9760,13 @@ print "Serious error detected!" > "/dev/stderr" @end example @cindex troubleshooting, quotes with file names -Note the use of quotes around the @var{FN}. +Note the use of quotes around the @value{FN}. Like any other redirection, the value must be a string. It is a common error to omit the quotes, which leads to confusing results. @c Exercise: What does it do? :-) -Finally, using the @code{close()} function on a @var{FN} of the +Finally, using the @code{close()} function on a @value{FN} of the form @code{"/dev/fd/@var{N}"}, for file descriptor numbers above two, does actually close the given file descriptor. @@ -9782,7 +9782,7 @@ versions of @command{awk}. @command{gawk} programs can open a two-way TCP/IP connection, acting as either a client or a server. -This is done using a special @var{FN} of the form: +This is done using a special @value{FN} of the form: @example @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}} @@ -9792,7 +9792,7 @@ The @var{net-type} is one of @samp{inet}, @samp{inet4} or @samp{inet6}. The @var{protocol} is one of @samp{tcp} or @samp{udp}, and the other fields represent the other essential pieces of information for making a networking connection. -These @var{FN}s are used with the @samp{|&} operator for communicating +These @value{FN}s are used with the @samp{|&} operator for communicating with a coprocess (@pxref{Two-way I/O}). This is an advanced feature, mentioned here only for completeness. @@ -9803,18 +9803,18 @@ Full discussion is delayed until @subsection Special @value{FFN} Caveats Here is a list of things to bear in mind when using the -special @var{FN}s that @command{gawk} provides: +special @value{FN}s that @command{gawk} provides: @itemize @value{BULLET} @cindex compatibility mode (@command{gawk}), file names @cindex file names, in compatibility mode @item -Recognition of these special @var{FN}s is disabled if @command{gawk} is in +Recognition of these special @value{FN}s is disabled if @command{gawk} is in compatibility mode (@pxref{Options}). @item @command{gawk} @emph{always} -interprets these special @var{FN}s. +interprets these special @value{FN}s. For example, using @samp{/dev/fd/4} for output actually writes on file descriptor 4, and not on a new file descriptor that is @code{dup()}'ed from file descriptor 4. Most of @@ -9837,7 +9837,7 @@ Doing so results in unpredictable behavior. @cindex coprocesses, closing @cindex @code{getline} command, coprocesses@comma{} using from -If the same @var{FN} or the same shell command is used with @code{getline} +If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program (@pxref{Getline}), the file is opened (or the command is executed) the first time only. @@ -9846,7 +9846,7 @@ The next time the same file or command is used with @code{getline}, another record is read from it, and so on. Similarly, when a file or pipe is opened for output, @command{awk} remembers -the @var{FN} or command associated with it, and subsequent +the @value{FN} or command associated with it, and subsequent writes to the same file or command are appended to the previous writes. The file or pipe stays open until @command{awk} exits. @@ -9888,7 +9888,7 @@ file or command, or the next @code{print} or @code{printf} to that file or command, reopens the file or reruns the command. Because the expression that you use to close a file or pipeline must exactly match the expression used to open the file or run the command, -it is good practice to use a variable to store the @var{FN} or command. +it is good practice to use a valueiable to store the @value{FN} or command. The previous example becomes the following: @example @@ -10580,7 +10580,7 @@ as in the following: @noindent the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment -must precede all the @var{FN} arguments, as well as the program text. +must precede all the @value{FN} arguments, as well as the program text. (@xref{Options}, for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by @@ -14385,14 +14385,14 @@ about how @command{awk} uses these variables. @item @code{ARGIND #} The index in @code{ARGV} of the current file being processed. Every time @command{gawk} opens a new @value{DF} for processing, it sets -@code{ARGIND} to the index in @code{ARGV} of the @var{FN}. +@code{ARGIND} to the index in @code{ARGV} of the @value{FN}. When @command{gawk} is processing the input files, @samp{FILENAME == ARGV[ARGIND]} is always true. @cindex files, processing@comma{} @code{ARGIND} variable and This variable is useful in file processing; it allows you to tell how far along you are in the list of @value{DF}s as well as to distinguish between -successive instances of the same @var{FN} on the command line. +successive instances of the same @value{FN} on the command line. @cindex file names, distinguishing While you can change the value of @code{ARGIND} within your @command{awk} @@ -14872,11 +14872,11 @@ additional files to be read. If the value of @code{ARGC} is decreased, that eliminates input files from the end of the list. By recording the old value of @code{ARGC} elsewhere, a program can treat the eliminated arguments as -something other than @var{FN}s. +something other than @value{FN}s. To eliminate a file from the middle of the list, store the null string (@code{""}) into @code{ARGV} in place of the file's name. As a -special feature, @command{awk} ignores @var{FN}s that have been +special feature, @command{awk} ignores @value{FN}s that have been replaced with the null string. Another option is to use the @code{delete} statement to remove elements from @@ -21032,13 +21032,13 @@ This file must be loaded before the user's ``main'' program, so that the rule it supplies is executed first. This rule relies on @command{awk}'s @code{FILENAME} variable that -automatically changes for each new @value{DF}. The current @var{FN} is +automatically changes for each new @value{DF}. The current @value{FN} is saved in a private variable, @code{_oldfilename}. If @code{FILENAME} does not equal @code{_oldfilename}, then a new @value{DF} is being processed and it is necessary to call @code{endfile()} for the old file. Because @code{endfile()} should only be called if a file has been processed, the program first checks to make sure that @code{_oldfilename} is not the null -string. The program then assigns the current @var{FN} to +string. The program then assigns the current @value{FN} to @code{_oldfilename} and calls @code{beginfile()} for the file. Because, like all @command{awk} variables, @code{_oldfilename} is initialized to the null string, this rule executes correctly even for the @@ -21259,7 +21259,7 @@ Using @command{gawk}'s @code{ARGIND} variable @value{DF} has been skipped. Similar to the library file presented in @ref{Filetrans Function}, the following library file calls a function named @code{zerofile()} that the user must provide. The arguments passed are -the @var{FN} and the position in @code{ARGV} where it was found: +the @value{FN} and the position in @code{ARGV} where it was found: @cindex @code{zerofile.awk} program @example @@ -21354,8 +21354,8 @@ END @{ Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options}). -In particular, if you have a @var{FN} that contains an @samp{=} character, -@command{awk} treats the @var{FN} as an assignment, and does not process it. +In particular, if you have a @value{FN} that contains an @samp{=} character, +@command{awk} treats the @value{FN} as an assignment, and does not process it. Some users have suggested an additional command-line option for @command{gawk} to disable command-line assignments. However, some simple programming with @@ -21399,7 +21399,7 @@ awk -v No_command_assign=1 -f noassign.awk -f yourprog.awk * The function works by looping through the arguments. It prepends @samp{./} to any argument that matches the form -of a variable assignment, turning that argument into a @var{FN}. +of a variable assignment, turning that argument into a @value{FN}. The use of @code{No_command_assign} allows you to disable command-line assignments at invocation time, by giving the variable a true value. @@ -21755,7 +21755,7 @@ etc., as its own options. After @code{getopt()} is through, it is the responsibility of the user level code to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the -command-line options as @var{FN}s. +command-line options as @value{FN}s. @end quotation Several of the sample programs presented in @@ -22874,7 +22874,7 @@ spaces. Also remember that after @code{getopt()} is through we have to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the command-line options -as @var{FN}s. +as @value{FN}s. After dealing with the command-line options, the program verifies that the options make sense. Only one or the other of @option{-c} and @option{-f} @@ -23071,8 +23071,8 @@ You invoke it as follows: The @var{pattern} is a regular expression. In typical usage, the regular expression is quoted to prevent the shell from expanding any of the -special characters as @var{FN} wildcards. Normally, @command{egrep} -prints the lines that matched. If multiple @var{FN}s are provided on +special characters as @value{FN} wildcards. Normally, @command{egrep} +prints the lines that matched. If multiple @value{FN}s are provided on the command line, each output line is preceded by the name of the file and a colon. @@ -23163,7 +23163,7 @@ pattern is supplied with @option{-e}, the first nonoption on the command line is used. The @command{awk} command-line arguments up to @code{ARGV[Optind]} are cleared, so that @command{awk} won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are -specified, we make sure to note this so that the @var{FN}s can precede the +specified, we make sure to note this so that the @value{FN}s can precede the matched lines in the output: @example @@ -23266,9 +23266,9 @@ A number of additional tests are made, but they are only done if we are not counting lines. First, if the user only wants exit status (@code{no_print} is true), then it is enough to know that @emph{one} line in this file matched, and we can skip on to the next file with -@code{nextfile}. Similarly, if we are only printing @var{FN}s, we can -print the @var{FN}, and then skip to the next file with @code{nextfile}. -Finally, each line is printed, with a leading @var{FN} and colon +@code{nextfile}. Similarly, if we are only printing @value{FN}s, we can +print the @value{FN}, and then skip to the next file with @code{nextfile}. +Finally, each line is printed, with a leading @value{FN} and colon if necessary: @cindex @code{!} (exclamation point), @code{!} operator @@ -23518,7 +23518,7 @@ number of lines in each file, supply a number on the command line preceded with a minus; e.g., @samp{-500} for files with 500 lines in them instead of 1000. To change the name of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional -argument that specifies the @var{FN} prefix. +argument that specifies the @value{FN} prefix. Here is a version of @command{split} in @command{awk}. It uses the @code{ord()} and @code{chr()} functions presented in @@ -31745,7 +31745,7 @@ empty string (@code{""}). The @code{func} pointer is the address of a An @dfn{exit callback} function is a function that @command{gawk} calls before it exits. -Such functions are useful if you have general ``clean up'' tasks +Such functions are useful if you have general ``cleanup'' tasks that should be performed in your extension (such as closing data base connections or other resource deallocations). You can register such @@ -32548,7 +32548,7 @@ keeps track of the usage. When a variable's value changes, @command{gawk} simply decrements the reference count on the old value and updates the variable to use the new value. -Finally, as part of your clean up action (@pxref{Exit Callback Functions}) +Finally, as part of your cleanup action (@pxref{Exit Callback Functions}) you should release any cached values that you created, using @code{release_value()}. @@ -34234,10 +34234,10 @@ The arguments to @code{fnmatch()} are: @table @code @item pattern -The @var{FN} wildcard to match. +The @value{FN} wildcard to match. @item string -The @var{FN} string. +The @value{FN} string. @item flag Either zero, or the bitwise OR of one or more of the @@ -34344,8 +34344,8 @@ standard output to a temporary file configured to have the same owner and permissions as the original. After the file has been processed, the extension restores standard output to its original destination. If @code{INPLACE_SUFFIX} is not an empty string, the original file is -linked to a backup @var{FN} created by appending that suffix. Finally, -the temporary file is renamed to the original @var{FN}. +linked to a backup @value{FN} created by appending that suffix. Finally, +the temporary file is renamed to the original @value{FN}. If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. @@ -34411,7 +34411,7 @@ on the command line (or with @code{getline}), they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode number and the -@var{FN}, separated by a forward slash character. +@value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record has a third field (also separated by a slash) which is a single letter indicating the type of the file. The letters are file types are shown @@ -37337,7 +37337,7 @@ $ @kbd{MMK/DESCRIPTION=[.vms]descrip.mms gawk} @end example @command{MMK} is an open source, free, near-clone of @command{MMS} and -can better handle ODS-5 volumes with upper- and lowercase @var{FN}s. +can better handle ODS-5 volumes with upper- and lowercase @value{FN}s. @command{MMK} is available from @uref{https://github.com/endlesssoftware/mmk}. With ODS-5 volumes and extended parsing enabled, the case of the target @@ -37472,7 +37472,7 @@ for @command{awk} program files. For the @option{-f} option, if the specified looks in the current directory first, then in the directory specified by the translation of @samp{AWK_LIBRARY} if the file is not found. If, after searching in both directories, the file still is not found, -@command{gawk} appends the suffix @samp{.awk} to the @var{FN} and retries +@command{gawk} appends the suffix @samp{.awk} to the @value{FN} and retries the file search. If @samp{AWK_LIBRARY} has no definition, a default value of @samp{SYS$LIBRARY:} is used for it. @@ -38764,7 +38764,7 @@ two-way I/O. @item An extension should be able to provide a ``call back'' function -to perform clean up actions when @command{gawk} exits. +to perform cleanup actions when @command{gawk} exits. @item An extension should be able to provide a version string so that @@ -38861,8 +38861,8 @@ in @value{PVERSION} 4.1. However, for many years @command{gawk} provided an extension mechanism that required knowledge of @command{gawk} internals and that was not as well designed. -In order to provide a transition period, @command{gawk} version -4.1 continues to support the original extension mechanism. +In order to provide a transition period, @command{gawk} @value{PVERSION} 4.1 +continues to support the original extension mechanism. This will be true for the life of exactly one major release. This support will be withdrawn, and removed from the source code, at the next major release. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 4efad7eb..446fb2c8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -1665,7 +1665,7 @@ emphasized @emph{like this}, and if a point needs to be made strongly, it is done @strong{like this}. The first occurrence of a new term is usually its @dfn{definition} and appears in the same font as the previous occurrence of ``definition'' in this sentence. -Finally, @var{FN}s are indicated like this: @file{/path/to/ourfile}. +Finally, @value{FN}s are indicated like this: @file{/path/to/ourfile}. @end ifnotinfo Characters that you type at the keyboard look @kbd{like this}. In particular, @@ -2321,7 +2321,7 @@ awk -f @var{source-file} @var{input-file1} @var{input-file2} @dots{} @cindex @option{-f} option @cindex command line, option @option{-f} The @option{-f} instructs the @command{awk} utility to get the @command{awk} program -from the file @var{source-file}. Any @var{FN} can be used for +from the file @var{source-file}. Any @value{FN} can be used for @var{source-file}. For example, you could put the program: @example @@ -2346,8 +2346,8 @@ awk "BEGIN @{ print \"Don't Panic!\" @}" @noindent This was explained earlier (@pxref{Read Terminal}). -Note that you don't usually need single quotes around the @var{FN} that you -specify with @option{-f}, because most @var{FN}s don't contain any of the shell's +Note that you don't usually need single quotes around the @value{FN} that you +specify with @option{-f}, because most @value{FN}s don't contain any of the shell's special characters. Notice that in @file{advice}, the @command{awk} program did not have single quotes around it. The quotes are only needed for programs that are provided on the @command{awk} command line. @@ -2357,7 +2357,7 @@ for programs that are provided on the @command{awk} command line. @c STARTOFRANGE qs2x @cindex @code{'} (single quote) in @command{gawk} command lines If you want to clearly identify your @command{awk} program files as such, -you can add the extension @file{.awk} to the @var{FN}. This doesn't +you can add the extension @file{.awk} to the @value{FN}. This doesn't affect the execution of the @command{awk} program but it does make ``housekeeping'' easier. @@ -2384,11 +2384,11 @@ BEGIN @{ print "Don't Panic!" @} After making this file executable (with the @command{chmod} utility), simply type @samp{advice} at the shell and the system arranges to run @command{awk}@footnote{The -line beginning with @samp{#!} lists the full @var{FN} of an interpreter +line beginning with @samp{#!} lists the full @value{FN} of an interpreter to run and an optional initial command-line argument to pass to that interpreter. The operating system then runs the interpreter with the given argument and the full argument list of the executed program. The first argument -in the list is the full @var{FN} of the @command{awk} program. +in the list is the full @value{FN} of the @command{awk} program. The rest of the argument list contains either options to @command{awk}, or @value{DF}s, or both. Note that on many systems @command{awk} may be found in @@ -2622,7 +2622,7 @@ awk -F"" '@var{program}' @var{files} # wrong! @noindent In the second case, @command{awk} will attempt to use the text of the program -as the value of @code{FS}, and the first @var{FN} as the text of the program! +as the value of @code{FS}, and the first @value{FN} as the text of the program! This results in syntax errors at best, and confusing behavior at worst. @end itemize @@ -2872,7 +2872,7 @@ of the program will give you a good idea of what is going on, but please read the rest of the @value{DOCUMENT} to become an @command{awk} expert!) Most of the examples use a @value{DF} named @file{data}. This is just a placeholder; if you use these programs yourself, substitute -your own @var{FN}s for @file{data}. +your own @value{FN}s for @file{data}. For future reference, note that there is often more than one way to do things in @command{awk}. At some point, you may want to look back at these examples and see if @@ -3064,7 +3064,7 @@ the file. The fourth field identifies the group of the file. The fifth field contains the size of the file in bytes. The sixth, seventh, and eighth fields contain the month, day, and time, respectively, that the file was last modified. Finally, the ninth field -contains the @var{FN}.@footnote{The @samp{LC_ALL=C} is +contains the @value{FN}.@footnote{The @samp{LC_ALL=C} is needed to produce this traditional-style output from @command{ls}.} @c @cindex automatic initialization @@ -3501,8 +3501,8 @@ conventions. @cindex @code{-} (hyphen), filenames beginning with @cindex hyphen (@code{-}), filenames beginning with -This is useful if you have @var{FN}s that start with @samp{-}, -or in shell scripts, if you have @var{FN}s that will be specified +This is useful if you have @value{FN}s that start with @samp{-}, +or in shell scripts, if you have @value{FN}s that will be specified by the user that could start with @samp{-}. It is also useful for passing options on to the @command{awk} program; see @ref{Getopt Function}. @@ -3747,7 +3747,7 @@ Enable pretty-printing of @command{awk} programs. By default, output program is created in a file named @file{awkprof.out} (@pxref{Profiling}). The optional @var{file} argument allows you to specify a different -@var{FN} for the output. +@value{FN} for the output. No space is allowed between the @option{-o} and @var{file}, if @var{file} is supplied. @@ -3774,7 +3774,7 @@ Enable profiling of @command{awk} programs (@pxref{Profiling}). By default, profiles are created in a file named @file{awkprof.out}. The optional @var{file} argument allows you to specify a different -@var{FN} for the profile file. +@value{FN} for the profile file. No space is allowed between the @option{-p} and @var{file}, if @var{file} is supplied. @@ -3986,9 +3986,9 @@ current element. @cindex input files, variable assignments and @cindex variable assignments and input files -The distinction between @var{FN} arguments and variable-assignment +The distinction between @value{FN} arguments and variable-assignment arguments is made when @command{awk} is about to open the next input file. -At that point in execution, it checks the @var{FN} to see whether +At that point in execution, it checks the @value{FN} to see whether it is really a variable assignment; if so, @command{awk} sets the variable instead of reading a file. @@ -4005,7 +4005,7 @@ sequences (@pxref{Escape Sequences}). @value{DARKCORNER} In some very early implementations of @command{awk}, when a variable assignment -occurred before any @var{FN}s, the assignment would happen @emph{before} +occurred before any @value{FN}s, the assignment would happen @emph{before} the @code{BEGIN} rule was executed. @command{awk}'s behavior was thus inconsistent; some command-line assignments were available inside the @code{BEGIN} rule, while others were not. Unfortunately, @@ -4053,13 +4053,13 @@ You may also use @code{"-"} to name standard input when reading files with @code{getline} (@pxref{Getline/File}). In addition, @command{gawk} allows you to specify the special -@var{FN} @file{/dev/stdin}, both on the command line and +@value{FN} @file{/dev/stdin}, both on the command line and with @code{getline}. Some other versions of @command{awk} also support this, but it is not standard. (Some operating systems provide a @file{/dev/stdin} file in the file system; however, @command{gawk} always processes -this @var{FN} itself.) +this @value{FN} itself.) @node Environment Variables @section The Environment Variables @command{gawk} Uses @@ -4089,7 +4089,7 @@ on the command-line with the @option{-f} option. In most @command{awk} implementations, you must supply a precise path name for each program file, unless the file is in the current directory. -But in @command{gawk}, if the @var{FN} supplied to the @option{-f} +But in @command{gawk}, if the @value{FN} supplied to the @option{-f} or @option{-i} options does not contain a directory separator @samp{/}, then @command{gawk} searches a list of directories (called the @dfn{search path}), one by one, looking for a @@ -4109,7 +4109,7 @@ though.} The search path feature is particularly helpful for building libraries of useful @command{awk} functions. The library files can be placed in a standard directory in the default path and then specified on -the command line with a short @var{FN}. Otherwise, the full @var{FN} +the command line with a short @value{FN}. Otherwise, the full @value{FN} would have to be typed for each file. By using the @option{-i} option, or the @option{--source} and @option{-f} options, your command-line @@ -4336,7 +4336,7 @@ use @code{@@include} followed by the name of the file to be included, enclosed in double quotes. @quotation NOTE -Keep in mind that this is a language construct and the @var{FN} cannot +Keep in mind that this is a language construct and the @value{FN} cannot be a string variable, but rather just a literal string constant in double quotes. @end quotation @@ -4361,7 +4361,7 @@ $ @kbd{gawk -f test3} @print{} This is file test3. @end example -The @var{FN} can, of course, be a pathname. For example: +The @value{FN} can, of course, be a pathname. For example: @example @@include "../io_funcs" @@ -7607,7 +7607,7 @@ the value of @code{NF} do not change. @cindex operators, input/output Use @samp{getline < @var{file}} to read the next record from @var{file}. Here @var{file} is a string-valued expression that -specifies the @var{FN}. @samp{< @var{file}} is called a @dfn{redirection} +specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection} because it directs input to come from a different place. For example, the following program reads its input record from the file @file{secondary.input} when it @@ -8225,7 +8225,7 @@ For printing with specifications, you need the @code{printf} statement @cindex @code{printf} statement Besides basic and formatted printing, this @value{CHAPTER} also covers I/O redirections to files and pipes, introduces -the special @var{FN}s that @command{gawk} processes internally, +the special @value{FN}s that @command{gawk} processes internally, and discusses the @code{close()} built-in function. @menu @@ -9034,9 +9034,9 @@ but they work identically for @code{printf}: @cindex operators, input/output @item print @var{items} > @var{output-file} This redirection prints the items into the output file named -@var{output-file}. The @var{FN} @var{output-file} can be any +@var{output-file}. The @value{FN} @var{output-file} can be any expression. Its value is changed to a string and then used as a -@var{FN} (@pxref{Expressions}). +@value{FN} (@pxref{Expressions}). When this type of redirection is used, the @var{output-file} is erased before the first output is written to it. Subsequent writes to the same @@ -9204,7 +9204,7 @@ open as many pipelines as the underlying operating system permits. A particularly powerful way to use redirection is to build command lines and pipe them into the shell, @command{sh}. For example, suppose you -have a list of files brought over from a system where all the @var{FN}s +have a list of files brought over from a system where all the @value{FN}s are stored in uppercase, and you wish to rename them to have names in all lowercase. The following program is both simple and efficient: @@ -9230,8 +9230,8 @@ It then sends the list to the shell for execution. @c STARTOFRANGE gfn @cindex @command{gawk}, file names in -@command{gawk} provides a number of special @var{FN}s that it interprets -internally. These @var{FN}s provide access to standard file descriptors +@command{gawk} provides a number of special @value{FN}s that it interprets +internally. These @value{FN}s provide access to standard file descriptors and TCP/IP networking. @menu @@ -9295,12 +9295,12 @@ that happens, writing to the screen is not correct. In fact, if terminal at all. Then opening @file{/dev/tty} fails. -@command{gawk} provides special @var{FN}s for accessing the three standard +@command{gawk} provides special @value{FN}s for accessing the three standard streams. @value{COMMONEXT} It also provides syntax for accessing -any other inherited open files. If the @var{FN} matches +any other inherited open files. If the @value{FN} matches one of these special names when @command{gawk} redirects input or output, -then it directly uses the stream that the @var{FN} stands for. -These special @var{FN}s work for all operating systems that @command{gawk} +then it directly uses the stream that the @value{FN} stands for. +These special @value{FN}s work for all operating systems that @command{gawk} has been ported to, not just those that are POSIX-compliant: @cindex common extensions, @code{/dev/stdin} special file @@ -9330,7 +9330,7 @@ the shell). Unless special pains are taken in the shell from which @command{gawk} is invoked, only descriptors 0, 1, and 2 are available. @end table -The @var{FN}s @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} +The @value{FN}s @file{/dev/stdin}, @file{/dev/stdout}, and @file{/dev/stderr} are aliases for @file{/dev/fd/0}, @file{/dev/fd/1}, and @file{/dev/fd/2}, respectively. However, they are more self-explanatory. The proper way to write an error message in a @command{gawk} program @@ -9341,13 +9341,13 @@ print "Serious error detected!" > "/dev/stderr" @end example @cindex troubleshooting, quotes with file names -Note the use of quotes around the @var{FN}. +Note the use of quotes around the @value{FN}. Like any other redirection, the value must be a string. It is a common error to omit the quotes, which leads to confusing results. @c Exercise: What does it do? :-) -Finally, using the @code{close()} function on a @var{FN} of the +Finally, using the @code{close()} function on a @value{FN} of the form @code{"/dev/fd/@var{N}"}, for file descriptor numbers above two, does actually close the given file descriptor. @@ -9363,7 +9363,7 @@ versions of @command{awk}. @command{gawk} programs can open a two-way TCP/IP connection, acting as either a client or a server. -This is done using a special @var{FN} of the form: +This is done using a special @value{FN} of the form: @example @file{/@var{net-type}/@var{protocol}/@var{local-port}/@var{remote-host}/@var{remote-port}} @@ -9373,7 +9373,7 @@ The @var{net-type} is one of @samp{inet}, @samp{inet4} or @samp{inet6}. The @var{protocol} is one of @samp{tcp} or @samp{udp}, and the other fields represent the other essential pieces of information for making a networking connection. -These @var{FN}s are used with the @samp{|&} operator for communicating +These @value{FN}s are used with the @samp{|&} operator for communicating with a coprocess (@pxref{Two-way I/O}). This is an advanced feature, mentioned here only for completeness. @@ -9384,18 +9384,18 @@ Full discussion is delayed until @subsection Special @value{FFN} Caveats Here is a list of things to bear in mind when using the -special @var{FN}s that @command{gawk} provides: +special @value{FN}s that @command{gawk} provides: @itemize @value{BULLET} @cindex compatibility mode (@command{gawk}), file names @cindex file names, in compatibility mode @item -Recognition of these special @var{FN}s is disabled if @command{gawk} is in +Recognition of these special @value{FN}s is disabled if @command{gawk} is in compatibility mode (@pxref{Options}). @item @command{gawk} @emph{always} -interprets these special @var{FN}s. +interprets these special @value{FN}s. For example, using @samp{/dev/fd/4} for output actually writes on file descriptor 4, and not on a new file descriptor that is @code{dup()}'ed from file descriptor 4. Most of @@ -9418,7 +9418,7 @@ Doing so results in unpredictable behavior. @cindex coprocesses, closing @cindex @code{getline} command, coprocesses@comma{} using from -If the same @var{FN} or the same shell command is used with @code{getline} +If the same @value{FN} or the same shell command is used with @code{getline} more than once during the execution of an @command{awk} program (@pxref{Getline}), the file is opened (or the command is executed) the first time only. @@ -9427,7 +9427,7 @@ The next time the same file or command is used with @code{getline}, another record is read from it, and so on. Similarly, when a file or pipe is opened for output, @command{awk} remembers -the @var{FN} or command associated with it, and subsequent +the @value{FN} or command associated with it, and subsequent writes to the same file or command are appended to the previous writes. The file or pipe stays open until @command{awk} exits. @@ -9469,7 +9469,7 @@ file or command, or the next @code{print} or @code{printf} to that file or command, reopens the file or reruns the command. Because the expression that you use to close a file or pipeline must exactly match the expression used to open the file or run the command, -it is good practice to use a variable to store the @var{FN} or command. +it is good practice to use a valueiable to store the @value{FN} or command. The previous example becomes the following: @example @@ -10070,7 +10070,7 @@ as in the following: @noindent the variable is set at the very beginning, even before the @code{BEGIN} rules execute. The @option{-v} option and its assignment -must precede all the @var{FN} arguments, as well as the program text. +must precede all the @value{FN} arguments, as well as the program text. (@xref{Options}, for more information about the @option{-v} option.) Otherwise, the variable assignment is performed at a time determined by @@ -13765,14 +13765,14 @@ about how @command{awk} uses these variables. @item @code{ARGIND #} The index in @code{ARGV} of the current file being processed. Every time @command{gawk} opens a new @value{DF} for processing, it sets -@code{ARGIND} to the index in @code{ARGV} of the @var{FN}. +@code{ARGIND} to the index in @code{ARGV} of the @value{FN}. When @command{gawk} is processing the input files, @samp{FILENAME == ARGV[ARGIND]} is always true. @cindex files, processing@comma{} @code{ARGIND} variable and This variable is useful in file processing; it allows you to tell how far along you are in the list of @value{DF}s as well as to distinguish between -successive instances of the same @var{FN} on the command line. +successive instances of the same @value{FN} on the command line. @cindex file names, distinguishing While you can change the value of @code{ARGIND} within your @command{awk} @@ -14206,11 +14206,11 @@ additional files to be read. If the value of @code{ARGC} is decreased, that eliminates input files from the end of the list. By recording the old value of @code{ARGC} elsewhere, a program can treat the eliminated arguments as -something other than @var{FN}s. +something other than @value{FN}s. To eliminate a file from the middle of the list, store the null string (@code{""}) into @code{ARGV} in place of the file's name. As a -special feature, @command{awk} ignores @var{FN}s that have been +special feature, @command{awk} ignores @value{FN}s that have been replaced with the null string. Another option is to use the @code{delete} statement to remove elements from @@ -20205,13 +20205,13 @@ This file must be loaded before the user's ``main'' program, so that the rule it supplies is executed first. This rule relies on @command{awk}'s @code{FILENAME} variable that -automatically changes for each new @value{DF}. The current @var{FN} is +automatically changes for each new @value{DF}. The current @value{FN} is saved in a private variable, @code{_oldfilename}. If @code{FILENAME} does not equal @code{_oldfilename}, then a new @value{DF} is being processed and it is necessary to call @code{endfile()} for the old file. Because @code{endfile()} should only be called if a file has been processed, the program first checks to make sure that @code{_oldfilename} is not the null -string. The program then assigns the current @var{FN} to +string. The program then assigns the current @value{FN} to @code{_oldfilename} and calls @code{beginfile()} for the file. Because, like all @command{awk} variables, @code{_oldfilename} is initialized to the null string, this rule executes correctly even for the @@ -20403,7 +20403,7 @@ Using @command{gawk}'s @code{ARGIND} variable @value{DF} has been skipped. Similar to the library file presented in @ref{Filetrans Function}, the following library file calls a function named @code{zerofile()} that the user must provide. The arguments passed are -the @var{FN} and the position in @code{ARGV} where it was found: +the @value{FN} and the position in @code{ARGV} where it was found: @cindex @code{zerofile.awk} program @example @@ -20498,8 +20498,8 @@ END @{ Occasionally, you might not want @command{awk} to process command-line variable assignments (@pxref{Assignment Options}). -In particular, if you have a @var{FN} that contains an @samp{=} character, -@command{awk} treats the @var{FN} as an assignment, and does not process it. +In particular, if you have a @value{FN} that contains an @samp{=} character, +@command{awk} treats the @value{FN} as an assignment, and does not process it. Some users have suggested an additional command-line option for @command{gawk} to disable command-line assignments. However, some simple programming with @@ -20543,7 +20543,7 @@ awk -v No_command_assign=1 -f noassign.awk -f yourprog.awk * The function works by looping through the arguments. It prepends @samp{./} to any argument that matches the form -of a variable assignment, turning that argument into a @var{FN}. +of a variable assignment, turning that argument into a @value{FN}. The use of @code{No_command_assign} allows you to disable command-line assignments at invocation time, by giving the variable a true value. @@ -20899,7 +20899,7 @@ etc., as its own options. After @code{getopt()} is through, it is the responsibility of the user level code to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the -command-line options as @var{FN}s. +command-line options as @value{FN}s. @end quotation Several of the sample programs presented in @@ -22018,7 +22018,7 @@ spaces. Also remember that after @code{getopt()} is through we have to clear out all the elements of @code{ARGV} from 1 to @code{Optind}, so that @command{awk} does not try to process the command-line options -as @var{FN}s. +as @value{FN}s. After dealing with the command-line options, the program verifies that the options make sense. Only one or the other of @option{-c} and @option{-f} @@ -22215,8 +22215,8 @@ You invoke it as follows: The @var{pattern} is a regular expression. In typical usage, the regular expression is quoted to prevent the shell from expanding any of the -special characters as @var{FN} wildcards. Normally, @command{egrep} -prints the lines that matched. If multiple @var{FN}s are provided on +special characters as @value{FN} wildcards. Normally, @command{egrep} +prints the lines that matched. If multiple @value{FN}s are provided on the command line, each output line is preceded by the name of the file and a colon. @@ -22307,7 +22307,7 @@ pattern is supplied with @option{-e}, the first nonoption on the command line is used. The @command{awk} command-line arguments up to @code{ARGV[Optind]} are cleared, so that @command{awk} won't try to process them as files. If no files are specified, the standard input is used, and if multiple files are -specified, we make sure to note this so that the @var{FN}s can precede the +specified, we make sure to note this so that the @value{FN}s can precede the matched lines in the output: @example @@ -22410,9 +22410,9 @@ A number of additional tests are made, but they are only done if we are not counting lines. First, if the user only wants exit status (@code{no_print} is true), then it is enough to know that @emph{one} line in this file matched, and we can skip on to the next file with -@code{nextfile}. Similarly, if we are only printing @var{FN}s, we can -print the @var{FN}, and then skip to the next file with @code{nextfile}. -Finally, each line is printed, with a leading @var{FN} and colon +@code{nextfile}. Similarly, if we are only printing @value{FN}s, we can +print the @value{FN}, and then skip to the next file with @code{nextfile}. +Finally, each line is printed, with a leading @value{FN} and colon if necessary: @cindex @code{!} (exclamation point), @code{!} operator @@ -22662,7 +22662,7 @@ number of lines in each file, supply a number on the command line preceded with a minus; e.g., @samp{-500} for files with 500 lines in them instead of 1000. To change the name of the output files to something like @file{myfileaa}, @file{myfileab}, and so on, supply an additional -argument that specifies the @var{FN} prefix. +argument that specifies the @value{FN} prefix. Here is a version of @command{split} in @command{awk}. It uses the @code{ord()} and @code{chr()} functions presented in @@ -30889,7 +30889,7 @@ empty string (@code{""}). The @code{func} pointer is the address of a An @dfn{exit callback} function is a function that @command{gawk} calls before it exits. -Such functions are useful if you have general ``clean up'' tasks +Such functions are useful if you have general ``cleanup'' tasks that should be performed in your extension (such as closing data base connections or other resource deallocations). You can register such @@ -31692,7 +31692,7 @@ keeps track of the usage. When a variable's value changes, @command{gawk} simply decrements the reference count on the old value and updates the variable to use the new value. -Finally, as part of your clean up action (@pxref{Exit Callback Functions}) +Finally, as part of your cleanup action (@pxref{Exit Callback Functions}) you should release any cached values that you created, using @code{release_value()}. @@ -33378,10 +33378,10 @@ The arguments to @code{fnmatch()} are: @table @code @item pattern -The @var{FN} wildcard to match. +The @value{FN} wildcard to match. @item string -The @var{FN} string. +The @value{FN} string. @item flag Either zero, or the bitwise OR of one or more of the @@ -33488,8 +33488,8 @@ standard output to a temporary file configured to have the same owner and permissions as the original. After the file has been processed, the extension restores standard output to its original destination. If @code{INPLACE_SUFFIX} is not an empty string, the original file is -linked to a backup @var{FN} created by appending that suffix. Finally, -the temporary file is renamed to the original @var{FN}. +linked to a backup @value{FN} created by appending that suffix. Finally, +the temporary file is renamed to the original @value{FN}. If any error occurs, the extension issues a fatal error to terminate processing immediately without damaging the original file. @@ -33555,7 +33555,7 @@ on the command line (or with @code{getline}), they are read, with each entry returned as a record. The record consists of three fields. The first two are the inode number and the -@var{FN}, separated by a forward slash character. +@value{FN}, separated by a forward slash character. On systems where the directory entry contains the file type, the record has a third field (also separated by a slash) which is a single letter indicating the type of the file. The letters are file types are shown @@ -36481,7 +36481,7 @@ $ @kbd{MMK/DESCRIPTION=[.vms]descrip.mms gawk} @end example @command{MMK} is an open source, free, near-clone of @command{MMS} and -can better handle ODS-5 volumes with upper- and lowercase @var{FN}s. +can better handle ODS-5 volumes with upper- and lowercase @value{FN}s. @command{MMK} is available from @uref{https://github.com/endlesssoftware/mmk}. With ODS-5 volumes and extended parsing enabled, the case of the target @@ -36616,7 +36616,7 @@ for @command{awk} program files. For the @option{-f} option, if the specified looks in the current directory first, then in the directory specified by the translation of @samp{AWK_LIBRARY} if the file is not found. If, after searching in both directories, the file still is not found, -@command{gawk} appends the suffix @samp{.awk} to the @var{FN} and retries +@command{gawk} appends the suffix @samp{.awk} to the @value{FN} and retries the file search. If @samp{AWK_LIBRARY} has no definition, a default value of @samp{SYS$LIBRARY:} is used for it. @@ -37908,7 +37908,7 @@ two-way I/O. @item An extension should be able to provide a ``call back'' function -to perform clean up actions when @command{gawk} exits. +to perform cleanup actions when @command{gawk} exits. @item An extension should be able to provide a version string so that @@ -38005,8 +38005,8 @@ in @value{PVERSION} 4.1. However, for many years @command{gawk} provided an extension mechanism that required knowledge of @command{gawk} internals and that was not as well designed. -In order to provide a transition period, @command{gawk} version -4.1 continues to support the original extension mechanism. +In order to provide a transition period, @command{gawk} @value{PVERSION} 4.1 +continues to support the original extension mechanism. This will be true for the life of exactly one major release. This support will be withdrawn, and removed from the source code, at the next major release. |