Go forward to Variables/Fields.
Go backward to Command Line Summary.
Go up to Gawk Summary.
Language Summary
================
An `awk' program consists of a sequence of pattern-action statements
and optional function definitions.
PATTERN { ACTION STATEMENTS }
function NAME(PARAMETER LIST) { ACTION STATEMENTS }
`gawk' first reads the program source from the PROGRAM-FILE(s) if
specified, or from the first non-option argument on the command line.
The `-f' option may be used multiple times on the command line. `gawk'
reads the program text from all the PROGRAM-FILE files, effectively
concatenating them in the order they are specified. This is useful for
building libraries of `awk' functions, without having to include them
in each new `awk' program that uses them. To use a library function in
a file from a program typed in on the command line, specify `-f
/dev/tty'; then type your program, and end it with a `Control-d'.
See Invoking `awk': Command Line.
The environment variable `AWKPATH' specifies a search path to use
when finding source files named with the `-f' option. The default
path, which is `.:/usr/lib/awk:/usr/local/lib/awk' is used if `AWKPATH'
is not set. If a file name given to the `-f' option contains a `/'
character, no path search is performed. *Note The `AWKPATH'
Environment Variable: AWKPATH Variable, for a full description of the
`AWKPATH' environment variable.
`gawk' compiles the program into an internal form, and then proceeds
to read each file named in the `ARGV' array. If there are no files
named on the command line, `gawk' reads the standard input.
If a "file" named on the command line has the form `VAR=VAL', it is
treated as a variable assignment: the variable VAR is assigned the
value VAL. If any of the files have a value that is the null string,
that element in the list is skipped.
For each line in the input, `gawk' tests to see if it matches any
PATTERN in the `awk' program. For each pattern that the line matches,
the associated ACTION is executed.