MPE/iX Shell and Utilities Reference Manual, Vol 1

awk(1) MPE/iX Shell and Utilities awk(1)
Symbol Table
You can access the symbol table through the built-in array SYMTAB.
SYMTAB[expr]
is equivalent to the variable named by the evaluation of expr. For example,
SYMTAB["var"]
is a synonym for the variable var.
Environment
An awk program can determine its initial environment by examining the ENVIRON array. If
the environment consists of entries of the form:
name=value
then
ENVIRON[name]
has string value
"value"
For example, the following program is equivalent to the default output of env(1):
BEGIN {
for (i in ENVIRON)
printf("%s=%s\n", i, ENVIRON[i])
exit
}
Operators
awk follows the usual precedence order of arithmetic operations, unless overridden with
parentheses; a table giving the order of operations appears later in this section.
The unary operators are +, -, ++, and --, where you can use the ++ and -- operators as
either postfix or prefix operators, as in
C. The binary arithmetic operators are +, -, *, /, %, and
ˆ.
The conditional operator
expr ? expr1 : expr2
evaluates to the expr1 if the value of expr is non-zero, and to expr2 otherwise.
Commands and Utilities 1-21