MPE/iX Shell and Utilities Reference Manual, Vol 1

awk(1) MPE/iX Shell and Utilities awk(1)
Order of Operations
(A) grouping
$i V[a] field, array element
V++ V-- increment, decrement
++V --V
AˆB exponentiation
+A -A !A unary plus, unary minus, logical NOT
A*B A/B A%B multiplication, division, remainder
A+B A-B addition, subtraction
AB string concatenation
A<B A>B A<=B comparisons
A>=B A!=B A==B
A˜B A!˜B regular expression matching
AinV array membership
A&&B logical AND
A||B logical OR
A?B:C conditional expression
V=B V+=B V-=B assignment
V*=B V/=B V%=B
Vˆ=B
A, B and C are any expression.
i is any expression yielding an integer.
V is any variable.
Table 1-2: awk Order of Operations
Command Line Arguments
awk sets the built-in variable ARGC to the number of command line arguments. The built-in
array ARGV has elements subscripted with digits from zero to ARGC-1, giving command line
arguments in the order they appeared on the command line.
The ARGC count and the ARGV vector do not include command line options (beginning with
-) or the program file (following –f). They do include the name of the command itself, the
names of input data files, and initialization statements of the form
var=value
Commands and Utilities 1-23