summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-27 20:58:06 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-27 20:58:06 +0200
commit82da42cf14d16813bca40431e86dc78b2ca6d7f5 (patch)
tree0efc5deaaebe2ccd2e6c0b239b2fcc0289e5203b
parent3355ce597d39925ea1221c92f62ef8dcb80d7274 (diff)
downloadgawk-82da42cf14d16813bca40431e86dc78b2ca6d7f5.tar.gz
BBS-list examples redone. Yay! Thanks to Antonio.
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info1658
-rw-r--r--doc/gawk.texi508
-rw-r--r--doc/gawktexi.in508
4 files changed, 1353 insertions, 1326 deletions
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 15e6d958..fed2cc82 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-27 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Redo all the examples using BBS-list to a different
+ file that doesn't use out-of-date concepts.
+
2014-03-10 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Finish indexing improvements. (For now, anyway.)
diff --git a/doc/gawk.info b/doc/gawk.info
index a275d9c2..2e18da5b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -1767,30 +1767,30 @@ File: gawk.info, Node: Sample Data Files, Next: Very Simple, Prev: Running ga
===============================
Many of the examples in this Info file take their input from two sample
-data files. The first, `BBS-list', represents a list of computer
-bulletin board systems together with information about those systems.
+data files. The first, `mail-list', represents a list of peoples' names
+together with their email addresses and information about those people.
The second data file, called `inventory-shipped', contains information
about monthly shipments. In both files, each line is considered to be
one "record".
- In the data file `BBS-list', each record contains the name of a
-computer bulletin board, its phone number, the board's baud rate(s),
-and a code for the number of hours it is operational. An `A' in the
-last column means the board operates 24 hours a day. A `B' in the last
-column means the board only operates on evening and weekend hours. A
-`C' means the board operates only on weekends:
-
- aardvark 555-5553 1200/300 B
- alpo-net 555-3412 2400/1200/300 A
- barfly 555-7685 1200/300 A
- bites 555-1675 2400/1200/300 A
- camelot 555-0542 300 C
- core 555-2912 1200/300 C
- fooey 555-1234 2400/1200/300 B
- foot 555-6699 1200/300 B
- macfoo 555-6480 1200/300 A
- sdace 555-3430 2400/1200/300 A
- sabafoo 555-2127 1200/300 C
+ In the data file `mail-list', each record contains the name of a
+person, his/her phone number, his/her email-address, and a code for
+their relationship with the author of the list. An `A' in the last
+column means that the person is an acquaintance. An `F' in the last
+column means that the person is a friend. An `R' means that the person
+is a relative:
+
+ Amelia 555-5553 amelia.zodiacusque@gmail.com F
+ Anthony 555-3412 anthony.asserturo@hotmail.com A
+ Becky 555-7685 becky.algebrarum@gmail.com A
+ Bill 555-1675 bill.drowning@hotmail.com A
+ Broderick 555-0542 broderick.aliquotiens@yahoo.com R
+ Camilla 555-2912 camilla.infusarum@skynet.be R
+ Fabius 555-1234 fabius.undevicesimus@ucb.edu F
+ Julie 555-6699 julie.perscrutabor@skeeve.com F
+ Martin 555-6480 martin.codicibus@hotmail.com A
+ Samuel 555-3430 samuel.lanceolis@shu.edu A
+ Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
The data file `inventory-shipped' represents information about
shipments during the year. Each record contains the month, the number
@@ -1827,32 +1827,32 @@ File: gawk.info, Node: Very Simple, Next: Two Rules, Prev: Sample Data Files,
========================
The following command runs a simple `awk' program that searches the
-input file `BBS-list' for the character string `foo' (a grouping of
+input file `mail-list' for the character string `li' (a grouping of
characters is usually called a "string"; the term "string" is based on
similar usage in English, such as "a string of pearls," or "a string of
cars in a train"):
- awk '/foo/ { print $0 }' BBS-list
+ awk '/li/ { print $0 }' mail-list
-When lines containing `foo' are found, they are printed because
+When lines containing `li' are found, they are printed because
`print $0' means print the current line. (Just `print' by itself means
the same thing, so we could have written that instead.)
- You will notice that slashes (`/') surround the string `foo' in the
-`awk' program. The slashes indicate that `foo' is the pattern to
-search for. This type of pattern is called a "regular expression",
-which is covered in more detail later (*note Regexp::). The pattern is
-allowed to match parts of words. There are single quotes around the
-`awk' program so that the shell won't interpret any of it as special
-shell characters.
+ You will notice that slashes (`/') surround the string `li' in the
+`awk' program. The slashes indicate that `li' is the pattern to search
+for. This type of pattern is called a "regular expression", which is
+covered in more detail later (*note Regexp::). The pattern is allowed
+to match parts of words. There are single quotes around the `awk'
+program so that the shell won't interpret any of it as special shell
+characters.
Here is what this program prints:
- $ awk '/foo/ { print $0 }' BBS-list
- -| fooey 555-1234 2400/1200/300 B
- -| foot 555-6699 1200/300 B
- -| macfoo 555-6480 1200/300 A
- -| sabafoo 555-2127 1200/300 C
+ $ awk '/li/ { print $0 }' mail-list
+ -| Amelia 555-5553 amelia.zodiacusque@gmail.com F
+ -| Broderick 555-0542 broderick.aliquotiens@yahoo.com R
+ -| Julie 555-6699 julie.perscrutabor@skeeve.com F
+ -| Samuel 555-3430 samuel.lanceolis@shu.edu A
In an `awk' rule, either the pattern or the action can be omitted,
but not both. If the pattern is omitted, then the action is performed
@@ -1861,7 +1861,7 @@ is to print all lines that match the pattern.
Thus, we could leave out the action (the `print' statement and the
curly braces) in the previous example and the result would be the same:
-`awk' prints all lines matching the pattern `foo'. By comparison,
+`awk' prints all lines matching the pattern `li'. By comparison,
omitting the `print' statement but retaining the curly braces makes an
empty action that does nothing (i.e., no lines are printed).
@@ -1967,25 +1967,19 @@ the string `21'. If a line contains both strings, it is printed twice,
once by each rule.
This is what happens if we run this program on our two sample data
-files, `BBS-list' and `inventory-shipped':
+files, `mail-list' and `inventory-shipped':
$ awk '/12/ { print $0 }
- > /21/ { print $0 }' BBS-list inventory-shipped
- -| aardvark 555-5553 1200/300 B
- -| alpo-net 555-3412 2400/1200/300 A
- -| barfly 555-7685 1200/300 A
- -| bites 555-1675 2400/1200/300 A
- -| core 555-2912 1200/300 C
- -| fooey 555-1234 2400/1200/300 B
- -| foot 555-6699 1200/300 B
- -| macfoo 555-6480 1200/300 A
- -| sdace 555-3430 2400/1200/300 A
- -| sabafoo 555-2127 1200/300 C
- -| sabafoo 555-2127 1200/300 C
+ > /21/ { print $0 }' mail-list inventory-shipped
+ -| Anthony 555-3412 anthony.asserturo@hotmail.com A
+ -| Camilla 555-2912 camilla.infusarum@skynet.be R
+ -| Fabius 555-1234 fabius.undevicesimus@ucb.edu F
+ -| Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
+ -| Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
-| Jan 21 36 64 620
-| Apr 21 70 74 514
-Note how the line beginning with `sabafoo' in `BBS-list' was printed
+Note how the line beginning with `Jean-Paul' in `mail-list' was printed
twice, once for each rule.

@@ -2061,7 +2055,7 @@ Most often, each line in an `awk' program is a separate statement or
separate rule, like this:
awk '/12/ { print $0 }
- /21/ { print $0 }' BBS-list inventory-shipped
+ /21/ { print $0 }' mail-list inventory-shipped
However, `gawk' ignores newlines after any of the following symbols
and keywords:
@@ -3106,14 +3100,14 @@ A regular expression can be used as a pattern by enclosing it in
slashes. Then the regular expression is tested against the entire text
of each record. (Normally, it only needs to match some part of the
text in order to succeed.) For example, the following prints the
-second field of each record that contains the string `foo' anywhere in
+second field of each record that contains the string `li' anywhere in
it:
- $ awk '/foo/ { print $2 }' BBS-list
- -| 555-1234
+ $ awk '/li/ { print $2 }' mail-list
+ -| 555-5553
+ -| 555-0542
-| 555-6699
- -| 555-6480
- -| 555-2127
+ -| 555-3430
Regular expressions can also be used in matching expressions. These
expressions allow you to specify the string to match against; it need
@@ -3921,67 +3915,82 @@ processed, so that the very first record is read with the proper
separator. To do this, use the special `BEGIN' pattern (*note
BEGIN/END::). For example:
- awk 'BEGIN { RS = "/" }
- { print $0 }' BBS-list
-
-changes the value of `RS' to `"/"', before reading any input. This is
-a string whose first character is a slash; as a result, records are
-separated by slashes. Then the input file is read, and the second rule
-in the `awk' program (the action with no pattern) prints each record.
-Because each `print' statement adds a newline at the end of its output,
-this `awk' program copies the input with each slash changed to a
-newline. Here are the results of running the program on `BBS-list':
-
- $ awk 'BEGIN { RS = "/" }
- > { print $0 }' BBS-list
- -| aardvark 555-5553 1200
- -| 300 B
- -| alpo-net 555-3412 2400
- -| 1200
- -| 300 A
- -| barfly 555-7685 1200
- -| 300 A
- -| bites 555-1675 2400
- -| 1200
- -| 300 A
- -| camelot 555-0542 300 C
- -| core 555-2912 1200
- -| 300 C
- -| fooey 555-1234 2400
- -| 1200
- -| 300 B
- -| foot 555-6699 1200
- -| 300 B
- -| macfoo 555-6480 1200
- -| 300 A
- -| sdace 555-3430 2400
- -| 1200
- -| 300 A
- -| sabafoo 555-2127 1200
- -| 300 C
+ awk 'BEGIN { RS = "u" }
+ { print $0 }' mail-list
+
+changes the value of `RS' to `u', before reading any input. This is a
+string whose first character is the letter "u;" as a result, records
+are separated by the letter "u." Then the input file is read, and the
+second rule in the `awk' program (the action with no pattern) prints
+each record. Because each `print' statement adds a newline at the end
+of its output, this `awk' program copies the input with each `u'
+changed to a newline. Here are the results of running the program on
+`mail-list':
+
+ $ awk 'BEGIN { RS = "u" }
+ > { print $0 }' mail-list
+ -| Amelia 555-5553 amelia.zodiac
+ -| sq
+ -| e@gmail.com F
+ -| Anthony 555-3412 anthony.assert
+ -| ro@hotmail.com A
+ -| Becky 555-7685 becky.algebrar
+ -| m@gmail.com A
+ -| Bill 555-1675 bill.drowning@hotmail.com A
+ -| Broderick 555-0542 broderick.aliq
+ -| otiens@yahoo.com R
+ -| Camilla 555-2912 camilla.inf
+ -| sar
+ -| m@skynet.be R
+ -| Fabi
+ -| s 555-1234 fabi
+ -| s.
+ -| ndevicesim
+ -| s@
+ -| cb.ed
+ -| F
+ -| J
+ -| lie 555-6699 j
+ -| lie.perscr
+ -| tabor@skeeve.com F
+ -| Martin 555-6480 martin.codicib
+ -| s@hotmail.com A
+ -| Sam
+ -| el 555-3430 sam
+ -| el.lanceolis@sh
+ -| .ed
+ -| A
+ -| Jean-Pa
+ -| l 555-2127 jeanpa
+ -| l.campanor
+ -| m@ny
+ -| .ed
+ -| R
-|
-Note that the entry for the `camelot' BBS is not split. In the
-original data file (*note Sample Data Files::), the line looks like
-this:
+Note that the entry for the name `Bill' is not split. In the original
+data file (*note Sample Data Files::), the line looks like this:
- camelot 555-0542 300 C
+ Bill 555-1675 bill.drowning@hotmail.com A
-It has one baud rate only, so there are no slashes in the record,
-unlike the others which have two or more baud rates. In fact, this
-record is treated as part of the record for the `core' BBS; the newline
+It contains no `u' so there is no reason to split the record, unlike
+the others which have one or more occurrences of the `u'. In fact,
+this record is treated as part of the previous record; the newline
separating them in the output is the original newline in the data file,
not the one added by `awk' when it printed the record!
Another way to change the record separator is on the command line,
using the variable-assignment feature (*note Other Arguments::):
- awk '{ print $0 }' RS="/" BBS-list
+ awk '{ print $0 }' RS="u" mail-list
-This sets `RS' to `/' before processing `BBS-list'.
+This sets `RS' to `u' before processing `mail-list'.
- Using an unusual character such as `/' for the record separator
-produces correct behavior in the vast majority of cases.
+ Using an alphabetic character such as `u' for the record separator
+is highly likely to produce strange results. Using an unusual
+character such as `/' is more likely to produce correct behavior in the
+majority of cases, but there are no guarantees. The moral is: Know Your
+Data.
There is one unusual case, that occurs when `gawk' is being fully
POSIX-compliant (*note Options::). Then, the following (extreme)
@@ -4150,26 +4159,24 @@ get the empty string. (If used in a numeric operation, you get zero.)
field, is a special case: it represents the whole input record when you
are not interested in specific fields. Here are some more examples:
- $ awk '$1 ~ /foo/ { print $0 }' BBS-list
- -| fooey 555-1234 2400/1200/300 B
- -| foot 555-6699 1200/300 B
- -| macfoo 555-6480 1200/300 A
- -| sabafoo 555-2127 1200/300 C
+ $ awk '$1 ~ /li/ { print $0 }' mail-list
+ -| Amelia 555-5553 amelia.zodiacusque@gmail.com F
+ -| Julie 555-6699 julie.perscrutabor@skeeve.com F
-This example prints each record in the file `BBS-list' whose first
-field contains the string `foo'. The operator `~' is called a
-"matching operator" (*note Regexp Usage::); it tests whether a string
-(here, the field `$1') matches a given regular expression.
+This example prints each record in the file `mail-list' whose first
+field contains the string `li'. The operator `~' is called a "matching
+operator" (*note Regexp Usage::); it tests whether a string (here, the
+field `$1') matches a given regular expression.
- By contrast, the following example looks for `foo' in _the entire
+ By contrast, the following example looks for `li' in _the entire
record_ and prints the first field and the last field for each matching
input record:
- $ awk '/foo/ { print $1, $NF }' BBS-list
- -| fooey B
- -| foot B
- -| macfoo A
- -| sabafoo C
+ $ awk '/li/ { print $1, $NF }' mail-list
+ -| Amelia F
+ -| Broderick R
+ -| Julie F
+ -| Samuel A
---------- Footnotes ----------
@@ -4197,16 +4204,16 @@ For the twentieth record, field number 20 is printed; most likely, the
record has fewer than 20 fields, so this prints a blank line. Here is
another example of using expressions as field numbers:
- awk '{ print $(2*2) }' BBS-list
+ awk '{ print $(2*2) }' mail-list
`awk' evaluates the expression `(2*2)' and uses its value as the
number of the field to print. The `*' sign represents multiplication,
so the expression `2*2' evaluates to four. The parentheses are used so
that the multiplication is done before the `$' operation; they are
necessary whenever there is a binary operator in the field-number
-expression. This example, then, prints the hours of operation (the
-fourth field) for every line of the file `BBS-list'. (All of the `awk'
-operators are listed, in order of decreasing precedence, in *note
+expression. This example, then, prints the type of relationship (the
+fourth field) for every line of the file `mail-list'. (All of the
+`awk' operators are listed, in order of decreasing precedence, in *note
Precedence::.)
If the field number you compute is zero, you get the entire record.
@@ -4603,53 +4610,46 @@ type `-F\t' at the shell, without any quotes, the `\' gets deleted, so
TABs and not `t's. Use `-v FS="t"' or `-F"[t]"' on the command line if
you really do want to separate your fields with `t's.
- As an example, let's use an `awk' program file called `baud.awk'
-that contains the pattern `/300/' and the action `print $1':
+ As an example, let's use an `awk' program file called `edu.awk' that
+contains the pattern `/edu/' and the action `print $1':
- /300/ { print $1 }
+ /edu/ { print $1 }
Let's also set `FS' to be the `-' character and run the program on
-the file `BBS-list'. The following command prints a list of the names
-of the bulletin boards that operate at 300 baud and the first three
+the file `mail-list'. The following command prints a list of the names
+of the people that work at or attend a university, and the first three
digits of their phone numbers:
- $ awk -F- -f baud.awk BBS-list
- -| aardvark 555
- -| alpo
- -| barfly 555
- -| bites 555
- -| camelot 555
- -| core 555
- -| fooey 555
- -| foot 555
- -| macfoo 555
- -| sdace 555
- -| sabafoo 555
-
-Note the second line of output. The second line in the original file
+ $ awk -F- -f edu.awk mail-list
+ -| Fabius 555
+ -| Samuel 555
+ -| Jean
+
+Note the third line of output. The third line in the original file
looked like this:
- alpo-net 555-3412 2400/1200/300 A
+ Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
- The `-' as part of the system's name was used as the field
+ The `-' as part of the person's name was used as the field
separator, instead of the `-' in the phone number that was originally
intended. This demonstrates why you have to be careful in choosing
your field and record separators.
Perhaps the most common use of a single character as the field
separator occurs when processing the Unix system password file. On
-many Unix systems, each user has a separate entry in the system password
-file, one line per user. The information in these lines is separated
-by colons. The first field is the user's login name and the second is
-the user's (encrypted or shadow) password. A password file entry might
-look like this:
+many Unix systems, each user has a separate entry in the system
+password file, one line per user. The information in these lines is
+separated by colons. The first field is the user's login name and the
+second is the user's encrypted or shadow password. (A shadow password
+is indicated by the presence of a single `x' in the second field.) A
+password file entry might look like this:
- arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/bash
+ arnold:x:2076:10:Arnold Robbins:/home/arnold:/bin/bash
The following program searches the system password file and prints
-the entries for users who have no password:
+the entries for users whose full name is not indicated:
- awk -F: '$2 == ""' /etc/passwd
+ awk -F: '$5 == ""' /etc/passwd

File: gawk.info, Node: Full Line Fields, Next: Field Splitting Summary, Prev: Command Line Field Separator, Up: Field Separators
@@ -5835,13 +5835,29 @@ prints the first and second fields of each input record, separated by a
semicolon, with a blank line added after each newline:
$ awk 'BEGIN { OFS = ";"; ORS = "\n\n" }
- > { print $1, $2 }' BBS-list
- -| aardvark;555-5553
+ > { print $1, $2 }' mail-list
+ -| Amelia;555-5553
-|
- -| alpo-net;555-3412
+ -| Anthony;555-3412
+ -|
+ -| Becky;555-7685
+ -|
+ -| Bill;555-1675
+ -|
+ -| Broderick;555-0542
+ -|
+ -| Camilla;555-2912
+ -|
+ -| Fabius;555-1234
+ -|
+ -| Julie;555-6699
+ -|
+ -| Martin;555-6480
+ -|
+ -| Samuel;555-3430
+ -|
+ -| Jean-Paul;555-2127
-|
- -| barfly;555-7685
- ...
If the value of `ORS' does not contain a newline, the program's
output runs together on a single line.
@@ -6210,25 +6226,25 @@ File: gawk.info, Node: Printf Examples, Prev: Format Modifiers, Up: Printf
The following simple example shows how to use `printf' to make an
aligned table:
- awk '{ printf "%-10s %s\n", $1, $2 }' BBS-list
+ awk '{ printf "%-10s %s\n", $1, $2 }' mail-list
-This command prints the names of the bulletin boards (`$1') in the file
-`BBS-list' as a string of 10 characters that are left-justified. It
+This command prints the names of the people (`$1') in the file
+`mail-list' as a string of 10 characters that are left-justified. It
also prints the phone numbers (`$2') next on the line. This produces
an aligned two-column table of names and phone numbers, as shown here:
- $ awk '{ printf "%-10s %s\n", $1, $2 }' BBS-list
- -| aardvark 555-5553
- -| alpo-net 555-3412
- -| barfly 555-7685
- -| bites 555-1675
- -| camelot 555-0542
- -| core 555-2912
- -| fooey 555-1234
- -| foot 555-6699
- -| macfoo 555-6480
- -| sdace 555-3430
- -| sabafoo 555-2127
+ $ awk '{ printf "%-10s %s\n", $1, $2 }' mail-list
+ -| Amelia 555-5553
+ -| Anthony 555-3412
+ -| Becky 555-7685
+ -| Bill 555-1675
+ -| Broderick 555-0542
+ -| Camilla 555-2912
+ -| Fabius 555-1234
+ -| Julie 555-6699
+ -| Martin 555-6480
+ -| Samuel 555-3430
+ -| Jean-Paul 555-2127
In this case, the phone numbers had to be printed as strings because
the numbers are separated by a dash. Printing the phone numbers as
@@ -6246,14 +6262,14 @@ beginning of the `awk' program:
awk 'BEGIN { print "Name Number"
print "---- ------" }
- { printf "%-10s %s\n", $1, $2 }' BBS-list
+ { printf "%-10s %s\n", $1, $2 }' mail-list
The above example mixes `print' and `printf' statements in the same
program. Using just `printf' statements can produce the same results:
awk 'BEGIN { printf "%-10s %s\n", "Name", "Number"
printf "%-10s %s\n", "----", "------" }
- { printf "%-10s %s\n", $1, $2 }' BBS-list
+ { printf "%-10s %s\n", $1, $2 }' mail-list
Printing each column heading with the same format specification used
for the column elements ensures that the headings are aligned just like
@@ -6265,7 +6281,7 @@ be emphasized by storing it in a variable, like this:
awk 'BEGIN { format = "%-10s %s\n"
printf format, "Name", "Number"
printf format, "----", "------" }
- { printf format, $1, $2 }' BBS-list
+ { printf format, $1, $2 }' mail-list
At this point, it would be a worthwhile exercise to use the `printf'
statement to line up the headings and table data for the
@@ -6305,19 +6321,19 @@ work identically for `printf':
the same OUTPUT-FILE do not erase OUTPUT-FILE, but append to it.
(This is different from how you use redirections in shell scripts.)
If OUTPUT-FILE does not exist, it is created. For example, here
- is how an `awk' program can write a list of BBS names to one file
- named `name-list', and a list of phone numbers to another file
+ is how an `awk' program can write a list of peoples' names to one
+ file named `name-list', and a list of phone numbers to another file
named `phone-list':
$ awk '{ print $2 > "phone-list"
- > print $1 > "name-list" }' BBS-list
+ > print $1 > "name-list" }' mail-list
$ cat phone-list
-| 555-5553
-| 555-3412
...
$ cat name-list
- -| aardvark
- -| alpo-net
+ -| Amelia
+ -| Anthony
...
Each output file contains one name or number per line.
@@ -6338,12 +6354,12 @@ work identically for `printf':
The redirection argument COMMAND is actually an `awk' expression.
Its value is converted to a string whose contents give the shell
command to be run. For example, the following produces two files,
- one unsorted list of BBS names, and one list sorted in reverse
+ one unsorted list of peoples' names, and one list sorted in reverse
alphabetical order:
awk '{ print $1 > "names.unsorted"
command = "sort -r > names.sorted"
- print $1 | command }' BBS-list
+ print $1 | command }' mail-list
The unsorted list is written with an ordinary redirection, while
the sorted list is written by piping through the `sort' utility.
@@ -7073,16 +7089,16 @@ 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 BBS-list
+ awk '{ print $n }' n=4 inventory-shipped n=2 mail-list
prints the value of field number `n' for all input records. Before the
first file is read, the command line sets the variable `n' equal to
four. This causes the fourth field to be printed in lines from
`inventory-shipped'. After the first file has finished, but before the
second file is started, `n' is set to two, so that the second field is
-printed in lines from `BBS-list':
+printed in lines from `mail-list':
- $ awk '{ print $n }' n=4 inventory-shipped n=2 BBS-list
+ $ awk '{ print $n }' n=4 inventory-shipped n=2 mail-list
-| 15
-| 24
...
@@ -7343,17 +7359,17 @@ a specific operator to represent it. Instead, concatenation is
performed by writing expressions next to one another, with no operator.
For example:
- $ awk '{ print "Field number one: " $1 }' BBS-list
- -| Field number one: aardvark
- -| Field number one: alpo-net
+ $ awk '{ print "Field number one: " $1 }' mail-list
+ -| Field number one: Amelia
+ -| Field number one: Anthony
...
Without the space in the string constant after the `:', the line
runs together. For example:
- $ awk '{ print "Field number one:" $1 }' BBS-list
- -| Field number one:aardvark
- -| Field number one:alpo-net
+ $ awk '{ print "Field number one:" $1 }' mail-list
+ -| Field number one:Amelia
+ -| Field number one:Anthony
...
Because string concatenation does not have an explicit operator, it
@@ -7999,9 +8015,9 @@ Boolean operators are:
`BOOLEAN1 && BOOLEAN2'
True if both BOOLEAN1 and BOOLEAN2 are true. For example, the
following statement prints the current input record if it contains
- both `2400' and `foo':
+ both `edu' and `li':
- if ($0 ~ /2400/ && $0 ~ /foo/) print
+ if ($0 ~ /edu/ && $0 ~ /li/) print
The subexpression BOOLEAN2 is evaluated only if BOOLEAN1 is true.
This can make a difference when BOOLEAN2 contains expressions that
@@ -8012,9 +8028,9 @@ Boolean operators are:
`BOOLEAN1 || BOOLEAN2'
True if at least one of BOOLEAN1 or BOOLEAN2 is true. For
example, the following statement prints all records in the input
- that contain _either_ `2400' or `foo' or both:
+ that contain _either_ `edu' or `li' or both:
- if ($0 ~ /2400/ || $0 ~ /foo/) print
+ if ($0 ~ /edu/ || $0 ~ /li/) print
The subexpression BOOLEAN2 is evaluated only if BOOLEAN1 is false.
This can make a difference when BOOLEAN2 contains expressions that
@@ -8434,56 +8450,53 @@ operand is either a constant regular expression enclosed in slashes
(`/REGEXP/'), or any expression whose string value is used as a dynamic
regular expression (*note Computed Regexps::). The following example
prints the second field of each input record whose first field is
-precisely `foo':
+precisely `li':
- $ awk '$1 == "foo" { print $2 }' BBS-list
+ $ awk '$1 == "li" { print $2 }' mail-list
-(There is no output, because there is no BBS site with the exact name
-`foo'.) Contrast this with the following regular expression match,
-which accepts any record with a first field that contains `foo':
+(There is no output, because there is no person with the exact name
+`li'.) Contrast this with the following regular expression match, which
+accepts any record with a first field that contains `li':
- $ awk '$1 ~ /foo/ { print $2 }' BBS-list
- -| 555-1234
+ $ awk '$1 ~ /foo/ { print $2 }' mail-list
+ -| 555-5553
-| 555-6699
- -| 555-6480
- -| 555-2127
A regexp constant as a pattern is also a special case of an
-expression pattern. The expression `/foo/' has the value one if `foo'
-appears in the current input record. Thus, as a pattern, `/foo/'
-matches any record containing `foo'.
+expression pattern. The expression `/li/' has the value one if `li'
+appears in the current input record. Thus, as a pattern, `/li/' matches
+any record containing `li'.
Boolean expressions are also commonly used as patterns. Whether the
pattern matches an input record depends on whether its subexpressions
match. For example, the following command prints all the records in
-`BBS-list' that contain both `2400' and `foo':
-
- $ awk '/2400/ && /foo/' BBS-list
- -| fooey 555-1234 2400/1200/300 B
-
- The following command prints all records in `BBS-list' that contain
-_either_ `2400' or `foo' (or both, of course):
-
- $ awk '/2400/ || /foo/' BBS-list
- -| alpo-net 555-3412 2400/1200/300 A
- -| bites 555-1675 2400/1200/300 A
- -| fooey 555-1234 2400/1200/300 B
- -| foot 555-6699 1200/300 B
- -| macfoo 555-6480 1200/300 A
- -| sdace 555-3430 2400/1200/300 A
- -| sabafoo 555-2127 1200/300 C
-
- The following command prints all records in `BBS-list' that do _not_
-contain the string `foo':
-
- $ awk '! /foo/' BBS-list
- -| aardvark 555-5553 1200/300 B
- -| alpo-net 555-3412 2400/1200/300 A
- -| barfly 555-7685 1200/300 A
- -| bites 555-1675 2400/1200/300 A
- -| camelot 555-0542 300 C
- -| core 555-2912 1200/300 C
- -| sdace 555-3430 2400/1200/300 A
+`mail-list' that contain both `edu' and `li':
+
+ $ awk '/edu/ && /li/' mail-list
+ -| Samuel 555-3430 samuel.lanceolis@shu.edu A
+
+ The following command prints all records in `mail-list' that contain
+_either_ `edu' or `li' (or both, of course):
+
+ $ awk '/edu/ || /li/' mail-list
+ -| Amelia 555-5553 amelia.zodiacusque@gmail.com F
+ -| Broderick 555-0542 broderick.aliquotiens@yahoo.com R
+ -| Fabius 555-1234 fabius.undevicesimus@ucb.edu F
+ -| Julie 555-6699 julie.perscrutabor@skeeve.com F
+ -| Samuel 555-3430 samuel.lanceolis@shu.edu A
+ -| Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
+
+ The following command prints all records in `mail-list' that do
+_not_ contain the string `li':
+
+ $ awk '! /li/' mail-list
+ -| Anthony 555-3412 anthony.asserturo@hotmail.com A
+ -| Becky 555-7685 becky.algebrarum@gmail.com A
+ -| Bill 555-1675 bill.drowning@hotmail.com A
+ -| Camilla 555-2912 camilla.infusarum@skynet.be R
+ -| Fabius 555-1234 fabius.undevicesimus@ucb.edu F
+ -| Martin 555-6480 martin.codicibus@hotmail.com A
+ -| Jean-Paul 555-2127 jeanpaul.campanorum@nyu.edu R
The subexpressions of a Boolean operator in a pattern can be
constant regular expressions, comparisons, or any other `awk'
@@ -8594,19 +8607,19 @@ read. Likewise, an `END' rule is executed once only, after all the
input is read. For example:
$ awk '
- > BEGIN { print "Analysis of \"foo\"" }
- > /foo/ { ++n }
- > END { print "\"foo\" appears", n, "times." }' BBS-list
- -| Analysis of "foo"
- -| "foo" appears 4 times.
-
- This program finds the number of records in the input file `BBS-list'
-that contain the string `foo'. The `BEGIN' rule prints a title for the
-report. There is no need to use the `BEGIN' rule to initialize the
-counter `n' to zero, since `awk' does this automatically (*note
-Variables::). The second rule increments the variable `n' every time a
-record containing the pattern `foo' is read. The `END' rule prints the
-value of `n' at the end of the run.
+ > BEGIN { print "Analysis of \"li\"" }
+ > /li/ { ++n }
+ > END { print "\"li\" appears in", n, "records." }' mail-list
+ -| Analysis of "li"
+ -| "li" appears in 4 records.
+
+ This program finds the number of records in the input file
+`mail-list' that contain the string `li'. The `BEGIN' rule prints a
+title for the report. There is no need to use the `BEGIN' rule to
+initialize the counter `n' to zero, since `awk' does this automatically
+(*note Variables::). The second rule increments the variable `n' every
+time a record containing the pattern `li' is read. The `END' rule
+prints the value of `n' at the end of the run.
The special patterns `BEGIN' and `END' cannot be used in ranges or
with Boolean operators (indeed, they cannot be used with any operators).
@@ -8757,7 +8770,7 @@ File: gawk.info, Node: Empty, Prev: BEGINFILE/ENDFILE, Up: Pattern Overview
An empty (i.e., nonexistent) pattern is considered to match _every_
input record. For example, the program:
- awk '{ print $1 }' BBS-list
+ awk '{ print $1 }' mail-list
prints the first field of every record.
@@ -9673,13 +9686,13 @@ with a pound sign (`#').
$ awk 'BEGIN {
> for (i = 0; i < ARGC; i++)
> print ARGV[i]
- > }' inventory-shipped BBS-list
+ > }' inventory-shipped mail-list
-| awk
-| inventory-shipped
- -| BBS-list
+ -| mail-list
`ARGV[0]' contains `awk', `ARGV[1]' contains `inventory-shipped',
- and `ARGV[2]' contains `BBS-list'. The value of `ARGC' is three,
+ and `ARGV[2]' contains `mail-list'. The value of `ARGC' is three,
one more than the index of the last element in `ARGV', because the
elements are numbered from zero.
@@ -10006,13 +10019,13 @@ information contained in `ARGC' and `ARGV':
$ awk 'BEGIN {
> for (i = 0; i < ARGC; i++)
> print ARGV[i]
- > }' inventory-shipped BBS-list
+ > }' inventory-shipped mail-list
-| awk
-| inventory-shipped
- -| BBS-list
+ -| mail-list
In this example, `ARGV[0]' contains `awk', `ARGV[1]' contains
-`inventory-shipped', and `ARGV[2]' contains `BBS-list'. Notice that
+`inventory-shipped', and `ARGV[2]' contains `mail-list'. Notice that
the `awk' program is not entered in `ARGV'. The other command-line
options, with their arguments, are also not entered. This includes
variable assignments done with the `-v' option (*note Options::).
@@ -25958,6 +25971,10 @@ Info file, in approximate chronological order:
4.1 was driven primarily by Arnold Robbins and Andrew Schorr, with
notable contributions from the rest of the development team.
+ * Antonio Giovanni Colombo rewrote a number of examples in the early
+ chapters that were severely dated, for which I am incredibly
+ grateful.
+
* Arnold Robbins has been working on `gawk' since 1988, at first
helping David Trueman, and as the primary maintainer since around
1994.
@@ -28213,9 +28230,6 @@ Bash
The GNU version of the standard shell (the Bourne-Again SHell).
See also "Bourne Shell."
-BBS
- See "Bulletin Board System."
-
Bit
Short for "Binary Digit." All values in computer memory
ultimately reduce to binary digits: values that are either zero or
@@ -28261,11 +28275,6 @@ Built-in Variable
Braces
See "Curly Braces."
-Bulletin Board System
- A computer system allowing users to log in and read and/or leave
- messages for other users of the system, much like leaving paper
- notes on a bulletin board.
-
C
The system programming language that most GNU software is written
in. The `awk' programming language has C-like syntax, and this
@@ -30352,7 +30361,7 @@ Index
(line 6)
* artificial intelligence, gawk and: Distribution contents.
(line 52)
-* ASCII <1>: Glossary. (line 141)
+* ASCII <1>: Glossary. (line 133)
* ASCII: Ordinal Functions. (line 45)
* asort() function (gawk) <1>: Array Sorting Functions.
(line 6)
@@ -30497,7 +30506,6 @@ Index
(line 112)
* backslash (\), in regexp constants: Computed Regexps. (line 28)
* backtrace debugger command: Execution Stack. (line 13)
-* BBS-list file: Sample Data Files. (line 6)
* Beebe, Nelson H.F. <1>: Other Versions. (line 78)
* Beebe, Nelson H.F.: Acknowledgments. (line 60)
* BEGIN pattern <1>: Profiling. (line 62)
@@ -30506,7 +30514,7 @@ Index
* BEGIN pattern: Records. (line 29)
* BEGIN pattern, assert() user-defined function and: Assert Function.
(line 83)
-* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 73)
+* BEGIN pattern, Boolean patterns and: Expression Patterns. (line 70)
* BEGIN pattern, exit statement and: Exit Statement. (line 12)
* BEGIN pattern, getline and: Getline Notes. (line 19)
* BEGIN pattern, headings, adding: Print Examples. (line 43)
@@ -30523,9 +30531,9 @@ Index
* BEGIN pattern, TEXTDOMAIN variable and: Programmer i18n. (line 60)
* BEGINFILE pattern: BEGINFILE/ENDFILE. (line 6)
* BEGINFILE pattern, Boolean patterns and: Expression Patterns.
- (line 73)
+ (line 70)
* beginfile() user-defined function: Filetrans Function. (line 62)
-* Bentley, Jon: Glossary. (line 151)
+* Bentley, Jon: Glossary. (line 143)
* Benzinger, Michael: Contributors. (line 97)
* Berry, Karl <1>: Ranges and Locales. (line 74)
* Berry, Karl: Acknowledgments. (line 33)
@@ -30544,7 +30552,7 @@ Index
* body, in actions: Statements. (line 10)
* body, in loops: While Statement. (line 14)
* Boolean expressions: Boolean Ops. (line 6)
-* Boolean expressions, as patterns: Expression Patterns. (line 41)
+* Boolean expressions, as patterns: Expression Patterns. (line 39)
* Boolean operators, See Boolean expressions: Boolean Ops. (line 6)
* Bourne shell, quoting rules for: Quoting. (line 18)
* braces ({}): Profiling. (line 142)
@@ -30593,7 +30601,7 @@ Index
* Brini, Davide: Signature Program. (line 6)
* Broder, Alan J.: Contributors. (line 88)
* Brown, Martin: Contributors. (line 82)
-* BSD-based operating systems: Glossary. (line 624)
+* BSD-based operating systems: Glossary. (line 616)
* bt debugger command (alias for backtrace): Execution Stack. (line 13)
* Buening, Andreas <1>: Bugs. (line 71)
* Buening, Andreas <2>: Contributors. (line 92)
@@ -30636,7 +30644,7 @@ Index
* character classes, See bracket expressions: Regexp Operators.
(line 55)
* character lists, See bracket expressions: Regexp Operators. (line 55)
-* character sets (machine character encodings) <1>: Glossary. (line 141)
+* character sets (machine character encodings) <1>: Glossary. (line 133)
* character sets (machine character encodings): Ordinal Functions.
(line 45)
* character sets, See Also bracket expressions: Regexp Operators.
@@ -30647,7 +30655,7 @@ Index
* Chassell, Robert J.: Acknowledgments. (line 33)
* chdir() extension function: Extension Sample File Functions.
(line 12)
-* chem utility: Glossary. (line 151)
+* chem utility: Glossary. (line 143)
* chr() extension function: Extension Sample Ord.
(line 15)
* chr() user-defined function: Ordinal Functions. (line 16)
@@ -30670,6 +30678,7 @@ Index
* Collado, Manuel: Acknowledgments. (line 60)
* collating elements: Bracket Expressions. (line 69)
* collating symbols: Bracket Expressions. (line 76)
+* Colombo, Antonio <1>: Contributors. (line 135)
* Colombo, Antonio: Acknowledgments. (line 60)
* columns, aligning: Print Examples. (line 70)
* columns, cutting: Cut Program. (line 6)
@@ -30706,7 +30715,7 @@ Index
* common extensions, func keyword: Definition Syntax. (line 83)
* common extensions, length() applied to an array: String Functions.
(line 193)
-* common extensions, RS as a regexp: Records. (line 120)
+* common extensions, RS as a regexp: Records. (line 135)
* common extensions, single character fields: Single Character Fields.
(line 6)
* comp.lang.awk newsgroup: Bugs. (line 38)
@@ -30722,7 +30731,7 @@ Index
* compatibility mode (gawk), octal numbers: Nondecimal-numbers.
(line 60)
* compatibility mode (gawk), specifying: Options. (line 81)
-* compiled programs <1>: Glossary. (line 165)
+* compiled programs <1>: Glossary. (line 157)
* compiled programs: Basic High Level. (line 15)
* compiling gawk for Cygwin: Cygwin. (line 6)
* compiling gawk for MS-DOS and MS-Windows: PC Compiling. (line 13)
@@ -30764,7 +30773,7 @@ Index
* CONVFMT variable: Conversion. (line 29)
* CONVFMT variable, array subscripts and: Numeric Array Subscripts.
(line 6)
-* cookie: Glossary. (line 157)
+* cookie: Glossary. (line 149)
* coprocesses <1>: Two-way I/O. (line 44)
* coprocesses: Redirection. (line 102)
* coprocesses, closing: Close Files And Pipes.
@@ -30783,7 +30792,7 @@ Index
* cut.awk program: Cut Program. (line 45)
* d debugger command (alias for delete): Breakpoint Control. (line 64)
* d.c., See dark corner: Conventions. (line 38)
-* dark corner <1>: Glossary. (line 197)
+* dark corner <1>: Glossary. (line 189)
* dark corner: Conventions. (line 38)
* dark corner, "0" is actually true: Truth Values. (line 24)
* dark corner, /= operator vs. /=.../ regexp constant: Assignment Ops.
@@ -30810,7 +30819,7 @@ Index
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
-* dark corner, input files: Records. (line 103)
+* dark corner, input files: Records. (line 118)
* dark corner, invoking awk: Command Line. (line 16)
* dark corner, length() function: String Functions. (line 179)
* dark corner, locale's decimal point character: Conversion. (line 77)
@@ -30824,7 +30833,7 @@ Index
* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
(line 43)
* dark corner, split() function: String Functions. (line 358)
-* dark corner, strings, storing: Records. (line 195)
+* dark corner, strings, storing: Records. (line 210)
* dark corner, value of ARGV[0]: Auto-set. (line 35)
* data, fixed-width: Constant Size. (line 10)
* data-driven languages: Basic High Level. (line 85)
@@ -31006,19 +31015,19 @@ Index
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
* differences in awk and gawk, PROCINFO array: Auto-set. (line 133)
-* differences in awk and gawk, record separators: Records. (line 117)
+* differences in awk and gawk, record separators: Records. (line 132)
* differences in awk and gawk, regexp constants: Using Constant Regexps.
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
-* differences in awk and gawk, RS/RT variables: Records. (line 172)
+* differences in awk and gawk, RS/RT variables: Records. (line 187)
* differences in awk and gawk, RT variable: Auto-set. (line 266)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
(line 346)
* differences in awk and gawk, strings: Scalar Constants. (line 20)
-* differences in awk and gawk, strings, storing: Records. (line 191)
+* differences in awk and gawk, strings, storing: Records. (line 206)
* differences in awk and gawk, SYMTAB variable: Auto-set. (line 274)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
(line 162)
@@ -31076,7 +31085,7 @@ Index
* END pattern, assert() user-defined function and: Assert Function.
(line 75)
* END pattern, backslash continuation and: Egrep Program. (line 220)
-* END pattern, Boolean patterns and: Expression Patterns. (line 73)
+* 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.
(line 45)
@@ -31085,7 +31094,7 @@ Index
* END pattern, operators and: Using BEGIN/END. (line 17)
* END pattern, print statement and: I/O And BEGIN/END. (line 16)
* ENDFILE pattern: BEGINFILE/ENDFILE. (line 6)
-* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 73)
+* ENDFILE pattern, Boolean patterns and: Expression Patterns. (line 70)
* endfile() user-defined function: Filetrans Function. (line 62)
* endgrent() function (C library): Group Functions. (line 215)
* endgrent() user-defined function: Group Functions. (line 218)
@@ -31093,7 +31102,7 @@ Index
* endpwent() user-defined function: Passwd Functions. (line 213)
* ENVIRON array: Auto-set. (line 60)
* environment variables: Auto-set. (line 60)
-* epoch, definition of: Glossary. (line 243)
+* epoch, definition of: Glossary. (line 235)
* equals sign (=), = operator: Assignment Ops. (line 6)
* equals sign (=), == operator <1>: Precedence. (line 65)
* equals sign (=), == operator: Comparison Operators.
@@ -31163,7 +31172,7 @@ Index
* extensions, common, func keyword: Definition Syntax. (line 83)
* extensions, common, length() applied to an array: String Functions.
(line 193)
-* extensions, common, RS as a regexp: Records. (line 120)
+* extensions, common, RS as a regexp: Records. (line 135)
* extensions, common, single character fields: Single Character Fields.
(line 6)
* extensions, in gawk, not in POSIX awk: POSIX/GNU. (line 6)
@@ -31236,7 +31245,7 @@ Index
* files, /inet/... (gawk): TCP/IP Networking. (line 6)
* files, /inet4/... (gawk): TCP/IP Networking. (line 6)
* files, /inet6/... (gawk): TCP/IP Networking. (line 6)
-* files, as single records: Records. (line 204)
+* files, as single records: Records. (line 219)
* files, awk programs in: Long. (line 6)
* files, awkprof.out: Profiling. (line 6)
* files, awkvars.out: Options. (line 93)
@@ -31316,10 +31325,10 @@ Index
* frame debugger command: Execution Stack. (line 25)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 6)
-* Free Software Foundation (FSF) <1>: Glossary. (line 305)
+* Free Software Foundation (FSF) <1>: Glossary. (line 297)
* Free Software Foundation (FSF) <2>: Getting. (line 10)
* Free Software Foundation (FSF): Manual History. (line 6)
-* FreeBSD: Glossary. (line 624)
+* FreeBSD: Glossary. (line 616)
* FS variable <1>: User-modified. (line 56)
* FS variable: Field Separators. (line 15)
* FS variable, --field-separator option and: Options. (line 21)
@@ -31332,7 +31341,7 @@ Index
(line 6)
* FS, containing ^: Regexp Field Splitting.
(line 59)
-* FSF (Free Software Foundation) <1>: Glossary. (line 305)
+* FSF (Free Software Foundation) <1>: Glossary. (line 297)
* FSF (Free Software Foundation) <2>: Getting. (line 10)
* FSF (Free Software Foundation): Manual History. (line 6)
* fts() extension function: Extension Sample File Functions.
@@ -31466,7 +31475,7 @@ Index
* gawk, RT variable in <2>: Getline/Variable/File.
(line 10)
* gawk, RT variable in <3>: Multiple Line. (line 129)
-* gawk, RT variable in: Records. (line 117)
+* gawk, RT variable in: Records. (line 132)
* gawk, See Also awk: Preface. (line 36)
* gawk, source code, obtaining: Getting. (line 6)
* gawk, splitting fields and: Constant Size. (line 88)
@@ -31480,7 +31489,7 @@ Index
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
* gawkextlib project: gawkextlib. (line 6)
-* General Public License (GPL): Glossary. (line 314)
+* General Public License (GPL): Glossary. (line 306)
* General Public License, See GPL: Manual History. (line 11)
* gensub() function (gawk) <1>: String Functions. (line 81)
* gensub() function (gawk): Using Constant Regexps.
@@ -31537,18 +31546,18 @@ Index
* GNU awk, See gawk: Preface. (line 49)
* GNU Free Documentation License: GNU Free Documentation License.
(line 6)
-* GNU General Public License: Glossary. (line 314)
-* GNU Lesser General Public License: Glossary. (line 405)
+* GNU General Public License: Glossary. (line 306)
+* GNU Lesser General Public License: Glossary. (line 397)
* GNU long options <1>: Options. (line 6)
* GNU long options: Command Line. (line 13)
* GNU long options, printing list of: Options. (line 154)
-* GNU Project <1>: Glossary. (line 323)
+* GNU Project <1>: Glossary. (line 315)
* GNU Project: Manual History. (line 11)
-* GNU/Linux <1>: Glossary. (line 624)
+* GNU/Linux <1>: Glossary. (line 616)
* GNU/Linux <2>: I18N Example. (line 55)
* GNU/Linux: Manual History. (line 28)
* Gordon, Assaf: Contributors. (line 105)
-* GPL (General Public License) <1>: Glossary. (line 314)
+* GPL (General Public License) <1>: Glossary. (line 306)
* GPL (General Public License): Manual History. (line 11)
* GPL (General Public License), printing: Options. (line 88)
* grcat program: Group Functions. (line 16)
@@ -31674,19 +31683,19 @@ Index
* internationalization, localization, portability and: I18N Portability.
(line 6)
* internationalizing a program: Explaining gettext. (line 6)
-* interpreted programs <1>: Glossary. (line 365)
+* interpreted programs <1>: Glossary. (line 357)
* interpreted programs: Basic High Level. (line 15)
* interval expressions: Regexp Operators. (line 116)
* inventory-shipped file: Sample Data Files. (line 32)
* isarray() function (gawk): Type Functions. (line 11)
-* ISO: Glossary. (line 376)
-* ISO 8859-1: Glossary. (line 141)
-* ISO Latin-1: Glossary. (line 141)
+* ISO: Glossary. (line 368)
+* ISO 8859-1: Glossary. (line 133)
+* ISO Latin-1: Glossary. (line 133)
* Jacobs, Andrew: Passwd Functions. (line 90)
* Jaegermann, Michal <1>: Contributors. (line 45)
* Jaegermann, Michal: Acknowledgments. (line 60)
* Java implementation of awk: Other Versions. (line 112)
-* Java programming language: Glossary. (line 388)
+* Java programming language: Glossary. (line 380)
* jawk: Other Versions. (line 112)
* Jedi knights: Undocumented. (line 6)
* join() user-defined function: Join Function. (line 18)
@@ -31694,7 +31703,7 @@ Index
* Kahrs, Ju"rgen: Acknowledgments. (line 60)
* Kasal, Stepan: Acknowledgments. (line 60)
* Kenobi, Obi-Wan: Undocumented. (line 6)
-* Kernighan, Brian <1>: Glossary. (line 151)
+* Kernighan, Brian <1>: Glossary. (line 143)
* Kernighan, Brian <2>: Basic Data Typing. (line 55)
* Kernighan, Brian <3>: Other Versions. (line 13)
* Kernighan, Brian <4>: Contributors. (line 11)
@@ -31735,8 +31744,8 @@ Index
* left shift, bitwise: Bitwise Functions. (line 32)
* leftmost longest match: Multiple Line. (line 26)
* length() function: String Functions. (line 163)
-* Lesser General Public License (LGPL): Glossary. (line 405)
-* LGPL (Lesser General Public License): Glossary. (line 405)
+* Lesser General Public License (LGPL): Glossary. (line 397)
+* LGPL (Lesser General Public License): Glossary. (line 397)
* libmawk: Other Versions. (line 120)
* libraries of awk functions: Library Functions. (line 6)
* libraries of awk functions, assertions: Assert Function. (line 6)
@@ -31781,7 +31790,7 @@ Index
* lint checking, undefined functions: Pass By Value/Reference.
(line 88)
* LINT variable: User-modified. (line 98)
-* Linux <1>: Glossary. (line 624)
+* Linux <1>: Glossary. (line 616)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
* list debugger command: Miscellaneous Debugger Commands.
@@ -31813,6 +31822,7 @@ Index
* ls utility: More Complex. (line 15)
* lshift() function (gawk): Bitwise Functions. (line 46)
* lvalues/rvalues: Assignment Ops. (line 32)
+* mail-list file: Sample Data Files. (line 6)
* mailing labels, printing: Labels Program. (line 6)
* mailing list, GNITS: Acknowledgments. (line 52)
* Malmberg, John <1>: Bugs. (line 72)
@@ -31862,7 +31872,7 @@ Index
* namespace issues, functions: Definition Syntax. (line 20)
* nawk utility: Names. (line 17)
* negative zero: Unexpected Results. (line 34)
-* NetBSD: Glossary. (line 624)
+* NetBSD: Glossary. (line 616)
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines <1>: Boolean Ops. (line 67)
@@ -31909,7 +31919,7 @@ Index
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
(line 43)
-* null strings: Records. (line 107)
+* null strings: Records. (line 122)
* null strings, array elements and: Delete. (line 27)
* null strings, as array subscripts: Uninitialized Subscripts.
(line 43)
@@ -31947,7 +31957,7 @@ Index
* OFS variable <1>: User-modified. (line 124)
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
-* OpenBSD: Glossary. (line 624)
+* OpenBSD: Glossary. (line 616)
* OpenSolaris: Other Versions. (line 96)
* operating systems, BSD-based: Manual History. (line 28)
* operating systems, PC, gawk on: PC Using. (line 6)
@@ -32018,7 +32028,7 @@ Index
* output, standard: Special FD. (line 6)
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
-* P1003.1 POSIX standard: Glossary. (line 462)
+* P1003.1 POSIX standard: Glossary. (line 454)
* parentheses () <1>: Profiling. (line 146)
* parentheses (): Regexp Operators. (line 79)
* password file: Passwd Functions. (line 16)
@@ -32031,7 +32041,7 @@ Index
* patterns, empty: Empty. (line 6)
* patterns, expressions as: Regexp Patterns. (line 6)
* patterns, ranges in: Ranges. (line 6)
-* patterns, regexp constants as: Expression Patterns. (line 36)
+* patterns, regexp constants as: Expression Patterns. (line 34)
* patterns, types of: Pattern Overview. (line 15)
* pawk (profiling version of Brian Kernighan's awk): Other Versions.
(line 78)
@@ -32069,7 +32079,7 @@ Index
(line 112)
* portability, close() function and: Close Files And Pipes.
(line 81)
-* portability, data files as single record: Records. (line 179)
+* portability, data files as single record: Records. (line 194)
* portability, deleting array elements: Delete. (line 56)
* portability, example programs: Library Functions. (line 42)
* portability, functions, defining: Definition Syntax. (line 99)
@@ -32209,7 +32219,7 @@ Index
* programming languages, Ada: Glossary. (line 20)
* programming languages, data-driven vs. procedural: Getting Started.
(line 12)
-* programming languages, Java: Glossary. (line 388)
+* programming languages, Java: Glossary. (line 380)
* programming, basic steps: Basic High Level. (line 20)
* programming, concepts: Basic Concepts. (line 6)
* pwcat program: Passwd Functions. (line 23)
@@ -32260,16 +32270,16 @@ Index
* recipe for a programming language: History. (line 6)
* record separators <1>: User-modified. (line 143)
* record separators: Records. (line 14)
-* record separators, changing: Records. (line 81)
-* record separators, regular expressions as: Records. (line 117)
+* record separators, changing: Records. (line 93)
+* record separators, regular expressions as: Records. (line 132)
* record separators, with multiline records: Multiple Line. (line 10)
* records <1>: Basic High Level. (line 73)
* records: Reading Files. (line 14)
* records, multiline: Multiple Line. (line 6)
* records, printing: Print. (line 22)
* records, splitting input into: Records. (line 6)
-* records, terminating: Records. (line 117)
-* records, treating files as: Records. (line 204)
+* records, terminating: Records. (line 132)
+* records, treating files as: Records. (line 219)
* recursive functions: Definition Syntax. (line 73)
* redirection of input: Getline/File. (line 6)
* redirection of output: Redirection. (line 6)
@@ -32280,7 +32290,7 @@ Index
* regexp constants <2>: Regexp Constants. (line 6)
* regexp constants: Regexp Usage. (line 57)
* regexp constants, /=.../, /= operator and: Assignment Ops. (line 147)
-* regexp constants, as patterns: Expression Patterns. (line 36)
+* regexp constants, as patterns: Expression Patterns. (line 34)
* regexp constants, in gawk: Using Constant Regexps.
(line 28)
* regexp constants, slashes vs. quotes: Computed Regexps. (line 28)
@@ -32293,7 +32303,7 @@ Index
(line 6)
* regular expressions, as patterns <1>: Regexp Patterns. (line 6)
* regular expressions, as patterns: Regexp Usage. (line 6)
-* regular expressions, as record separators: Records. (line 117)
+* regular expressions, as record separators: Records. (line 132)
* regular expressions, case sensitivity <1>: User-modified. (line 82)
* regular expressions, case sensitivity: Case-sensitivity. (line 6)
* regular expressions, computed: Computed Regexps. (line 6)
@@ -32346,13 +32356,13 @@ Index
* RLENGTH variable, match() function and: String Functions. (line 220)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 32)
-* Robbins, Arnold <3>: Contributors. (line 135)
+* Robbins, Arnold <3>: Contributors. (line 139)
* Robbins, Arnold <4>: General Data Types. (line 6)
* Robbins, Arnold <5>: Alarm Program. (line 6)
* Robbins, Arnold <6>: Passwd Functions. (line 90)
* Robbins, Arnold <7>: Getline/Pipe. (line 39)
* Robbins, Arnold: Command Line Field Separator.
- (line 80)
+ (line 73)
* Robbins, Bill: Getline/Pipe. (line 39)
* Robbins, Harry: Acknowledgments. (line 78)
* Robbins, Jean: Acknowledgments. (line 78)
@@ -32376,7 +32386,7 @@ Index
* RT variable <2>: Getline/Variable/File.
(line 10)
* RT variable <3>: Multiple Line. (line 129)
-* RT variable: Records. (line 117)
+* RT variable: Records. (line 132)
* Rubin, Paul <1>: Contributors. (line 15)
* Rubin, Paul: History. (line 30)
* rule, definition of: Getting Started. (line 21)
@@ -32421,7 +32431,7 @@ Index
* separators, field, POSIX and: Fields. (line 6)
* separators, for records <1>: User-modified. (line 143)
* separators, for records: Records. (line 14)
-* separators, for records, regular expressions as: Records. (line 117)
+* separators, for records, regular expressions as: Records. (line 132)
* separators, for statements in actions: Action Overview. (line 19)
* separators, subscript: User-modified. (line 156)
* set debugger command: Viewing And Changing Data.
@@ -32471,7 +32481,7 @@ Index
* 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: Records. (line 177)
+* sidebar, RS = "\0" Is Not Portable: Records. (line 192)
* sidebar, So Why Does gawk have BEGINFILE and ENDFILE?: Filetrans Function.
(line 83)
* sidebar, Syntactic Ambiguities Between /= and Regular Expressions: Assignment Ops.
@@ -32541,7 +32551,7 @@ Index
* sqrt() function: Numeric Functions. (line 78)
* square brackets ([]): Regexp Operators. (line 55)
* srand() function: Numeric Functions. (line 82)
-* Stallman, Richard <1>: Glossary. (line 305)
+* Stallman, Richard <1>: Glossary. (line 297)
* Stallman, Richard <2>: Contributors. (line 23)
* Stallman, Richard <3>: Acknowledgments. (line 18)
* Stallman, Richard: Manual History. (line 6)
@@ -32571,7 +32581,7 @@ Index
* strings, converting <1>: Bitwise Functions. (line 109)
* strings, converting: Conversion. (line 6)
* strings, converting, numbers to: User-modified. (line 28)
-* strings, empty, See null strings: Records. (line 107)
+* strings, empty, See null strings: Records. (line 122)
* strings, extracting: String Extraction. (line 6)
* strings, for localization: Programmer i18n. (line 14)
* strings, length of: Scalar Constants. (line 20)
@@ -32613,7 +32623,7 @@ Index
* TCP/IP, support for: Special Network. (line 6)
* tee utility: Tee Program. (line 6)
* tee.awk program: Tee Program. (line 26)
-* terminating records: Records. (line 117)
+* terminating records: Records. (line 132)
* testbits.awk program: Bitwise Functions. (line 70)
* testext extension: Extension Sample API Tests.
(line 6)
@@ -32709,20 +32719,20 @@ Index
* undisplay debugger command: Viewing And Changing Data.
(line 80)
* undocumented features: Undocumented. (line 6)
-* Unicode <1>: Glossary. (line 141)
+* Unicode <1>: Glossary. (line 133)
* Unicode <2>: Ranges and Locales. (line 61)
* Unicode: Ordinal Functions. (line 45)
* uninitialized variables, as array subscripts: Uninitialized Subscripts.
(line 6)
* uniq utility: Uniq Program. (line 6)
* uniq.awk program: Uniq Program. (line 65)
-* Unix: Glossary. (line 624)
+* Unix: Glossary. (line 616)
* Unix awk, backslashes in escape sequences: Escape Sequences.
(line 124)
* Unix awk, close() function and: Close Files And Pipes.
(line 130)
* Unix awk, password files, field separators and: Command Line Field Separator.
- (line 72)
+ (line 64)
* Unix, awk scripts and: Executable Scripts. (line 6)
* UNIXROOT variable, on OS/2 systems: PC Using. (line 16)
* unsigned integers: General Arithmetic. (line 15)
@@ -32887,499 +32897,499 @@ Node: Comments80254
Node: Quoting82721
Node: DOS Quoting87344
Node: Sample Data Files88019
-Node: Very Simple90405
-Node: Two Rules95004
-Node: More Complex97151
-Ref: More Complex-Footnote-1100081
-Node: Statements/Lines100166
-Ref: Statements/Lines-Footnote-1104628
-Node: Other Features104893
-Node: When105821
-Node: Invoking Gawk107968
-Node: Command Line109431
-Node: Options110214
-Ref: Options-Footnote-1125609
-Node: Other Arguments125634
-Node: Naming Standard Input128292
-Node: Environment Variables129386
-Node: AWKPATH Variable129944
-Ref: AWKPATH Variable-Footnote-1132702
-Node: AWKLIBPATH Variable132962
-Node: Other Environment Variables133680
-Node: Exit Status136643
-Node: Include Files137318
-Node: Loading Shared Libraries140887
-Node: Obsolete142251
-Node: Undocumented142948
-Node: Regexp143190
-Node: Regexp Usage144579
-Node: Escape Sequences146605
-Node: Regexp Operators152274
-Ref: Regexp Operators-Footnote-1159654
-Ref: Regexp Operators-Footnote-2159801
-Node: Bracket Expressions159899
-Ref: table-char-classes161789
-Node: GNU Regexp Operators164312
-Node: Case-sensitivity168035
-Ref: Case-sensitivity-Footnote-1171003
-Ref: Case-sensitivity-Footnote-2171238
-Node: Leftmost Longest171346
-Node: Computed Regexps172547
-Node: Reading Files175884
-Node: Records177886
-Ref: Records-Footnote-1186974
-Node: Fields187011
-Ref: Fields-Footnote-1190044
-Node: Nonconstant Fields190130
-Node: Changing Fields192332
-Node: Field Separators198291
-Node: Default Field Splitting200993
-Node: Regexp Field Splitting202110
-Node: Single Character Fields205452
-Node: Command Line Field Separator206511
-Node: Full Line Fields209945
-Ref: Full Line Fields-Footnote-1210453
-Node: Field Splitting Summary210499
-Ref: Field Splitting Summary-Footnote-1213598
-Node: Constant Size213699
-Node: Splitting By Content218306
-Ref: Splitting By Content-Footnote-1222055
-Node: Multiple Line222095
-Ref: Multiple Line-Footnote-1227942
-Node: Getline228121
-Node: Plain Getline230337
-Node: Getline/Variable232432
-Node: Getline/File233579
-Node: Getline/Variable/File234920
-Ref: Getline/Variable/File-Footnote-1236519
-Node: Getline/Pipe236606
-Node: Getline/Variable/Pipe239305
-Node: Getline/Coprocess240412
-Node: Getline/Variable/Coprocess241664
-Node: Getline Notes242401
-Node: Getline Summary245188
-Ref: table-getline-variants245596
-Node: Read Timeout246508
-Ref: Read Timeout-Footnote-1250249
-Node: Command line directories250306
-Node: Printing250936
-Node: Print252567
-Node: Print Examples253904
-Node: Output Separators256688
-Node: OFMT258448
-Node: Printf259806
-Node: Basic Printf260712
-Node: Control Letters262251
-Node: Format Modifiers266063
-Node: Printf Examples272072
-Node: Redirection274787
-Node: Special Files281752
-Node: Special FD282285
-Ref: Special FD-Footnote-1285910
-Node: Special Network285984
-Node: Special Caveats286834
-Node: Close Files And Pipes287630
-Ref: Close Files And Pipes-Footnote-1294613
-Ref: Close Files And Pipes-Footnote-2294761
-Node: Expressions294911
-Node: Values296043
-Node: Constants296719
-Node: Scalar Constants297399
-Ref: Scalar Constants-Footnote-1298258
-Node: Nondecimal-numbers298440
-Node: Regexp Constants301440
-Node: Using Constant Regexps301915
-Node: Variables304970
-Node: Using Variables305625
-Node: Assignment Options307349
-Node: Conversion309221
-Ref: table-locale-affects314721
-Ref: Conversion-Footnote-1315345
-Node: All Operators315454
-Node: Arithmetic Ops316084
-Node: Concatenation318589
-Ref: Concatenation-Footnote-1321381
-Node: Assignment Ops321501
-Ref: table-assign-ops326489
-Node: Increment Ops327820
-Node: Truth Values and Conditions331254
-Node: Truth Values332337
-Node: Typing and Comparison333386
-Node: Variable Typing334179
-Ref: Variable Typing-Footnote-1338076
-Node: Comparison Operators338198
-Ref: table-relational-ops338608
-Node: POSIX String Comparison342156
-Ref: POSIX String Comparison-Footnote-1343112
-Node: Boolean Ops343250
-Ref: Boolean Ops-Footnote-1347328
-Node: Conditional Exp347419
-Node: Function Calls349151
-Node: Precedence352745
-Node: Locales356414
-Node: Patterns and Actions357503
-Node: Pattern Overview358557
-Node: Regexp Patterns360226
-Node: Expression Patterns360769
-Node: Ranges364454
-Node: BEGIN/END367558
-Node: Using BEGIN/END368320
-Ref: Using BEGIN/END-Footnote-1371051
-Node: I/O And BEGIN/END371157
-Node: BEGINFILE/ENDFILE373439
-Node: Empty376353
-Node: Using Shell Variables376669
-Node: Action Overview378954
-Node: Statements381311
-Node: If Statement383165
-Node: While Statement384664
-Node: Do Statement386708
-Node: For Statement387864
-Node: Switch Statement391016
-Node: Break Statement393170
-Node: Continue Statement395160
-Node: Next Statement396953
-Node: Nextfile Statement399343
-Node: Exit Statement401998
-Node: Built-in Variables404414
-Node: User-modified405509
-Ref: User-modified-Footnote-1413867
-Node: Auto-set413929
-Ref: Auto-set-Footnote-1427007
-Ref: Auto-set-Footnote-2427212
-Node: ARGC and ARGV427268
-Node: Arrays431119
-Node: Array Basics432624
-Node: Array Intro433450
-Node: Reference to Elements437767
-Node: Assigning Elements440037
-Node: Array Example440528
-Node: Scanning an Array442260
-Node: Controlling Scanning444574
-Ref: Controlling Scanning-Footnote-1449661
-Node: Delete449977
-Ref: Delete-Footnote-1452742
-Node: Numeric Array Subscripts452799
-Node: Uninitialized Subscripts454982
-Node: Multidimensional456609
-Node: Multiscanning459702
-Node: Arrays of Arrays461291
-Node: Functions465931
-Node: Built-in466750
-Node: Calling Built-in467828
-Node: Numeric Functions469816
-Ref: Numeric Functions-Footnote-1473648
-Ref: Numeric Functions-Footnote-2474005
-Ref: Numeric Functions-Footnote-3474053
-Node: String Functions474322
-Ref: String Functions-Footnote-1497242
-Ref: String Functions-Footnote-2497371
-Ref: String Functions-Footnote-3497619
-Node: Gory Details497706
-Ref: table-sub-escapes499385
-Ref: table-sub-posix-92500739
-Ref: table-sub-proposed502090
-Ref: table-posix-sub503444
-Ref: table-gensub-escapes504989
-Ref: Gory Details-Footnote-1506165
-Ref: Gory Details-Footnote-2506216
-Node: I/O Functions506367
-Ref: I/O Functions-Footnote-1513357
-Node: Time Functions513504
-Ref: Time Functions-Footnote-1524437
-Ref: Time Functions-Footnote-2524505
-Ref: Time Functions-Footnote-3524663
-Ref: Time Functions-Footnote-4524774
-Ref: Time Functions-Footnote-5524886
-Ref: Time Functions-Footnote-6525113
-Node: Bitwise Functions525379
-Ref: table-bitwise-ops525941
-Ref: Bitwise Functions-Footnote-1530162
-Node: Type Functions530346
-Node: I18N Functions531497
-Node: User-defined533124
-Node: Definition Syntax533928
-Ref: Definition Syntax-Footnote-1538842
-Node: Function Example538911
-Ref: Function Example-Footnote-1541560
-Node: Function Caveats541582
-Node: Calling A Function542100
-Node: Variable Scope543055
-Node: Pass By Value/Reference546018
-Node: Return Statement549526
-Node: Dynamic Typing552507
-Node: Indirect Calls553438
-Node: Library Functions563125
-Ref: Library Functions-Footnote-1566638
-Ref: Library Functions-Footnote-2566781
-Node: Library Names566952
-Ref: Library Names-Footnote-1570425
-Ref: Library Names-Footnote-2570645
-Node: General Functions570731
-Node: Strtonum Function571759
-Node: Assert Function574689
-Node: Round Function578015
-Node: Cliff Random Function579556
-Node: Ordinal Functions580572
-Ref: Ordinal Functions-Footnote-1583649
-Ref: Ordinal Functions-Footnote-2583901
-Node: Join Function584112
-Ref: Join Function-Footnote-1585883
-Node: Getlocaltime Function586083
-Node: Readfile Function589824
-Node: Data File Management591663
-Node: Filetrans Function592295
-Node: Rewind Function596364
-Node: File Checking597751
-Node: Empty Files598845
-Node: Ignoring Assigns601075
-Node: Getopt Function602629
-Ref: Getopt Function-Footnote-1613932
-Node: Passwd Functions614135
-Ref: Passwd Functions-Footnote-1623113
-Node: Group Functions623201
-Node: Walking Arrays631285
-Node: Sample Programs633421
-Node: Running Examples634095
-Node: Clones634823
-Node: Cut Program636047
-Node: Egrep Program645898
-Ref: Egrep Program-Footnote-1653671
-Node: Id Program653781
-Node: Split Program657397
-Ref: Split Program-Footnote-1660916
-Node: Tee Program661044
-Node: Uniq Program663847
-Node: Wc Program671276
-Ref: Wc Program-Footnote-1675542
-Ref: Wc Program-Footnote-2675742
-Node: Miscellaneous Programs675834
-Node: Dupword Program677022
-Node: Alarm Program679053
-Node: Translate Program683860
-Ref: Translate Program-Footnote-1688247
-Ref: Translate Program-Footnote-2688495
-Node: Labels Program688629
-Ref: Labels Program-Footnote-1692000
-Node: Word Sorting692084
-Node: History Sorting695968
-Node: Extract Program697807
-Ref: Extract Program-Footnote-1705310
-Node: Simple Sed705438
-Node: Igawk Program708500
-Ref: Igawk Program-Footnote-1723657
-Ref: Igawk Program-Footnote-2723858
-Node: Anagram Program723996
-Node: Signature Program727064
-Node: Advanced Features728164
-Node: Nondecimal Data730050
-Node: Array Sorting731633
-Node: Controlling Array Traversal732330
-Node: Array Sorting Functions740614
-Ref: Array Sorting Functions-Footnote-1744483
-Node: Two-way I/O744677
-Ref: Two-way I/O-Footnote-1750109
-Node: TCP/IP Networking750191
-Node: Profiling753035
-Node: Internationalization760538
-Node: I18N and L10N761963
-Node: Explaining gettext762649
-Ref: Explaining gettext-Footnote-1767717
-Ref: Explaining gettext-Footnote-2767901
-Node: Programmer i18n768066
-Node: Translator i18n772268
-Node: String Extraction773062
-Ref: String Extraction-Footnote-1774023
-Node: Printf Ordering774109
-Ref: Printf Ordering-Footnote-1776891
-Node: I18N Portability776955
-Ref: I18N Portability-Footnote-1779404
-Node: I18N Example779467
-Ref: I18N Example-Footnote-1782105
-Node: Gawk I18N782177
-Node: Debugger782798
-Node: Debugging783769
-Node: Debugging Concepts784202
-Node: Debugging Terms786058
-Node: Awk Debugging788655
-Node: Sample Debugging Session789547
-Node: Debugger Invocation790067
-Node: Finding The Bug791400
-Node: List of Debugger Commands797887
-Node: Breakpoint Control799221
-Node: Debugger Execution Control802885
-Node: Viewing And Changing Data806245
-Node: Execution Stack809601
-Node: Debugger Info811068
-Node: Miscellaneous Debugger Commands815050
-Node: Readline Support820226
-Node: Limitations821057
-Node: Arbitrary Precision Arithmetic823309
-Ref: Arbitrary Precision Arithmetic-Footnote-1824958
-Node: General Arithmetic825106
-Node: Floating Point Issues826826
-Node: String Conversion Precision827707
-Ref: String Conversion Precision-Footnote-1829412
-Node: Unexpected Results829521
-Node: POSIX Floating Point Problems831674
-Ref: POSIX Floating Point Problems-Footnote-1835499
-Node: Integer Programming835537
-Node: Floating-point Programming837276
-Ref: Floating-point Programming-Footnote-1843607
-Ref: Floating-point Programming-Footnote-2843877
-Node: Floating-point Representation844141
-Node: Floating-point Context845306
-Ref: table-ieee-formats846145
-Node: Rounding Mode847529
-Ref: table-rounding-modes848008
-Ref: Rounding Mode-Footnote-1851023
-Node: Gawk and MPFR851202
-Node: Arbitrary Precision Floats852457
-Ref: Arbitrary Precision Floats-Footnote-1854900
-Node: Setting Precision855216
-Ref: table-predefined-precision-strings855902
-Node: Setting Rounding Mode858047
-Ref: table-gawk-rounding-modes858451
-Node: Floating-point Constants859638
-Node: Changing Precision861067
-Ref: Changing Precision-Footnote-1862464
-Node: Exact Arithmetic862638
-Node: Arbitrary Precision Integers865776
-Ref: Arbitrary Precision Integers-Footnote-1868791
-Node: Dynamic Extensions868938
-Node: Extension Intro870396
-Node: Plugin License871661
-Node: Extension Mechanism Outline872346
-Ref: load-extension872763
-Ref: load-new-function874241
-Ref: call-new-function875236
-Node: Extension API Description877251
-Node: Extension API Functions Introduction878538
-Node: General Data Types883465
-Ref: General Data Types-Footnote-1889160
-Node: Requesting Values889459
-Ref: table-value-types-returned890196
-Node: Memory Allocation Functions891150
-Ref: Memory Allocation Functions-Footnote-1893896
-Node: Constructor Functions893992
-Node: Registration Functions895750
-Node: Extension Functions896435
-Node: Exit Callback Functions898737
-Node: Extension Version String899986
-Node: Input Parsers900636
-Node: Output Wrappers910393
-Node: Two-way processors914903
-Node: Printing Messages917111
-Ref: Printing Messages-Footnote-1918188
-Node: Updating `ERRNO'918340
-Node: Accessing Parameters919079
-Node: Symbol Table Access920309
-Node: Symbol table by name920823
-Node: Symbol table by cookie922572
-Ref: Symbol table by cookie-Footnote-1926704
-Node: Cached values926767
-Ref: Cached values-Footnote-1930257
-Node: Array Manipulation930348
-Ref: Array Manipulation-Footnote-1931446
-Node: Array Data Types931485
-Ref: Array Data Types-Footnote-1934188
-Node: Array Functions934280
-Node: Flattening Arrays938116
-Node: Creating Arrays944968
-Node: Extension API Variables949693
-Node: Extension Versioning950329
-Node: Extension API Informational Variables952230
-Node: Extension API Boilerplate953316
-Node: Finding Extensions957120
-Node: Extension Example957680
-Node: Internal File Description958410
-Node: Internal File Ops962501
-Ref: Internal File Ops-Footnote-1974010
-Node: Using Internal File Ops974150
-Ref: Using Internal File Ops-Footnote-1976503
-Node: Extension Samples976769
-Node: Extension Sample File Functions978293
-Node: Extension Sample Fnmatch986778
-Node: Extension Sample Fork988547
-Node: Extension Sample Inplace989760
-Node: Extension Sample Ord991538
-Node: Extension Sample Readdir992374
-Node: Extension Sample Revout993906
-Node: Extension Sample Rev2way994499
-Node: Extension Sample Read write array995189
-Node: Extension Sample Readfile997072
-Node: Extension Sample API Tests997890
-Node: Extension Sample Time998415
-Node: gawkextlib999779
-Node: Language History1002560
-Node: V7/SVR3.11004153
-Node: SVR41006473
-Node: POSIX1007915
-Node: BTL1009301
-Node: POSIX/GNU1010035
-Node: Feature History1015634
-Node: Common Extensions1028610
-Node: Ranges and Locales1029922
-Ref: Ranges and Locales-Footnote-11034539
-Ref: Ranges and Locales-Footnote-21034566
-Ref: Ranges and Locales-Footnote-31034800
-Node: Contributors1035021
-Node: Installation1040248
-Node: Gawk Distribution1041142
-Node: Getting1041626
-Node: Extracting1042452
-Node: Distribution contents1044144
-Node: Unix Installation1049849
-Node: Quick Installation1050466
-Node: Additional Configuration Options1052912
-Node: Configuration Philosophy1054648
-Node: Non-Unix Installation1057002
-Node: PC Installation1057460
-Node: PC Binary Installation1058759
-Node: PC Compiling1060607
-Node: PC Testing1063551
-Node: PC Using1064727
-Node: Cygwin1068895
-Node: MSYS1069704
-Node: VMS Installation1070218
-Node: VMS Compilation1070982
-Ref: VMS Compilation-Footnote-11072234
-Node: VMS Dynamic Extensions1072292
-Node: VMS Installation Details1073665
-Node: VMS Running1075916
-Node: VMS GNV1078750
-Node: VMS Old Gawk1079473
-Node: Bugs1079943
-Node: Other Versions1083861
-Node: Notes1089945
-Node: Compatibility Mode1090745
-Node: Additions1091528
-Node: Accessing The Source1092455
-Node: Adding Code1093895
-Node: New Ports1099940
-Node: Derived Files1104075
-Ref: Derived Files-Footnote-11109396
-Ref: Derived Files-Footnote-21109430
-Ref: Derived Files-Footnote-31110030
-Node: Future Extensions1110128
-Node: Implementation Limitations1110711
-Node: Extension Design1111963
-Node: Old Extension Problems1113117
-Ref: Old Extension Problems-Footnote-11114625
-Node: Extension New Mechanism Goals1114682
-Ref: Extension New Mechanism Goals-Footnote-11118047
-Node: Extension Other Design Decisions1118233
-Node: Extension Future Growth1120339
-Node: Old Extension Mechanism1121175
-Node: Basic Concepts1122915
-Node: Basic High Level1123596
-Ref: figure-general-flow1123867
-Ref: figure-process-flow1124466
-Ref: Basic High Level-Footnote-11127695
-Node: Basic Data Typing1127880
-Node: Glossary1131235
-Node: Copying1156697
-Node: GNU Free Documentation License1194254
-Node: Index1219391
+Node: Very Simple90534
+Node: Two Rules95185
+Node: More Complex97083
+Ref: More Complex-Footnote-1100013
+Node: Statements/Lines100098
+Ref: Statements/Lines-Footnote-1104561
+Node: Other Features104826
+Node: When105754
+Node: Invoking Gawk107901
+Node: Command Line109364
+Node: Options110147
+Ref: Options-Footnote-1125542
+Node: Other Arguments125567
+Node: Naming Standard Input128225
+Node: Environment Variables129319
+Node: AWKPATH Variable129877
+Ref: AWKPATH Variable-Footnote-1132635
+Node: AWKLIBPATH Variable132895
+Node: Other Environment Variables133613
+Node: Exit Status136576
+Node: Include Files137251
+Node: Loading Shared Libraries140820
+Node: Obsolete142184
+Node: Undocumented142881
+Node: Regexp143123
+Node: Regexp Usage144512
+Node: Escape Sequences146537
+Node: Regexp Operators152206
+Ref: Regexp Operators-Footnote-1159586
+Ref: Regexp Operators-Footnote-2159733
+Node: Bracket Expressions159831
+Ref: table-char-classes161721
+Node: GNU Regexp Operators164244
+Node: Case-sensitivity167967
+Ref: Case-sensitivity-Footnote-1170935
+Ref: Case-sensitivity-Footnote-2171170
+Node: Leftmost Longest171278
+Node: Computed Regexps172479
+Node: Reading Files175816
+Node: Records177818
+Ref: Records-Footnote-1187341
+Node: Fields187378
+Ref: Fields-Footnote-1190334
+Node: Nonconstant Fields190420
+Node: Changing Fields192626
+Node: Field Separators198585
+Node: Default Field Splitting201287
+Node: Regexp Field Splitting202404
+Node: Single Character Fields205746
+Node: Command Line Field Separator206805
+Node: Full Line Fields210147
+Ref: Full Line Fields-Footnote-1210655
+Node: Field Splitting Summary210701
+Ref: Field Splitting Summary-Footnote-1213800
+Node: Constant Size213901
+Node: Splitting By Content218508
+Ref: Splitting By Content-Footnote-1222257
+Node: Multiple Line222297
+Ref: Multiple Line-Footnote-1228144
+Node: Getline228323
+Node: Plain Getline230539
+Node: Getline/Variable232634
+Node: Getline/File233781
+Node: Getline/Variable/File235122
+Ref: Getline/Variable/File-Footnote-1236721
+Node: Getline/Pipe236808
+Node: Getline/Variable/Pipe239507
+Node: Getline/Coprocess240614
+Node: Getline/Variable/Coprocess241866
+Node: Getline Notes242603
+Node: Getline Summary245390
+Ref: table-getline-variants245798
+Node: Read Timeout246710
+Ref: Read Timeout-Footnote-1250451
+Node: Command line directories250508
+Node: Printing251138
+Node: Print252769
+Node: Print Examples254106
+Node: Output Separators256890
+Node: OFMT258906
+Node: Printf260264
+Node: Basic Printf261170
+Node: Control Letters262709
+Node: Format Modifiers266521
+Node: Printf Examples272530
+Node: Redirection275242
+Node: Special Files282216
+Node: Special FD282749
+Ref: Special FD-Footnote-1286374
+Node: Special Network286448
+Node: Special Caveats287298
+Node: Close Files And Pipes288094
+Ref: Close Files And Pipes-Footnote-1295077
+Ref: Close Files And Pipes-Footnote-2295225
+Node: Expressions295375
+Node: Values296507
+Node: Constants297183
+Node: Scalar Constants297863
+Ref: Scalar Constants-Footnote-1298722
+Node: Nondecimal-numbers298904
+Node: Regexp Constants301904
+Node: Using Constant Regexps302379
+Node: Variables305434
+Node: Using Variables306089
+Node: Assignment Options307813
+Node: Conversion309688
+Ref: table-locale-affects315188
+Ref: Conversion-Footnote-1315812
+Node: All Operators315921
+Node: Arithmetic Ops316551
+Node: Concatenation319056
+Ref: Concatenation-Footnote-1321844
+Node: Assignment Ops321964
+Ref: table-assign-ops326952
+Node: Increment Ops328283
+Node: Truth Values and Conditions331717
+Node: Truth Values332800
+Node: Typing and Comparison333849
+Node: Variable Typing334642
+Ref: Variable Typing-Footnote-1338539
+Node: Comparison Operators338661
+Ref: table-relational-ops339071
+Node: POSIX String Comparison342619
+Ref: POSIX String Comparison-Footnote-1343575
+Node: Boolean Ops343713
+Ref: Boolean Ops-Footnote-1347783
+Node: Conditional Exp347874
+Node: Function Calls349606
+Node: Precedence353200
+Node: Locales356869
+Node: Patterns and Actions357958
+Node: Pattern Overview359012
+Node: Regexp Patterns360681
+Node: Expression Patterns361224
+Node: Ranges365005
+Node: BEGIN/END368109
+Node: Using BEGIN/END368871
+Ref: Using BEGIN/END-Footnote-1371607
+Node: I/O And BEGIN/END371713
+Node: BEGINFILE/ENDFILE373995
+Node: Empty376909
+Node: Using Shell Variables377226
+Node: Action Overview379511
+Node: Statements381868
+Node: If Statement383722
+Node: While Statement385221
+Node: Do Statement387265
+Node: For Statement388421
+Node: Switch Statement391573
+Node: Break Statement393727
+Node: Continue Statement395717
+Node: Next Statement397510
+Node: Nextfile Statement399900
+Node: Exit Statement402555
+Node: Built-in Variables404971
+Node: User-modified406066
+Ref: User-modified-Footnote-1414424
+Node: Auto-set414486
+Ref: Auto-set-Footnote-1427567
+Ref: Auto-set-Footnote-2427772
+Node: ARGC and ARGV427828
+Node: Arrays431682
+Node: Array Basics433187
+Node: Array Intro434013
+Node: Reference to Elements438330
+Node: Assigning Elements440600
+Node: Array Example441091
+Node: Scanning an Array442823
+Node: Controlling Scanning445137
+Ref: Controlling Scanning-Footnote-1450224
+Node: Delete450540
+Ref: Delete-Footnote-1453305
+Node: Numeric Array Subscripts453362
+Node: Uninitialized Subscripts455545
+Node: Multidimensional457172
+Node: Multiscanning460265
+Node: Arrays of Arrays461854
+Node: Functions466494
+Node: Built-in467313
+Node: Calling Built-in468391
+Node: Numeric Functions470379
+Ref: Numeric Functions-Footnote-1474211
+Ref: Numeric Functions-Footnote-2474568
+Ref: Numeric Functions-Footnote-3474616
+Node: String Functions474885
+Ref: String Functions-Footnote-1497805
+Ref: String Functions-Footnote-2497934
+Ref: String Functions-Footnote-3498182
+Node: Gory Details498269
+Ref: table-sub-escapes499948
+Ref: table-sub-posix-92501302
+Ref: table-sub-proposed502653
+Ref: table-posix-sub504007
+Ref: table-gensub-escapes505552
+Ref: Gory Details-Footnote-1506728
+Ref: Gory Details-Footnote-2506779
+Node: I/O Functions506930
+Ref: I/O Functions-Footnote-1513920
+Node: Time Functions514067
+Ref: Time Functions-Footnote-1525000
+Ref: Time Functions-Footnote-2525068
+Ref: Time Functions-Footnote-3525226
+Ref: Time Functions-Footnote-4525337
+Ref: Time Functions-Footnote-5525449
+Ref: Time Functions-Footnote-6525676
+Node: Bitwise Functions525942
+Ref: table-bitwise-ops526504
+Ref: Bitwise Functions-Footnote-1530725
+Node: Type Functions530909
+Node: I18N Functions532060
+Node: User-defined533687
+Node: Definition Syntax534491
+Ref: Definition Syntax-Footnote-1539405
+Node: Function Example539474
+Ref: Function Example-Footnote-1542123
+Node: Function Caveats542145
+Node: Calling A Function542663
+Node: Variable Scope543618
+Node: Pass By Value/Reference546581
+Node: Return Statement550089
+Node: Dynamic Typing553070
+Node: Indirect Calls554001
+Node: Library Functions563688
+Ref: Library Functions-Footnote-1567201
+Ref: Library Functions-Footnote-2567344
+Node: Library Names567515
+Ref: Library Names-Footnote-1570988
+Ref: Library Names-Footnote-2571208
+Node: General Functions571294
+Node: Strtonum Function572322
+Node: Assert Function575252
+Node: Round Function578578
+Node: Cliff Random Function580119
+Node: Ordinal Functions581135
+Ref: Ordinal Functions-Footnote-1584212
+Ref: Ordinal Functions-Footnote-2584464
+Node: Join Function584675
+Ref: Join Function-Footnote-1586446
+Node: Getlocaltime Function586646
+Node: Readfile Function590387
+Node: Data File Management592226
+Node: Filetrans Function592858
+Node: Rewind Function596927
+Node: File Checking598314
+Node: Empty Files599408
+Node: Ignoring Assigns601638
+Node: Getopt Function603192
+Ref: Getopt Function-Footnote-1614495
+Node: Passwd Functions614698
+Ref: Passwd Functions-Footnote-1623676
+Node: Group Functions623764
+Node: Walking Arrays631848
+Node: Sample Programs633984
+Node: Running Examples634658
+Node: Clones635386
+Node: Cut Program636610
+Node: Egrep Program646461
+Ref: Egrep Program-Footnote-1654234
+Node: Id Program654344
+Node: Split Program657960
+Ref: Split Program-Footnote-1661479
+Node: Tee Program661607
+Node: Uniq Program664410
+Node: Wc Program671839
+Ref: Wc Program-Footnote-1676105
+Ref: Wc Program-Footnote-2676305
+Node: Miscellaneous Programs676397
+Node: Dupword Program677585
+Node: Alarm Program679616
+Node: Translate Program684423
+Ref: Translate Program-Footnote-1688810
+Ref: Translate Program-Footnote-2689058
+Node: Labels Program689192
+Ref: Labels Program-Footnote-1692563
+Node: Word Sorting692647
+Node: History Sorting696531
+Node: Extract Program698370
+Ref: Extract Program-Footnote-1705873
+Node: Simple Sed706001
+Node: Igawk Program709063
+Ref: Igawk Program-Footnote-1724220
+Ref: Igawk Program-Footnote-2724421
+Node: Anagram Program724559
+Node: Signature Program727627
+Node: Advanced Features728727
+Node: Nondecimal Data730613
+Node: Array Sorting732196
+Node: Controlling Array Traversal732893
+Node: Array Sorting Functions741177
+Ref: Array Sorting Functions-Footnote-1745046
+Node: Two-way I/O745240
+Ref: Two-way I/O-Footnote-1750672
+Node: TCP/IP Networking750754
+Node: Profiling753598
+Node: Internationalization761101
+Node: I18N and L10N762526
+Node: Explaining gettext763212
+Ref: Explaining gettext-Footnote-1768280
+Ref: Explaining gettext-Footnote-2768464
+Node: Programmer i18n768629
+Node: Translator i18n772831
+Node: String Extraction773625
+Ref: String Extraction-Footnote-1774586
+Node: Printf Ordering774672
+Ref: Printf Ordering-Footnote-1777454
+Node: I18N Portability777518
+Ref: I18N Portability-Footnote-1779967
+Node: I18N Example780030
+Ref: I18N Example-Footnote-1782668
+Node: Gawk I18N782740
+Node: Debugger783361
+Node: Debugging784332
+Node: Debugging Concepts784765
+Node: Debugging Terms786621
+Node: Awk Debugging789218
+Node: Sample Debugging Session790110
+Node: Debugger Invocation790630
+Node: Finding The Bug791963
+Node: List of Debugger Commands798450
+Node: Breakpoint Control799784
+Node: Debugger Execution Control803448
+Node: Viewing And Changing Data806808
+Node: Execution Stack810164
+Node: Debugger Info811631
+Node: Miscellaneous Debugger Commands815613
+Node: Readline Support820789
+Node: Limitations821620
+Node: Arbitrary Precision Arithmetic823872
+Ref: Arbitrary Precision Arithmetic-Footnote-1825521
+Node: General Arithmetic825669
+Node: Floating Point Issues827389
+Node: String Conversion Precision828270
+Ref: String Conversion Precision-Footnote-1829975
+Node: Unexpected Results830084
+Node: POSIX Floating Point Problems832237
+Ref: POSIX Floating Point Problems-Footnote-1836062
+Node: Integer Programming836100
+Node: Floating-point Programming837839
+Ref: Floating-point Programming-Footnote-1844170
+Ref: Floating-point Programming-Footnote-2844440
+Node: Floating-point Representation844704
+Node: Floating-point Context845869
+Ref: table-ieee-formats846708
+Node: Rounding Mode848092
+Ref: table-rounding-modes848571
+Ref: Rounding Mode-Footnote-1851586
+Node: Gawk and MPFR851765
+Node: Arbitrary Precision Floats853020
+Ref: Arbitrary Precision Floats-Footnote-1855463
+Node: Setting Precision855779
+Ref: table-predefined-precision-strings856465
+Node: Setting Rounding Mode858610
+Ref: table-gawk-rounding-modes859014
+Node: Floating-point Constants860201
+Node: Changing Precision861630
+Ref: Changing Precision-Footnote-1863027
+Node: Exact Arithmetic863201
+Node: Arbitrary Precision Integers866339
+Ref: Arbitrary Precision Integers-Footnote-1869354
+Node: Dynamic Extensions869501
+Node: Extension Intro870959
+Node: Plugin License872224
+Node: Extension Mechanism Outline872909
+Ref: load-extension873326
+Ref: load-new-function874804
+Ref: call-new-function875799
+Node: Extension API Description877814
+Node: Extension API Functions Introduction879101
+Node: General Data Types884028
+Ref: General Data Types-Footnote-1889723
+Node: Requesting Values890022
+Ref: table-value-types-returned890759
+Node: Memory Allocation Functions891713
+Ref: Memory Allocation Functions-Footnote-1894459
+Node: Constructor Functions894555
+Node: Registration Functions896313
+Node: Extension Functions896998
+Node: Exit Callback Functions899300
+Node: Extension Version String900549
+Node: Input Parsers901199
+Node: Output Wrappers910956
+Node: Two-way processors915466
+Node: Printing Messages917674
+Ref: Printing Messages-Footnote-1918751
+Node: Updating `ERRNO'918903
+Node: Accessing Parameters919642
+Node: Symbol Table Access920872
+Node: Symbol table by name921386
+Node: Symbol table by cookie923135
+Ref: Symbol table by cookie-Footnote-1927267
+Node: Cached values927330
+Ref: Cached values-Footnote-1930820
+Node: Array Manipulation930911
+Ref: Array Manipulation-Footnote-1932009
+Node: Array Data Types932048
+Ref: Array Data Types-Footnote-1934751
+Node: Array Functions934843
+Node: Flattening Arrays938679
+Node: Creating Arrays945531
+Node: Extension API Variables950256
+Node: Extension Versioning950892
+Node: Extension API Informational Variables952793
+Node: Extension API Boilerplate953879
+Node: Finding Extensions957683
+Node: Extension Example958243
+Node: Internal File Description958973
+Node: Internal File Ops963064
+Ref: Internal File Ops-Footnote-1974573
+Node: Using Internal File Ops974713
+Ref: Using Internal File Ops-Footnote-1977066
+Node: Extension Samples977332
+Node: Extension Sample File Functions978856
+Node: Extension Sample Fnmatch987341
+Node: Extension Sample Fork989110
+Node: Extension Sample Inplace990323
+Node: Extension Sample Ord992101
+Node: Extension Sample Readdir992937
+Node: Extension Sample Revout994469
+Node: Extension Sample Rev2way995062
+Node: Extension Sample Read write array995752
+Node: Extension Sample Readfile997635
+Node: Extension Sample API Tests998453
+Node: Extension Sample Time998978
+Node: gawkextlib1000342
+Node: Language History1003123
+Node: V7/SVR3.11004716
+Node: SVR41007036
+Node: POSIX1008478
+Node: BTL1009864
+Node: POSIX/GNU1010598
+Node: Feature History1016197
+Node: Common Extensions1029173
+Node: Ranges and Locales1030485
+Ref: Ranges and Locales-Footnote-11035102
+Ref: Ranges and Locales-Footnote-21035129
+Ref: Ranges and Locales-Footnote-31035363
+Node: Contributors1035584
+Node: Installation1040965
+Node: Gawk Distribution1041859
+Node: Getting1042343
+Node: Extracting1043169
+Node: Distribution contents1044861
+Node: Unix Installation1050566
+Node: Quick Installation1051183
+Node: Additional Configuration Options1053629
+Node: Configuration Philosophy1055365
+Node: Non-Unix Installation1057719
+Node: PC Installation1058177
+Node: PC Binary Installation1059476
+Node: PC Compiling1061324
+Node: PC Testing1064268
+Node: PC Using1065444
+Node: Cygwin1069612
+Node: MSYS1070421
+Node: VMS Installation1070935
+Node: VMS Compilation1071699
+Ref: VMS Compilation-Footnote-11072951
+Node: VMS Dynamic Extensions1073009
+Node: VMS Installation Details1074382
+Node: VMS Running1076633
+Node: VMS GNV1079467
+Node: VMS Old Gawk1080190
+Node: Bugs1080660
+Node: Other Versions1084578
+Node: Notes1090662
+Node: Compatibility Mode1091462
+Node: Additions1092245
+Node: Accessing The Source1093172
+Node: Adding Code1094612
+Node: New Ports1100657
+Node: Derived Files1104792
+Ref: Derived Files-Footnote-11110113
+Ref: Derived Files-Footnote-21110147
+Ref: Derived Files-Footnote-31110747
+Node: Future Extensions1110845
+Node: Implementation Limitations1111428
+Node: Extension Design1112680
+Node: Old Extension Problems1113834
+Ref: Old Extension Problems-Footnote-11115342
+Node: Extension New Mechanism Goals1115399
+Ref: Extension New Mechanism Goals-Footnote-11118764
+Node: Extension Other Design Decisions1118950
+Node: Extension Future Growth1121056
+Node: Old Extension Mechanism1121892
+Node: Basic Concepts1123632
+Node: Basic High Level1124313
+Ref: figure-general-flow1124584
+Ref: figure-process-flow1125183
+Ref: Basic High Level-Footnote-11128412
+Node: Basic Data Typing1128597
+Node: Glossary1131952
+Node: Copying1157181
+Node: GNU Free Documentation License1194738
+Node: Index1219875

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index d6844144..30ba377b 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -2555,40 +2555,39 @@ gawk "@{ print \"\042\" $0 \"\042\" @}" @var{file}
@c For gawk >= 4.0, update these data files. No-one has such slow modems!
@cindex input files, examples
-@cindex @code{BBS-list} file
+@cindex @code{mail-list} file
Many of the examples in this @value{DOCUMENT} take their input from two sample
-data files. The first, @file{BBS-list}, represents a list of
-computer bulletin board systems together with information about those systems.
+data files. The first, @file{mail-list}, represents a list of peoples' names
+together with their email addresses and information about those people.
The second data file, called @file{inventory-shipped}, contains
information about monthly shipments. In both files,
each line is considered to be one @dfn{record}.
-In the data file @file{BBS-list}, each record contains the name of a computer
-bulletin board, its phone number, the board's baud rate(s), and a code for
-the number of hours it is operational. An @samp{A} in the last column
-means the board operates 24 hours a day. A @samp{B} in the last
-column means the board only operates on evening and weekend hours.
-A @samp{C} means the board operates only on weekends:
+In the data file @file{mail-list}, each record contains the name of a person,
+his/her phone number, his/her email-address, and a code for their relationship
+with the author of the list. An @samp{A} in the last column
+means that the person is an acquaintance. An @samp{F} in the last
+column means that the person is a friend.
+An @samp{R} means that the person is a relative:
-@c 2e: Update the baud rates to reflect today's faster modems
@example
@c system if test ! -d eg ; then mkdir eg ; fi
@c system if test ! -d eg/lib ; then mkdir eg/lib ; fi
@c system if test ! -d eg/data ; then mkdir eg/data ; fi
@c system if test ! -d eg/prog ; then mkdir eg/prog ; fi
@c system if test ! -d eg/misc ; then mkdir eg/misc ; fi
-@c file eg/data/BBS-list
-aardvark 555-5553 1200/300 B
-alpo-net 555-3412 2400/1200/300 A
-barfly 555-7685 1200/300 A
-bites 555-1675 2400/1200/300 A
-camelot 555-0542 300 C
-core 555-2912 1200/300 C
-fooey 555-1234 2400/1200/300 B
-foot 555-6699 1200/300 B
-macfoo 555-6480 1200/300 A
-sdace 555-3430 2400/1200/300 A
-sabafoo 555-2127 1200/300 C
+@c file eg/data/mail-list
+Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+Anthony 555-3412 anthony.asserturo@@hotmail.com A
+Becky 555-7685 becky.algebrarum@@gmail.com A
+Bill 555-1675 bill.drowning@@hotmail.com A
+Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+Camilla 555-2912 camilla.infusarum@@skynet.be R
+Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+Julie 555-6699 julie.perscrutabor@@skeeve.com F
+Martin 555-6480 martin.codicibus@@hotmail.com A
+Samuel 555-3430 samuel.lanceolis@@shu.edu A
+Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@c endfile
@end example
@@ -2630,23 +2629,23 @@ in the directory @file{awklib/eg/data}.
@section Some Simple Examples
The following command runs a simple @command{awk} program that searches the
-input file @file{BBS-list} for the character string @samp{foo} (a
+input file @file{mail-list} for the character string @samp{li} (a
grouping of characters is usually called a @dfn{string};
the term @dfn{string} is based on similar usage in English, such
as ``a string of pearls,'' or ``a string of cars in a train''):
@example
-awk '/foo/ @{ print $0 @}' BBS-list
+awk '/li/ @{ print $0 @}' mail-list
@end example
@noindent
-When lines containing @samp{foo} are found, they are printed because
+When lines containing @samp{li} are found, they are printed because
@w{@samp{print $0}} means print the current line. (Just @samp{print} by
itself means the same thing, so we could have written that
instead.)
-You will notice that slashes (@samp{/}) surround the string @samp{foo}
-in the @command{awk} program. The slashes indicate that @samp{foo}
+You will notice that slashes (@samp{/}) surround the string @samp{li}
+in the @command{awk} program. The slashes indicate that @samp{li}
is the pattern to search for. This type of pattern is called a
@dfn{regular expression}, which is covered in more detail later
(@pxref{Regexp}).
@@ -2658,11 +2657,11 @@ interpret any of it as special shell characters.
Here is what this program prints:
@example
-$ @kbd{awk '/foo/ @{ print $0 @}' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '/li/ @{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
@end example
@cindex actions, default
@@ -2675,7 +2674,7 @@ action is to print all lines that match the pattern.
@cindex actions, empty
Thus, we could leave out the action (the @code{print} statement and the curly
braces) in the previous example and the result would be the same:
-@command{awk} prints all lines matching the pattern @samp{foo}. By comparison,
+@command{awk} prints all lines matching the pattern @samp{li}. By comparison,
omitting the @code{print} statement but retaining the curly braces makes an
empty action that does nothing (i.e., no lines are printed).
@@ -2820,29 +2819,23 @@ This program prints every line that contains the string
strings, it is printed twice, once by each rule.
This is what happens if we run this program on our two sample data files,
-@file{BBS-list} and @file{inventory-shipped}:
+@file{mail-list} and @file{inventory-shipped}:
@example
$ @kbd{awk '/12/ @{ print $0 @}}
-> @kbd{/21/ @{ print $0 @}' BBS-list inventory-shipped}
-@print{} aardvark 555-5553 1200/300 B
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} barfly 555-7685 1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} core 555-2912 1200/300 C
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sdace 555-3430 2400/1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
-@print{} sabafoo 555-2127 1200/300 C
+> @kbd{/21/ @{ print $0 @}' mail-list inventory-shipped}
+@print{} Anthony 555-3412 anthony.asserturo@@hotmail.com A
+@print{} Camilla 555-2912 camilla.infusarum@@skynet.be R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@print{} Jan 21 36 64 620
@print{} Apr 21 70 74 514
@end example
@noindent
-Note how the line beginning with @samp{sabafoo}
-in @file{BBS-list} was printed twice, once for each rule.
+Note how the line beginning with @samp{Jean-Paul}
+in @file{mail-list} was printed twice, once for each rule.
@node More Complex
@section A More Complex Example
@@ -2921,7 +2914,7 @@ separate rule, like this:
@example
awk '/12/ @{ print $0 @}
- /21/ @{ print $0 @}' BBS-list inventory-shipped
+ /21/ @{ print $0 @}' mail-list inventory-shipped
@end example
@cindex @command{gawk}, newlines in
@@ -4331,14 +4324,14 @@ slashes. Then the regular expression is tested against the
entire text of each record. (Normally, it only needs
to match some part of the text in order to succeed.) For example, the
following prints the second field of each record that contains the string
-@samp{foo} anywhere in it:
+@samp{li} anywhere in it:
@example
-$ @kbd{awk '/foo/ @{ print $2 @}' BBS-list}
-@print{} 555-1234
+$ @kbd{awk '/li/ @{ print $2 @}' mail-list}
+@print{} 555-5553
+@print{} 555-0542
@print{} 555-6699
-@print{} 555-6480
-@print{} 555-2127
+@print{} 555-3430
@end example
@cindex regular expressions, operators
@@ -5647,66 +5640,78 @@ For example:
@cindex @code{BEGIN} pattern
@example
-awk 'BEGIN @{ RS = "/" @}
- @{ print $0 @}' BBS-list
+awk 'BEGIN @{ RS = "u" @}
+ @{ print $0 @}' mail-list
@end example
@noindent
-changes the value of @code{RS} to @code{"/"}, before reading any input.
-This is a string whose first character is a slash; as a result, records
-are separated by slashes. Then the input file is read, and the second
+changes the value of @code{RS} to @samp{u}, before reading any input.
+This is a string whose first character is the letter ``u;'' as a result, records
+are separated by the letter ``u.'' Then the input file is read, and the second
rule in the @command{awk} program (the action with no pattern) prints each
record. Because each @code{print} statement adds a newline at the end of
its output, this @command{awk} program copies the input
-with each slash changed to a newline. Here are the results of running
-the program on @file{BBS-list}:
-
-@example
-$ @kbd{awk 'BEGIN @{ RS = "/" @}}
-> @kbd{@{ print $0 @}' BBS-list}
-@print{} aardvark 555-5553 1200
-@print{} 300 B
-@print{} alpo-net 555-3412 2400
-@print{} 1200
-@print{} 300 A
-@print{} barfly 555-7685 1200
-@print{} 300 A
-@print{} bites 555-1675 2400
-@print{} 1200
-@print{} 300 A
-@print{} camelot 555-0542 300 C
-@print{} core 555-2912 1200
-@print{} 300 C
-@print{} fooey 555-1234 2400
-@print{} 1200
-@print{} 300 B
-@print{} foot 555-6699 1200
-@print{} 300 B
-@print{} macfoo 555-6480 1200
-@print{} 300 A
-@print{} sdace 555-3430 2400
-@print{} 1200
-@print{} 300 A
-@print{} sabafoo 555-2127 1200
-@print{} 300 C
-@print{}
+with each @samp{u} changed to a newline. Here are the results of running
+the program on @file{mail-list}:
+
+@example
+$ @kbd{awk 'BEGIN @{ RS = "u" @}}
+> @kbd{@{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiac
+@print{} sq
+@print{} e@@gmail.com F
+@print{} Anthony 555-3412 anthony.assert
+@print{} ro@@hotmail.com A
+@print{} Becky 555-7685 becky.algebrar
+@print{} m@@gmail.com A
+@print{} Bill 555-1675 bill.drowning@@hotmail.com A
+@print{} Broderick 555-0542 broderick.aliq
+@print{} otiens@@yahoo.com R
+@print{} Camilla 555-2912 camilla.inf
+@print{} sar
+@print{} m@@skynet.be R
+@print{} Fabi
+@print{} s 555-1234 fabi
+@print{} s.
+@print{} ndevicesim
+@print{} s@@
+@print{} cb.ed
+@print{} F
+@print{} J
+@print{} lie 555-6699 j
+@print{} lie.perscr
+@print{} tabor@@skeeve.com F
+@print{} Martin 555-6480 martin.codicib
+@print{} s@@hotmail.com A
+@print{} Sam
+@print{} el 555-3430 sam
+@print{} el.lanceolis@@sh
+@print{} .ed
+@print{} A
+@print{} Jean-Pa
+@print{} l 555-2127 jeanpa
+@print{} l.campanor
+@print{} m@@ny
+@print{} .ed
+@print{} R
+@print{}
@end example
@noindent
-Note that the entry for the @samp{camelot} BBS is not split.
+Note that the entry for the name @samp{Bill} is not split.
In the original data file
(@pxref{Sample Data Files}),
the line looks like this:
@example
-camelot 555-0542 300 C
+Bill 555-1675 bill.drowning@@hotmail.com A
@end example
@noindent
-It has one baud rate only, so there are no slashes in the record,
-unlike the others which have two or more baud rates.
-In fact, this record is treated as part of the record
-for the @samp{core} BBS; the newline separating them in the output
+It contains no @samp{u} so there is no reason to split the record,
+unlike the others which have one or more occurrences of the @samp{u}.
+In fact, this record is treated as part of the previous record;
+the newline separating them in the output
is the original newline in the data file, not the one added by
@command{awk} when it printed the record!
@@ -5717,14 +5722,17 @@ using the variable-assignment feature
(@pxref{Other Arguments}):
@example
-awk '@{ print $0 @}' RS="/" BBS-list
+awk '@{ print $0 @}' RS="u" mail-list
@end example
@noindent
-This sets @code{RS} to @samp{/} before processing @file{BBS-list}.
+This sets @code{RS} to @samp{u} before processing @file{mail-list}.
-Using an unusual character such as @samp{/} for the record separator
-produces correct behavior in the vast majority of cases.
+Using an alphabetic character such as @samp{u} for the record separator
+is highly likely to produce strange results.
+Using an unusual character such as @samp{/} is more likely to
+produce correct behavior in the majority of cases, but there
+are no guarantees. The moral is: Know Your Data.
There is one unusual case, that occurs when @command{gawk} is
being fully POSIX-compliant (@pxref{Options}).
@@ -6011,31 +6019,29 @@ when you are not interested in specific fields.
Here are some more examples:
@example
-$ @kbd{awk '$1 ~ /foo/ @{ print $0 @}' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '$1 ~ /li/ @{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
@end example
@noindent
-This example prints each record in the file @file{BBS-list} whose first
-field contains the string @samp{foo}. The operator @samp{~} is called a
+This example prints each record in the file @file{mail-list} whose first
+field contains the string @samp{li}. The operator @samp{~} is called a
@dfn{matching operator}
(@pxref{Regexp Usage});
it tests whether a string (here, the field @code{$1}) matches a given regular
expression.
By contrast, the following example
-looks for @samp{foo} in @emph{the entire record} and prints the first
+looks for @samp{li} in @emph{the entire record} and prints the first
field and the last field for each matching input record:
@example
-$ @kbd{awk '/foo/ @{ print $1, $NF @}' BBS-list}
-@print{} fooey B
-@print{} foot B
-@print{} macfoo A
-@print{} sabafoo C
+$ @kbd{awk '/li/ @{ print $1, $NF @}' mail-list}
+@print{} Amelia F
+@print{} Broderick R
+@print{} Julie F
+@print{} Samuel A
@end example
@c ENDOFRANGE fiex
@@ -6063,7 +6069,7 @@ the record has fewer than 20 fields, so this prints a blank line.
Here is another example of using expressions as field numbers:
@example
-awk '@{ print $(2*2) @}' BBS-list
+awk '@{ print $(2*2) @}' mail-list
@end example
@command{awk} evaluates the expression @samp{(2*2)} and uses
@@ -6072,8 +6078,8 @@ represents multiplication, so the expression @samp{2*2} evaluates to four.
The parentheses are used so that the multiplication is done before the
@samp{$} operation; they are necessary whenever there is a binary
operator in the field-number expression. This example, then, prints the
-hours of operation (the fourth field) for every line of the file
-@file{BBS-list}. (All of the @command{awk} operators are listed, in
+type of relationship (the fourth field) for every line of the file
+@file{mail-list}. (All of the @command{awk} operators are listed, in
order of decreasing precedence, in
@ref{Precedence}.)
@@ -6635,66 +6641,59 @@ figures that you really want your fields to be separated with TABs and
not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line
if you really do want to separate your fields with @samp{t}s.
-As an example, let's use an @command{awk} program file called @file{baud.awk}
-that contains the pattern @code{/300/} and the action @samp{print $1}:
+As an example, let's use an @command{awk} program file called @file{edu.awk}
+that contains the pattern @code{/edu/} and the action @samp{print $1}:
@example
-/300/ @{ print $1 @}
+/edu/ @{ print $1 @}
@end example
Let's also set @code{FS} to be the @samp{-} character and run the
-program on the file @file{BBS-list}. The following command prints a
-list of the names of the bulletin boards that operate at 300 baud and
+program on the file @file{mail-list}. The following command prints a
+list of the names of the people that work at or attend a university, and
the first three digits of their phone numbers:
@c tweaked to make the tex output look better in @smallbook
@example
-$ @kbd{awk -F- -f baud.awk BBS-list}
-@print{} aardvark 555
-@print{} alpo
-@print{} barfly 555
-@print{} bites 555
-@print{} camelot 555
-@print{} core 555
-@print{} fooey 555
-@print{} foot 555
-@print{} macfoo 555
-@print{} sdace 555
-@print{} sabafoo 555
+$ @kbd{awk -F- -f edu.awk mail-list}
+@print{} Fabius 555
+@print{} Samuel 555
+@print{} Jean
@end example
@noindent
-Note the second line of output. The second line
+Note the third line of output. The third line
in the original file looked like this:
@example
-alpo-net 555-3412 2400/1200/300 A
+Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
-The @samp{-} as part of the system's name was used as the field
+The @samp{-} as part of the person's name was used as the field
separator, instead of the @samp{-} in the phone number that was
originally intended. This demonstrates why you have to be careful in
choosing your field and record separators.
@cindex Unix @command{awk}, password files@comma{} field separators and
-Perhaps the most common use of a single character as the field
-separator occurs when processing the Unix system password file.
-On many Unix systems, each user has a separate entry in the system password
-file, one line per user. The information in these lines is separated
-by colons. The first field is the user's login name and the second is
-the user's (encrypted or shadow) password. A password file entry might look
-like this:
+Perhaps the most common use of a single character as the field separator
+occurs when processing the Unix system password file. On many Unix
+systems, each user has a separate entry in the system password file, one
+line per user. The information in these lines is separated by colons.
+The first field is the user's login name and the second is the user's
+encrypted or shadow password. (A shadow password is indicated by the
+presence of a single @samp{x} in the second field.) A password file
+entry might look like this:
@cindex Robbins, Arnold
@example
-arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/bash
+arnold:x:2076:10:Arnold Robbins:/home/arnold:/bin/bash
@end example
The following program searches the system password file and prints
-the entries for users who have no password:
+the entries for users whose full name is not indicated:
@example
-awk -F: '$2 == ""' /etc/passwd
+awk -F: '$5 == ""' /etc/passwd
@end example
@node Full Line Fields
@@ -8265,13 +8264,29 @@ program by using a new value of @code{OFS}.
@example
$ @kbd{awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @}}
-> @kbd{@{ print $1, $2 @}' BBS-list}
-@print{} aardvark;555-5553
-@print{}
-@print{} alpo-net;555-3412
-@print{}
-@print{} barfly;555-7685
-@dots{}
+> @kbd{@{ print $1, $2 @}' mail-list}
+@print{} Amelia;555-5553
+@print{}
+@print{} Anthony;555-3412
+@print{}
+@print{} Becky;555-7685
+@print{}
+@print{} Bill;555-1675
+@print{}
+@print{} Broderick;555-0542
+@print{}
+@print{} Camilla;555-2912
+@print{}
+@print{} Fabius;555-1234
+@print{}
+@print{} Julie;555-6699
+@print{}
+@print{} Martin;555-6480
+@print{}
+@print{} Samuel;555-3430
+@print{}
+@print{} Jean-Paul;555-2127
+@print{}
@end example
If the value of @code{ORS} does not contain a newline, the program's output
@@ -8745,30 +8760,30 @@ The following simple example shows
how to use @code{printf} to make an aligned table:
@example
-awk '@{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
@noindent
This command
-prints the names of the bulletin boards (@code{$1}) in the file
-@file{BBS-list} as a string of 10 characters that are left-justified. It also
+prints the names of the people (@code{$1}) in the file
+@file{mail-list} as a string of 10 characters that are left-justified. It also
prints the phone numbers (@code{$2}) next on the line. This
produces an aligned two-column table of names and phone numbers,
as shown here:
@example
-$ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' BBS-list}
-@print{} aardvark 555-5553
-@print{} alpo-net 555-3412
-@print{} barfly 555-7685
-@print{} bites 555-1675
-@print{} camelot 555-0542
-@print{} core 555-2912
-@print{} fooey 555-1234
-@print{} foot 555-6699
-@print{} macfoo 555-6480
-@print{} sdace 555-3430
-@print{} sabafoo 555-2127
+$ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list}
+@print{} Amelia 555-5553
+@print{} Anthony 555-3412
+@print{} Becky 555-7685
+@print{} Bill 555-1675
+@print{} Broderick 555-0542
+@print{} Camilla 555-2912
+@print{} Fabius 555-1234
+@print{} Julie 555-6699
+@print{} Martin 555-6480
+@print{} Samuel 555-3430
+@print{} Jean-Paul 555-2127
@end example
In this case, the phone numbers had to be printed as strings because
@@ -8789,7 +8804,7 @@ the @command{awk} program:
@example
awk 'BEGIN @{ print "Name Number"
print "---- ------" @}
- @{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+ @{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
The above example mixes @code{print} and @code{printf} statements in
@@ -8799,7 +8814,7 @@ same results:
@example
awk 'BEGIN @{ printf "%-10s %s\n", "Name", "Number"
printf "%-10s %s\n", "----", "------" @}
- @{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+ @{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
@noindent
@@ -8814,7 +8829,7 @@ emphasized by storing it in a variable, like this:
awk 'BEGIN @{ format = "%-10s %s\n"
printf format, "Name", "Number"
printf format, "----", "------" @}
- @{ printf format, $1, $2 @}' BBS-list
+ @{ printf format, $1, $2 @}' mail-list
@end example
@c !!! exercise
@@ -8871,20 +8886,20 @@ before the first output is written to it. Subsequent writes to the same
@var{output-file} do not erase @var{output-file}, but append to it.
(This is different from how you use redirections in shell scripts.)
If @var{output-file} does not exist, it is created. For example, here
-is how an @command{awk} program can write a list of BBS names to one
+is how an @command{awk} program can write a list of peoples' names to one
file named @file{name-list}, and a list of phone numbers to another file
named @file{phone-list}:
@example
$ @kbd{awk '@{ print $2 > "phone-list"}
-> @kbd{print $1 > "name-list" @}' BBS-list}
+> @kbd{print $1 > "name-list" @}' mail-list}
$ @kbd{cat phone-list}
@print{} 555-5553
@print{} 555-3412
@dots{}
$ @kbd{cat name-list}
-@print{} aardvark
-@print{} alpo-net
+@print{} Amelia
+@print{} Anthony
@dots{}
@end example
@@ -8913,7 +8928,7 @@ to another process created to execute @var{command}.
The redirection argument @var{command} is actually an @command{awk}
expression. Its value is converted to a string whose contents give
the shell command to be run. For example, the following produces two
-files, one unsorted list of BBS names, and one list sorted in reverse
+files, one unsorted list of peoples' names, and one list sorted in reverse
alphabetical order:
@ignore
@@ -8926,7 +8941,7 @@ alone for now and let's hope no-one notices.
@example
awk '@{ print $1 > "names.unsorted"
command = "sort -r > names.sorted"
- print $1 | command @}' BBS-list
+ print $1 | command @}' mail-list
@end example
The unsorted list is written with an ordinary redirection, while
@@ -9997,7 +10012,7 @@ its position among the input file arguments---after the processing of the
preceding input file argument. For example:
@example
-awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list
+awk '@{ print $n @}' n=4 inventory-shipped n=2 mail-list
@end example
@noindent
@@ -10006,10 +10021,10 @@ the first file is read, the command line sets the variable @code{n}
equal to four. This causes the fourth field to be printed in lines from
@file{inventory-shipped}. After the first file has finished,
but before the second file is started, @code{n} is set to two, so that the
-second field is printed in lines from @file{BBS-list}:
+second field is printed in lines from @file{mail-list}:
@example
-$ @kbd{awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list}
+$ @kbd{awk '@{ print $n @}' n=4 inventory-shipped n=2 mail-list}
@print{} 15
@print{} 24
@dots{}
@@ -10332,9 +10347,9 @@ specific operator to represent it. Instead, concatenation is performed by
writing expressions next to one another, with no operator. For example:
@example
-$ @kbd{awk '@{ print "Field number one: " $1 @}' BBS-list}
-@print{} Field number one: aardvark
-@print{} Field number one: alpo-net
+$ @kbd{awk '@{ print "Field number one: " $1 @}' mail-list}
+@print{} Field number one: Amelia
+@print{} Field number one: Anthony
@dots{}
@end example
@@ -10342,9 +10357,9 @@ Without the space in the string constant after the @samp{:}, the line
runs together. For example:
@example
-$ @kbd{awk '@{ print "Field number one:" $1 @}' BBS-list}
-@print{} Field number one:aardvark
-@print{} Field number one:alpo-net
+$ @kbd{awk '@{ print "Field number one:" $1 @}' mail-list}
+@print{} Field number one:Amelia
+@print{} Field number one:Anthony
@dots{}
@end example
@@ -11419,10 +11434,10 @@ The Boolean operators are:
@item @var{boolean1} && @var{boolean2}
True if both @var{boolean1} and @var{boolean2} are true. For example,
the following statement prints the current input record if it contains
-both @samp{2400} and @samp{foo}:
+both @samp{edu} and @samp{li}:
@example
-if ($0 ~ /2400/ && $0 ~ /foo/) print
+if ($0 ~ /edu/ && $0 ~ /li/) print
@end example
@cindex side effects, Boolean operators
@@ -11435,11 +11450,11 @@ no substring @samp{foo} in the record.
@item @var{boolean1} || @var{boolean2}
True if at least one of @var{boolean1} or @var{boolean2} is true.
For example, the following statement prints all records in the input
-that contain @emph{either} @samp{2400} or
-@samp{foo} or both:
+that contain @emph{either} @samp{edu} or
+@samp{li} or both:
@example
-if ($0 ~ /2400/ || $0 ~ /foo/) print
+if ($0 ~ /edu/ || $0 ~ /li/) print
@end example
The subexpression @var{boolean2} is evaluated only if @var{boolean1}
@@ -12034,7 +12049,7 @@ slashes (@code{/@var{regexp}/}), or any expression whose string value
is used as a dynamic regular expression
(@pxref{Computed Regexps}).
The following example prints the second field of each input record
-whose first field is precisely @samp{foo}:
+whose first field is precisely @samp{li}:
@cindex @code{/} (forward slash), patterns and
@cindex forward slash (@code{/}), patterns and
@@ -12043,68 +12058,65 @@ whose first field is precisely @samp{foo}:
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
@example
-$ @kbd{awk '$1 == "foo" @{ print $2 @}' BBS-list}
+$ @kbd{awk '$1 == "li" @{ print $2 @}' mail-list}
@end example
@noindent
-(There is no output, because there is no BBS site with the exact name @samp{foo}.)
+(There is no output, because there is no person with the exact name @samp{li}.)
Contrast this with the following regular expression match, which
-accepts any record with a first field that contains @samp{foo}:
+accepts any record with a first field that contains @samp{li}:
@example
-$ @kbd{awk '$1 ~ /foo/ @{ print $2 @}' BBS-list}
-@print{} 555-1234
+$ @kbd{awk '$1 ~ /foo/ @{ print $2 @}' mail-list}
+@print{} 555-5553
@print{} 555-6699
-@print{} 555-6480
-@print{} 555-2127
@end example
@cindex regexp constants, as patterns
@cindex patterns, regexp constants as
A regexp constant as a pattern is also a special case of an expression
-pattern. The expression @code{/foo/} has the value one if @samp{foo}
-appears in the current input record. Thus, as a pattern, @code{/foo/}
-matches any record containing @samp{foo}.
+pattern. The expression @code{/li/} has the value one if @samp{li}
+appears in the current input record. Thus, as a pattern, @code{/li/}
+matches any record containing @samp{li}.
@cindex Boolean expressions, as patterns
Boolean expressions are also commonly used as patterns.
Whether the pattern
matches an input record depends on whether its subexpressions match.
For example, the following command prints all the records in
-@file{BBS-list} that contain both @samp{2400} and @samp{foo}:
+@file{mail-list} that contain both @samp{edu} and @samp{li}:
@example
-$ @kbd{awk '/2400/ && /foo/' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
+$ @kbd{awk '/edu/ && /li/' mail-list}
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
@end example
The following command prints all records in
-@file{BBS-list} that contain @emph{either} @samp{2400} or @samp{foo}
+@file{mail-list} that contain @emph{either} @samp{edu} or @samp{li}
(or both, of course):
@example
-$ @kbd{awk '/2400/ || /foo/' BBS-list}
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sdace 555-3430 2400/1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '/edu/ || /li/' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
The following command prints all records in
-@file{BBS-list} that do @emph{not} contain the string @samp{foo}:
+@file{mail-list} that do @emph{not} contain the string @samp{li}:
@example
-$ @kbd{awk '! /foo/' BBS-list}
-@print{} aardvark 555-5553 1200/300 B
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} barfly 555-7685 1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} camelot 555-0542 300 C
-@print{} core 555-2912 1200/300 C
-@print{} sdace 555-3430 2400/1200/300 A
+$ @kbd{awk '! /li/' mail-list}
+@print{} Anthony 555-3412 anthony.asserturo@@hotmail.com A
+@print{} Becky 555-7685 becky.algebrarum@@gmail.com A
+@print{} Bill 555-1675 bill.drowning@@hotmail.com A
+@print{} Camilla 555-2912 camilla.infusarum@@skynet.be R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Martin 555-6480 martin.codicibus@@hotmail.com A
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
@cindex @code{BEGIN} pattern, Boolean patterns and
@@ -12243,22 +12255,22 @@ input is read. For example:
@example
$ @kbd{awk '}
-> @kbd{BEGIN @{ print "Analysis of \"foo\"" @}}
-> @kbd{/foo/ @{ ++n @}}
-> @kbd{END @{ print "\"foo\" appears", n, "times." @}' BBS-list}
-@print{} Analysis of "foo"
-@print{} "foo" appears 4 times.
+> @kbd{BEGIN @{ print "Analysis of \"li\"" @}}
+> @kbd{/li/ @{ ++n @}}
+> @kbd{END @{ print "\"li\" appears in", n, "records." @}' mail-list}
+@print{} Analysis of "li"
+@print{} "li" appears in 4 records.
@end example
@cindex @code{BEGIN} pattern, operators and
@cindex @code{END} pattern, operators and
-This program finds the number of records in the input file @file{BBS-list}
-that contain the string @samp{foo}. The @code{BEGIN} rule prints a title
+This program finds the number of records in the input file @file{mail-list}
+that contain the string @samp{li}. The @code{BEGIN} rule prints a title
for the report. There is no need to use the @code{BEGIN} rule to
initialize the counter @code{n} to zero, since @command{awk} does this
automatically (@pxref{Variables}).
The second rule increments the variable @code{n} every time a
-record containing the pattern @samp{foo} is read. The @code{END} rule
+record containing the pattern @samp{li} is read. The @code{END} rule
prints the value of @code{n} at the end of the run.
The special patterns @code{BEGIN} and @code{END} cannot be used in ranges
@@ -12422,7 +12434,7 @@ both @code{BEGINFILE} and @code{ENDFILE}. Only the @samp{getline
In most other @command{awk} implementations, or if @command{gawk} is in
compatibility mode (@pxref{Options}), they are not special.
-@c FIXME: For 4.1 maybe deal with this?
+@c FIXME: For 4.2 maybe deal with this?
@ignore
Date: Tue, 17 May 2011 02:06:10 PDT
From: rankin@pactechdata.com (Pat Rankin)
@@ -12453,7 +12465,7 @@ An empty (i.e., nonexistent) pattern is considered to match @emph{every}
input record. For example, the program:
@example
-awk '@{ print $1 @}' BBS-list
+awk '@{ print $1 @}' mail-list
@end example
@noindent
@@ -13655,16 +13667,16 @@ In the following example:
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
-> @kbd{@}' inventory-shipped BBS-list}
+> @kbd{@}' inventory-shipped mail-list}
@print{} awk
@print{} inventory-shipped
-@print{} BBS-list
+@print{} mail-list
@end example
@noindent
@code{ARGV[0]} contains @samp{awk}, @code{ARGV[1]}
contains @samp{inventory-shipped}, and @code{ARGV[2]} contains
-@samp{BBS-list}. The value of @code{ARGC} is three, one more than the
+@samp{mail-list}. The value of @code{ARGC} is three, one more than the
index of the last element in @code{ARGV}, because the elements are numbered
from zero.
@@ -14131,16 +14143,16 @@ and @code{ARGV}:
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
-> @kbd{@}' inventory-shipped BBS-list}
+> @kbd{@}' inventory-shipped mail-list}
@print{} awk
@print{} inventory-shipped
-@print{} BBS-list
+@print{} mail-list
@end example
@noindent
In this example, @code{ARGV[0]} contains @samp{awk}, @code{ARGV[1]}
contains @samp{inventory-shipped}, and @code{ARGV[2]} contains
-@samp{BBS-list}.
+@samp{mail-list}.
Notice that the @command{awk} program is not entered in @code{ARGV}. The
other command-line options, with their arguments, are also not
entered. This includes variable assignments done with the @option{-v}
@@ -34744,6 +34756,11 @@ Arnold Robbins and Andrew Schorr, with notable contributions from
the rest of the development team.
@item
+@cindex Colombo, Antonio
+Antonio Giovanni Colombo rewrote a number of examples in the early
+chapters that were severely dated, for which I am incredibly grateful.
+
+@item
@cindex Robbins, Arnold
Arnold Robbins
has been working on @command{gawk} since 1988, at first
@@ -37484,9 +37501,6 @@ The GNU version of the standard shell
@end ifinfo
See also ``Bourne Shell.''
-@item BBS
-See ``Bulletin Board System.''
-
@item Bit
Short for ``Binary Digit.''
All values in computer memory ultimately reduce to binary digits: values
@@ -37561,11 +37575,6 @@ Changing some of them affects @command{awk}'s running environment.
@item Braces
See ``Curly Braces.''
-@item Bulletin Board System
-A computer system allowing users to log in and read and/or leave messages
-for other users of the system, much like leaving paper notes on a bulletin
-board.
-
@item C
The system programming language that most GNU software is written in. The
@command{awk} programming language has C-like syntax, and this @value{DOCUMENT}
@@ -39531,8 +39540,6 @@ Suggestions:
% Next edition:
% 1. Standardize the error messages from the functions and programs
% in the two sample code chapters.
-% 2. Nuke the BBS stuff and use something that won't be obsolete
-% 3. Turn the advanced notes into sidebars by using @cartouche
Better sidebars can almost sort of be done with:
@@ -39564,4 +39571,3 @@ But to use it you have to say
}
which sorta sucks.
-
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 1fe75843..9a5c0168 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -2483,40 +2483,39 @@ gawk "@{ print \"\042\" $0 \"\042\" @}" @var{file}
@c For gawk >= 4.0, update these data files. No-one has such slow modems!
@cindex input files, examples
-@cindex @code{BBS-list} file
+@cindex @code{mail-list} file
Many of the examples in this @value{DOCUMENT} take their input from two sample
-data files. The first, @file{BBS-list}, represents a list of
-computer bulletin board systems together with information about those systems.
+data files. The first, @file{mail-list}, represents a list of peoples' names
+together with their email addresses and information about those people.
The second data file, called @file{inventory-shipped}, contains
information about monthly shipments. In both files,
each line is considered to be one @dfn{record}.
-In the data file @file{BBS-list}, each record contains the name of a computer
-bulletin board, its phone number, the board's baud rate(s), and a code for
-the number of hours it is operational. An @samp{A} in the last column
-means the board operates 24 hours a day. A @samp{B} in the last
-column means the board only operates on evening and weekend hours.
-A @samp{C} means the board operates only on weekends:
+In the data file @file{mail-list}, each record contains the name of a person,
+his/her phone number, his/her email-address, and a code for their relationship
+with the author of the list. An @samp{A} in the last column
+means that the person is an acquaintance. An @samp{F} in the last
+column means that the person is a friend.
+An @samp{R} means that the person is a relative:
-@c 2e: Update the baud rates to reflect today's faster modems
@example
@c system if test ! -d eg ; then mkdir eg ; fi
@c system if test ! -d eg/lib ; then mkdir eg/lib ; fi
@c system if test ! -d eg/data ; then mkdir eg/data ; fi
@c system if test ! -d eg/prog ; then mkdir eg/prog ; fi
@c system if test ! -d eg/misc ; then mkdir eg/misc ; fi
-@c file eg/data/BBS-list
-aardvark 555-5553 1200/300 B
-alpo-net 555-3412 2400/1200/300 A
-barfly 555-7685 1200/300 A
-bites 555-1675 2400/1200/300 A
-camelot 555-0542 300 C
-core 555-2912 1200/300 C
-fooey 555-1234 2400/1200/300 B
-foot 555-6699 1200/300 B
-macfoo 555-6480 1200/300 A
-sdace 555-3430 2400/1200/300 A
-sabafoo 555-2127 1200/300 C
+@c file eg/data/mail-list
+Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+Anthony 555-3412 anthony.asserturo@@hotmail.com A
+Becky 555-7685 becky.algebrarum@@gmail.com A
+Bill 555-1675 bill.drowning@@hotmail.com A
+Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+Camilla 555-2912 camilla.infusarum@@skynet.be R
+Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+Julie 555-6699 julie.perscrutabor@@skeeve.com F
+Martin 555-6480 martin.codicibus@@hotmail.com A
+Samuel 555-3430 samuel.lanceolis@@shu.edu A
+Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@c endfile
@end example
@@ -2558,23 +2557,23 @@ in the directory @file{awklib/eg/data}.
@section Some Simple Examples
The following command runs a simple @command{awk} program that searches the
-input file @file{BBS-list} for the character string @samp{foo} (a
+input file @file{mail-list} for the character string @samp{li} (a
grouping of characters is usually called a @dfn{string};
the term @dfn{string} is based on similar usage in English, such
as ``a string of pearls,'' or ``a string of cars in a train''):
@example
-awk '/foo/ @{ print $0 @}' BBS-list
+awk '/li/ @{ print $0 @}' mail-list
@end example
@noindent
-When lines containing @samp{foo} are found, they are printed because
+When lines containing @samp{li} are found, they are printed because
@w{@samp{print $0}} means print the current line. (Just @samp{print} by
itself means the same thing, so we could have written that
instead.)
-You will notice that slashes (@samp{/}) surround the string @samp{foo}
-in the @command{awk} program. The slashes indicate that @samp{foo}
+You will notice that slashes (@samp{/}) surround the string @samp{li}
+in the @command{awk} program. The slashes indicate that @samp{li}
is the pattern to search for. This type of pattern is called a
@dfn{regular expression}, which is covered in more detail later
(@pxref{Regexp}).
@@ -2586,11 +2585,11 @@ interpret any of it as special shell characters.
Here is what this program prints:
@example
-$ @kbd{awk '/foo/ @{ print $0 @}' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '/li/ @{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
@end example
@cindex actions, default
@@ -2603,7 +2602,7 @@ action is to print all lines that match the pattern.
@cindex actions, empty
Thus, we could leave out the action (the @code{print} statement and the curly
braces) in the previous example and the result would be the same:
-@command{awk} prints all lines matching the pattern @samp{foo}. By comparison,
+@command{awk} prints all lines matching the pattern @samp{li}. By comparison,
omitting the @code{print} statement but retaining the curly braces makes an
empty action that does nothing (i.e., no lines are printed).
@@ -2748,29 +2747,23 @@ This program prints every line that contains the string
strings, it is printed twice, once by each rule.
This is what happens if we run this program on our two sample data files,
-@file{BBS-list} and @file{inventory-shipped}:
+@file{mail-list} and @file{inventory-shipped}:
@example
$ @kbd{awk '/12/ @{ print $0 @}}
-> @kbd{/21/ @{ print $0 @}' BBS-list inventory-shipped}
-@print{} aardvark 555-5553 1200/300 B
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} barfly 555-7685 1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} core 555-2912 1200/300 C
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sdace 555-3430 2400/1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
-@print{} sabafoo 555-2127 1200/300 C
+> @kbd{/21/ @{ print $0 @}' mail-list inventory-shipped}
+@print{} Anthony 555-3412 anthony.asserturo@@hotmail.com A
+@print{} Camilla 555-2912 camilla.infusarum@@skynet.be R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@print{} Jan 21 36 64 620
@print{} Apr 21 70 74 514
@end example
@noindent
-Note how the line beginning with @samp{sabafoo}
-in @file{BBS-list} was printed twice, once for each rule.
+Note how the line beginning with @samp{Jean-Paul}
+in @file{mail-list} was printed twice, once for each rule.
@node More Complex
@section A More Complex Example
@@ -2849,7 +2842,7 @@ separate rule, like this:
@example
awk '/12/ @{ print $0 @}
- /21/ @{ print $0 @}' BBS-list inventory-shipped
+ /21/ @{ print $0 @}' mail-list inventory-shipped
@end example
@cindex @command{gawk}, newlines in
@@ -4259,14 +4252,14 @@ slashes. Then the regular expression is tested against the
entire text of each record. (Normally, it only needs
to match some part of the text in order to succeed.) For example, the
following prints the second field of each record that contains the string
-@samp{foo} anywhere in it:
+@samp{li} anywhere in it:
@example
-$ @kbd{awk '/foo/ @{ print $2 @}' BBS-list}
-@print{} 555-1234
+$ @kbd{awk '/li/ @{ print $2 @}' mail-list}
+@print{} 555-5553
+@print{} 555-0542
@print{} 555-6699
-@print{} 555-6480
-@print{} 555-2127
+@print{} 555-3430
@end example
@cindex regular expressions, operators
@@ -5448,66 +5441,78 @@ For example:
@cindex @code{BEGIN} pattern
@example
-awk 'BEGIN @{ RS = "/" @}
- @{ print $0 @}' BBS-list
+awk 'BEGIN @{ RS = "u" @}
+ @{ print $0 @}' mail-list
@end example
@noindent
-changes the value of @code{RS} to @code{"/"}, before reading any input.
-This is a string whose first character is a slash; as a result, records
-are separated by slashes. Then the input file is read, and the second
+changes the value of @code{RS} to @samp{u}, before reading any input.
+This is a string whose first character is the letter ``u;'' as a result, records
+are separated by the letter ``u.'' Then the input file is read, and the second
rule in the @command{awk} program (the action with no pattern) prints each
record. Because each @code{print} statement adds a newline at the end of
its output, this @command{awk} program copies the input
-with each slash changed to a newline. Here are the results of running
-the program on @file{BBS-list}:
-
-@example
-$ @kbd{awk 'BEGIN @{ RS = "/" @}}
-> @kbd{@{ print $0 @}' BBS-list}
-@print{} aardvark 555-5553 1200
-@print{} 300 B
-@print{} alpo-net 555-3412 2400
-@print{} 1200
-@print{} 300 A
-@print{} barfly 555-7685 1200
-@print{} 300 A
-@print{} bites 555-1675 2400
-@print{} 1200
-@print{} 300 A
-@print{} camelot 555-0542 300 C
-@print{} core 555-2912 1200
-@print{} 300 C
-@print{} fooey 555-1234 2400
-@print{} 1200
-@print{} 300 B
-@print{} foot 555-6699 1200
-@print{} 300 B
-@print{} macfoo 555-6480 1200
-@print{} 300 A
-@print{} sdace 555-3430 2400
-@print{} 1200
-@print{} 300 A
-@print{} sabafoo 555-2127 1200
-@print{} 300 C
-@print{}
+with each @samp{u} changed to a newline. Here are the results of running
+the program on @file{mail-list}:
+
+@example
+$ @kbd{awk 'BEGIN @{ RS = "u" @}}
+> @kbd{@{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiac
+@print{} sq
+@print{} e@@gmail.com F
+@print{} Anthony 555-3412 anthony.assert
+@print{} ro@@hotmail.com A
+@print{} Becky 555-7685 becky.algebrar
+@print{} m@@gmail.com A
+@print{} Bill 555-1675 bill.drowning@@hotmail.com A
+@print{} Broderick 555-0542 broderick.aliq
+@print{} otiens@@yahoo.com R
+@print{} Camilla 555-2912 camilla.inf
+@print{} sar
+@print{} m@@skynet.be R
+@print{} Fabi
+@print{} s 555-1234 fabi
+@print{} s.
+@print{} ndevicesim
+@print{} s@@
+@print{} cb.ed
+@print{} F
+@print{} J
+@print{} lie 555-6699 j
+@print{} lie.perscr
+@print{} tabor@@skeeve.com F
+@print{} Martin 555-6480 martin.codicib
+@print{} s@@hotmail.com A
+@print{} Sam
+@print{} el 555-3430 sam
+@print{} el.lanceolis@@sh
+@print{} .ed
+@print{} A
+@print{} Jean-Pa
+@print{} l 555-2127 jeanpa
+@print{} l.campanor
+@print{} m@@ny
+@print{} .ed
+@print{} R
+@print{}
@end example
@noindent
-Note that the entry for the @samp{camelot} BBS is not split.
+Note that the entry for the name @samp{Bill} is not split.
In the original data file
(@pxref{Sample Data Files}),
the line looks like this:
@example
-camelot 555-0542 300 C
+Bill 555-1675 bill.drowning@@hotmail.com A
@end example
@noindent
-It has one baud rate only, so there are no slashes in the record,
-unlike the others which have two or more baud rates.
-In fact, this record is treated as part of the record
-for the @samp{core} BBS; the newline separating them in the output
+It contains no @samp{u} so there is no reason to split the record,
+unlike the others which have one or more occurrences of the @samp{u}.
+In fact, this record is treated as part of the previous record;
+the newline separating them in the output
is the original newline in the data file, not the one added by
@command{awk} when it printed the record!
@@ -5518,14 +5523,17 @@ using the variable-assignment feature
(@pxref{Other Arguments}):
@example
-awk '@{ print $0 @}' RS="/" BBS-list
+awk '@{ print $0 @}' RS="u" mail-list
@end example
@noindent
-This sets @code{RS} to @samp{/} before processing @file{BBS-list}.
+This sets @code{RS} to @samp{u} before processing @file{mail-list}.
-Using an unusual character such as @samp{/} for the record separator
-produces correct behavior in the vast majority of cases.
+Using an alphabetic character such as @samp{u} for the record separator
+is highly likely to produce strange results.
+Using an unusual character such as @samp{/} is more likely to
+produce correct behavior in the majority of cases, but there
+are no guarantees. The moral is: Know Your Data.
There is one unusual case, that occurs when @command{gawk} is
being fully POSIX-compliant (@pxref{Options}).
@@ -5755,31 +5763,29 @@ when you are not interested in specific fields.
Here are some more examples:
@example
-$ @kbd{awk '$1 ~ /foo/ @{ print $0 @}' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '$1 ~ /li/ @{ print $0 @}' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
@end example
@noindent
-This example prints each record in the file @file{BBS-list} whose first
-field contains the string @samp{foo}. The operator @samp{~} is called a
+This example prints each record in the file @file{mail-list} whose first
+field contains the string @samp{li}. The operator @samp{~} is called a
@dfn{matching operator}
(@pxref{Regexp Usage});
it tests whether a string (here, the field @code{$1}) matches a given regular
expression.
By contrast, the following example
-looks for @samp{foo} in @emph{the entire record} and prints the first
+looks for @samp{li} in @emph{the entire record} and prints the first
field and the last field for each matching input record:
@example
-$ @kbd{awk '/foo/ @{ print $1, $NF @}' BBS-list}
-@print{} fooey B
-@print{} foot B
-@print{} macfoo A
-@print{} sabafoo C
+$ @kbd{awk '/li/ @{ print $1, $NF @}' mail-list}
+@print{} Amelia F
+@print{} Broderick R
+@print{} Julie F
+@print{} Samuel A
@end example
@c ENDOFRANGE fiex
@@ -5807,7 +5813,7 @@ the record has fewer than 20 fields, so this prints a blank line.
Here is another example of using expressions as field numbers:
@example
-awk '@{ print $(2*2) @}' BBS-list
+awk '@{ print $(2*2) @}' mail-list
@end example
@command{awk} evaluates the expression @samp{(2*2)} and uses
@@ -5816,8 +5822,8 @@ represents multiplication, so the expression @samp{2*2} evaluates to four.
The parentheses are used so that the multiplication is done before the
@samp{$} operation; they are necessary whenever there is a binary
operator in the field-number expression. This example, then, prints the
-hours of operation (the fourth field) for every line of the file
-@file{BBS-list}. (All of the @command{awk} operators are listed, in
+type of relationship (the fourth field) for every line of the file
+@file{mail-list}. (All of the @command{awk} operators are listed, in
order of decreasing precedence, in
@ref{Precedence}.)
@@ -6348,66 +6354,59 @@ figures that you really want your fields to be separated with TABs and
not @samp{t}s. Use @samp{-v FS="t"} or @samp{-F"[t]"} on the command line
if you really do want to separate your fields with @samp{t}s.
-As an example, let's use an @command{awk} program file called @file{baud.awk}
-that contains the pattern @code{/300/} and the action @samp{print $1}:
+As an example, let's use an @command{awk} program file called @file{edu.awk}
+that contains the pattern @code{/edu/} and the action @samp{print $1}:
@example
-/300/ @{ print $1 @}
+/edu/ @{ print $1 @}
@end example
Let's also set @code{FS} to be the @samp{-} character and run the
-program on the file @file{BBS-list}. The following command prints a
-list of the names of the bulletin boards that operate at 300 baud and
+program on the file @file{mail-list}. The following command prints a
+list of the names of the people that work at or attend a university, and
the first three digits of their phone numbers:
@c tweaked to make the tex output look better in @smallbook
@example
-$ @kbd{awk -F- -f baud.awk BBS-list}
-@print{} aardvark 555
-@print{} alpo
-@print{} barfly 555
-@print{} bites 555
-@print{} camelot 555
-@print{} core 555
-@print{} fooey 555
-@print{} foot 555
-@print{} macfoo 555
-@print{} sdace 555
-@print{} sabafoo 555
+$ @kbd{awk -F- -f edu.awk mail-list}
+@print{} Fabius 555
+@print{} Samuel 555
+@print{} Jean
@end example
@noindent
-Note the second line of output. The second line
+Note the third line of output. The third line
in the original file looked like this:
@example
-alpo-net 555-3412 2400/1200/300 A
+Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
-The @samp{-} as part of the system's name was used as the field
+The @samp{-} as part of the person's name was used as the field
separator, instead of the @samp{-} in the phone number that was
originally intended. This demonstrates why you have to be careful in
choosing your field and record separators.
@cindex Unix @command{awk}, password files@comma{} field separators and
-Perhaps the most common use of a single character as the field
-separator occurs when processing the Unix system password file.
-On many Unix systems, each user has a separate entry in the system password
-file, one line per user. The information in these lines is separated
-by colons. The first field is the user's login name and the second is
-the user's (encrypted or shadow) password. A password file entry might look
-like this:
+Perhaps the most common use of a single character as the field separator
+occurs when processing the Unix system password file. On many Unix
+systems, each user has a separate entry in the system password file, one
+line per user. The information in these lines is separated by colons.
+The first field is the user's login name and the second is the user's
+encrypted or shadow password. (A shadow password is indicated by the
+presence of a single @samp{x} in the second field.) A password file
+entry might look like this:
@cindex Robbins, Arnold
@example
-arnold:xyzzy:2076:10:Arnold Robbins:/home/arnold:/bin/bash
+arnold:x:2076:10:Arnold Robbins:/home/arnold:/bin/bash
@end example
The following program searches the system password file and prints
-the entries for users who have no password:
+the entries for users whose full name is not indicated:
@example
-awk -F: '$2 == ""' /etc/passwd
+awk -F: '$5 == ""' /etc/passwd
@end example
@node Full Line Fields
@@ -7883,13 +7882,29 @@ program by using a new value of @code{OFS}.
@example
$ @kbd{awk 'BEGIN @{ OFS = ";"; ORS = "\n\n" @}}
-> @kbd{@{ print $1, $2 @}' BBS-list}
-@print{} aardvark;555-5553
-@print{}
-@print{} alpo-net;555-3412
-@print{}
-@print{} barfly;555-7685
-@dots{}
+> @kbd{@{ print $1, $2 @}' mail-list}
+@print{} Amelia;555-5553
+@print{}
+@print{} Anthony;555-3412
+@print{}
+@print{} Becky;555-7685
+@print{}
+@print{} Bill;555-1675
+@print{}
+@print{} Broderick;555-0542
+@print{}
+@print{} Camilla;555-2912
+@print{}
+@print{} Fabius;555-1234
+@print{}
+@print{} Julie;555-6699
+@print{}
+@print{} Martin;555-6480
+@print{}
+@print{} Samuel;555-3430
+@print{}
+@print{} Jean-Paul;555-2127
+@print{}
@end example
If the value of @code{ORS} does not contain a newline, the program's output
@@ -8363,30 +8378,30 @@ The following simple example shows
how to use @code{printf} to make an aligned table:
@example
-awk '@{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
@noindent
This command
-prints the names of the bulletin boards (@code{$1}) in the file
-@file{BBS-list} as a string of 10 characters that are left-justified. It also
+prints the names of the people (@code{$1}) in the file
+@file{mail-list} as a string of 10 characters that are left-justified. It also
prints the phone numbers (@code{$2}) next on the line. This
produces an aligned two-column table of names and phone numbers,
as shown here:
@example
-$ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' BBS-list}
-@print{} aardvark 555-5553
-@print{} alpo-net 555-3412
-@print{} barfly 555-7685
-@print{} bites 555-1675
-@print{} camelot 555-0542
-@print{} core 555-2912
-@print{} fooey 555-1234
-@print{} foot 555-6699
-@print{} macfoo 555-6480
-@print{} sdace 555-3430
-@print{} sabafoo 555-2127
+$ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list}
+@print{} Amelia 555-5553
+@print{} Anthony 555-3412
+@print{} Becky 555-7685
+@print{} Bill 555-1675
+@print{} Broderick 555-0542
+@print{} Camilla 555-2912
+@print{} Fabius 555-1234
+@print{} Julie 555-6699
+@print{} Martin 555-6480
+@print{} Samuel 555-3430
+@print{} Jean-Paul 555-2127
@end example
In this case, the phone numbers had to be printed as strings because
@@ -8407,7 +8422,7 @@ the @command{awk} program:
@example
awk 'BEGIN @{ print "Name Number"
print "---- ------" @}
- @{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+ @{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
The above example mixes @code{print} and @code{printf} statements in
@@ -8417,7 +8432,7 @@ same results:
@example
awk 'BEGIN @{ printf "%-10s %s\n", "Name", "Number"
printf "%-10s %s\n", "----", "------" @}
- @{ printf "%-10s %s\n", $1, $2 @}' BBS-list
+ @{ printf "%-10s %s\n", $1, $2 @}' mail-list
@end example
@noindent
@@ -8432,7 +8447,7 @@ emphasized by storing it in a variable, like this:
awk 'BEGIN @{ format = "%-10s %s\n"
printf format, "Name", "Number"
printf format, "----", "------" @}
- @{ printf format, $1, $2 @}' BBS-list
+ @{ printf format, $1, $2 @}' mail-list
@end example
@c !!! exercise
@@ -8489,20 +8504,20 @@ before the first output is written to it. Subsequent writes to the same
@var{output-file} do not erase @var{output-file}, but append to it.
(This is different from how you use redirections in shell scripts.)
If @var{output-file} does not exist, it is created. For example, here
-is how an @command{awk} program can write a list of BBS names to one
+is how an @command{awk} program can write a list of peoples' names to one
file named @file{name-list}, and a list of phone numbers to another file
named @file{phone-list}:
@example
$ @kbd{awk '@{ print $2 > "phone-list"}
-> @kbd{print $1 > "name-list" @}' BBS-list}
+> @kbd{print $1 > "name-list" @}' mail-list}
$ @kbd{cat phone-list}
@print{} 555-5553
@print{} 555-3412
@dots{}
$ @kbd{cat name-list}
-@print{} aardvark
-@print{} alpo-net
+@print{} Amelia
+@print{} Anthony
@dots{}
@end example
@@ -8531,7 +8546,7 @@ to another process created to execute @var{command}.
The redirection argument @var{command} is actually an @command{awk}
expression. Its value is converted to a string whose contents give
the shell command to be run. For example, the following produces two
-files, one unsorted list of BBS names, and one list sorted in reverse
+files, one unsorted list of peoples' names, and one list sorted in reverse
alphabetical order:
@ignore
@@ -8544,7 +8559,7 @@ alone for now and let's hope no-one notices.
@example
awk '@{ print $1 > "names.unsorted"
command = "sort -r > names.sorted"
- print $1 | command @}' BBS-list
+ print $1 | command @}' mail-list
@end example
The unsorted list is written with an ordinary redirection, while
@@ -9486,7 +9501,7 @@ its position among the input file arguments---after the processing of the
preceding input file argument. For example:
@example
-awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list
+awk '@{ print $n @}' n=4 inventory-shipped n=2 mail-list
@end example
@noindent
@@ -9495,10 +9510,10 @@ the first file is read, the command line sets the variable @code{n}
equal to four. This causes the fourth field to be printed in lines from
@file{inventory-shipped}. After the first file has finished,
but before the second file is started, @code{n} is set to two, so that the
-second field is printed in lines from @file{BBS-list}:
+second field is printed in lines from @file{mail-list}:
@example
-$ @kbd{awk '@{ print $n @}' n=4 inventory-shipped n=2 BBS-list}
+$ @kbd{awk '@{ print $n @}' n=4 inventory-shipped n=2 mail-list}
@print{} 15
@print{} 24
@dots{}
@@ -9821,9 +9836,9 @@ specific operator to represent it. Instead, concatenation is performed by
writing expressions next to one another, with no operator. For example:
@example
-$ @kbd{awk '@{ print "Field number one: " $1 @}' BBS-list}
-@print{} Field number one: aardvark
-@print{} Field number one: alpo-net
+$ @kbd{awk '@{ print "Field number one: " $1 @}' mail-list}
+@print{} Field number one: Amelia
+@print{} Field number one: Anthony
@dots{}
@end example
@@ -9831,9 +9846,9 @@ Without the space in the string constant after the @samp{:}, the line
runs together. For example:
@example
-$ @kbd{awk '@{ print "Field number one:" $1 @}' BBS-list}
-@print{} Field number one:aardvark
-@print{} Field number one:alpo-net
+$ @kbd{awk '@{ print "Field number one:" $1 @}' mail-list}
+@print{} Field number one:Amelia
+@print{} Field number one:Anthony
@dots{}
@end example
@@ -10796,10 +10811,10 @@ The Boolean operators are:
@item @var{boolean1} && @var{boolean2}
True if both @var{boolean1} and @var{boolean2} are true. For example,
the following statement prints the current input record if it contains
-both @samp{2400} and @samp{foo}:
+both @samp{edu} and @samp{li}:
@example
-if ($0 ~ /2400/ && $0 ~ /foo/) print
+if ($0 ~ /edu/ && $0 ~ /li/) print
@end example
@cindex side effects, Boolean operators
@@ -10812,11 +10827,11 @@ no substring @samp{foo} in the record.
@item @var{boolean1} || @var{boolean2}
True if at least one of @var{boolean1} or @var{boolean2} is true.
For example, the following statement prints all records in the input
-that contain @emph{either} @samp{2400} or
-@samp{foo} or both:
+that contain @emph{either} @samp{edu} or
+@samp{li} or both:
@example
-if ($0 ~ /2400/ || $0 ~ /foo/) print
+if ($0 ~ /edu/ || $0 ~ /li/) print
@end example
The subexpression @var{boolean2} is evaluated only if @var{boolean1}
@@ -11411,7 +11426,7 @@ slashes (@code{/@var{regexp}/}), or any expression whose string value
is used as a dynamic regular expression
(@pxref{Computed Regexps}).
The following example prints the second field of each input record
-whose first field is precisely @samp{foo}:
+whose first field is precisely @samp{li}:
@cindex @code{/} (forward slash), patterns and
@cindex forward slash (@code{/}), patterns and
@@ -11420,68 +11435,65 @@ whose first field is precisely @samp{foo}:
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
@example
-$ @kbd{awk '$1 == "foo" @{ print $2 @}' BBS-list}
+$ @kbd{awk '$1 == "li" @{ print $2 @}' mail-list}
@end example
@noindent
-(There is no output, because there is no BBS site with the exact name @samp{foo}.)
+(There is no output, because there is no person with the exact name @samp{li}.)
Contrast this with the following regular expression match, which
-accepts any record with a first field that contains @samp{foo}:
+accepts any record with a first field that contains @samp{li}:
@example
-$ @kbd{awk '$1 ~ /foo/ @{ print $2 @}' BBS-list}
-@print{} 555-1234
+$ @kbd{awk '$1 ~ /foo/ @{ print $2 @}' mail-list}
+@print{} 555-5553
@print{} 555-6699
-@print{} 555-6480
-@print{} 555-2127
@end example
@cindex regexp constants, as patterns
@cindex patterns, regexp constants as
A regexp constant as a pattern is also a special case of an expression
-pattern. The expression @code{/foo/} has the value one if @samp{foo}
-appears in the current input record. Thus, as a pattern, @code{/foo/}
-matches any record containing @samp{foo}.
+pattern. The expression @code{/li/} has the value one if @samp{li}
+appears in the current input record. Thus, as a pattern, @code{/li/}
+matches any record containing @samp{li}.
@cindex Boolean expressions, as patterns
Boolean expressions are also commonly used as patterns.
Whether the pattern
matches an input record depends on whether its subexpressions match.
For example, the following command prints all the records in
-@file{BBS-list} that contain both @samp{2400} and @samp{foo}:
+@file{mail-list} that contain both @samp{edu} and @samp{li}:
@example
-$ @kbd{awk '/2400/ && /foo/' BBS-list}
-@print{} fooey 555-1234 2400/1200/300 B
+$ @kbd{awk '/edu/ && /li/' mail-list}
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
@end example
The following command prints all records in
-@file{BBS-list} that contain @emph{either} @samp{2400} or @samp{foo}
+@file{mail-list} that contain @emph{either} @samp{edu} or @samp{li}
(or both, of course):
@example
-$ @kbd{awk '/2400/ || /foo/' BBS-list}
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} fooey 555-1234 2400/1200/300 B
-@print{} foot 555-6699 1200/300 B
-@print{} macfoo 555-6480 1200/300 A
-@print{} sdace 555-3430 2400/1200/300 A
-@print{} sabafoo 555-2127 1200/300 C
+$ @kbd{awk '/edu/ || /li/' mail-list}
+@print{} Amelia 555-5553 amelia.zodiacusque@@gmail.com F
+@print{} Broderick 555-0542 broderick.aliquotiens@@yahoo.com R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Julie 555-6699 julie.perscrutabor@@skeeve.com F
+@print{} Samuel 555-3430 samuel.lanceolis@@shu.edu A
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
The following command prints all records in
-@file{BBS-list} that do @emph{not} contain the string @samp{foo}:
+@file{mail-list} that do @emph{not} contain the string @samp{li}:
@example
-$ @kbd{awk '! /foo/' BBS-list}
-@print{} aardvark 555-5553 1200/300 B
-@print{} alpo-net 555-3412 2400/1200/300 A
-@print{} barfly 555-7685 1200/300 A
-@print{} bites 555-1675 2400/1200/300 A
-@print{} camelot 555-0542 300 C
-@print{} core 555-2912 1200/300 C
-@print{} sdace 555-3430 2400/1200/300 A
+$ @kbd{awk '! /li/' mail-list}
+@print{} Anthony 555-3412 anthony.asserturo@@hotmail.com A
+@print{} Becky 555-7685 becky.algebrarum@@gmail.com A
+@print{} Bill 555-1675 bill.drowning@@hotmail.com A
+@print{} Camilla 555-2912 camilla.infusarum@@skynet.be R
+@print{} Fabius 555-1234 fabius.undevicesimus@@ucb.edu F
+@print{} Martin 555-6480 martin.codicibus@@hotmail.com A
+@print{} Jean-Paul 555-2127 jeanpaul.campanorum@@nyu.edu R
@end example
@cindex @code{BEGIN} pattern, Boolean patterns and
@@ -11620,22 +11632,22 @@ input is read. For example:
@example
$ @kbd{awk '}
-> @kbd{BEGIN @{ print "Analysis of \"foo\"" @}}
-> @kbd{/foo/ @{ ++n @}}
-> @kbd{END @{ print "\"foo\" appears", n, "times." @}' BBS-list}
-@print{} Analysis of "foo"
-@print{} "foo" appears 4 times.
+> @kbd{BEGIN @{ print "Analysis of \"li\"" @}}
+> @kbd{/li/ @{ ++n @}}
+> @kbd{END @{ print "\"li\" appears in", n, "records." @}' mail-list}
+@print{} Analysis of "li"
+@print{} "li" appears in 4 records.
@end example
@cindex @code{BEGIN} pattern, operators and
@cindex @code{END} pattern, operators and
-This program finds the number of records in the input file @file{BBS-list}
-that contain the string @samp{foo}. The @code{BEGIN} rule prints a title
+This program finds the number of records in the input file @file{mail-list}
+that contain the string @samp{li}. The @code{BEGIN} rule prints a title
for the report. There is no need to use the @code{BEGIN} rule to
initialize the counter @code{n} to zero, since @command{awk} does this
automatically (@pxref{Variables}).
The second rule increments the variable @code{n} every time a
-record containing the pattern @samp{foo} is read. The @code{END} rule
+record containing the pattern @samp{li} is read. The @code{END} rule
prints the value of @code{n} at the end of the run.
The special patterns @code{BEGIN} and @code{END} cannot be used in ranges
@@ -11799,7 +11811,7 @@ both @code{BEGINFILE} and @code{ENDFILE}. Only the @samp{getline
In most other @command{awk} implementations, or if @command{gawk} is in
compatibility mode (@pxref{Options}), they are not special.
-@c FIXME: For 4.1 maybe deal with this?
+@c FIXME: For 4.2 maybe deal with this?
@ignore
Date: Tue, 17 May 2011 02:06:10 PDT
From: rankin@pactechdata.com (Pat Rankin)
@@ -11830,7 +11842,7 @@ An empty (i.e., nonexistent) pattern is considered to match @emph{every}
input record. For example, the program:
@example
-awk '@{ print $1 @}' BBS-list
+awk '@{ print $1 @}' mail-list
@end example
@noindent
@@ -13032,16 +13044,16 @@ In the following example:
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
-> @kbd{@}' inventory-shipped BBS-list}
+> @kbd{@}' inventory-shipped mail-list}
@print{} awk
@print{} inventory-shipped
-@print{} BBS-list
+@print{} mail-list
@end example
@noindent
@code{ARGV[0]} contains @samp{awk}, @code{ARGV[1]}
contains @samp{inventory-shipped}, and @code{ARGV[2]} contains
-@samp{BBS-list}. The value of @code{ARGC} is three, one more than the
+@samp{mail-list}. The value of @code{ARGC} is three, one more than the
index of the last element in @code{ARGV}, because the elements are numbered
from zero.
@@ -13462,16 +13474,16 @@ and @code{ARGV}:
$ @kbd{awk 'BEGIN @{}
> @kbd{for (i = 0; i < ARGC; i++)}
> @kbd{print ARGV[i]}
-> @kbd{@}' inventory-shipped BBS-list}
+> @kbd{@}' inventory-shipped mail-list}
@print{} awk
@print{} inventory-shipped
-@print{} BBS-list
+@print{} mail-list
@end example
@noindent
In this example, @code{ARGV[0]} contains @samp{awk}, @code{ARGV[1]}
contains @samp{inventory-shipped}, and @code{ARGV[2]} contains
-@samp{BBS-list}.
+@samp{mail-list}.
Notice that the @command{awk} program is not entered in @code{ARGV}. The
other command-line options, with their arguments, are also not
entered. This includes variable assignments done with the @option{-v}
@@ -33885,6 +33897,11 @@ Arnold Robbins and Andrew Schorr, with notable contributions from
the rest of the development team.
@item
+@cindex Colombo, Antonio
+Antonio Giovanni Colombo rewrote a number of examples in the early
+chapters that were severely dated, for which I am incredibly grateful.
+
+@item
@cindex Robbins, Arnold
Arnold Robbins
has been working on @command{gawk} since 1988, at first
@@ -36625,9 +36642,6 @@ The GNU version of the standard shell
@end ifinfo
See also ``Bourne Shell.''
-@item BBS
-See ``Bulletin Board System.''
-
@item Bit
Short for ``Binary Digit.''
All values in computer memory ultimately reduce to binary digits: values
@@ -36702,11 +36716,6 @@ Changing some of them affects @command{awk}'s running environment.
@item Braces
See ``Curly Braces.''
-@item Bulletin Board System
-A computer system allowing users to log in and read and/or leave messages
-for other users of the system, much like leaving paper notes on a bulletin
-board.
-
@item C
The system programming language that most GNU software is written in. The
@command{awk} programming language has C-like syntax, and this @value{DOCUMENT}
@@ -38672,8 +38681,6 @@ Suggestions:
% Next edition:
% 1. Standardize the error messages from the functions and programs
% in the two sample code chapters.
-% 2. Nuke the BBS stuff and use something that won't be obsolete
-% 3. Turn the advanced notes into sidebars by using @cartouche
Better sidebars can almost sort of be done with:
@@ -38705,4 +38712,3 @@ But to use it you have to say
}
which sorta sucks.
-