Go to the first, previous, next, last section, table of contents.


Operators

The operators in awk, in order of decreasing precedence, are:

(...)
Grouping.
$
Field reference.
++ --
Increment and decrement, both prefix and postfix.
^
Exponentiation (`**' may also be used, and `**=' for the assignment operator, but they are not specified in the POSIX standard).
+ - !
Unary plus, unary minus, and logical negation.
* / %
Multiplication, division, and modulus.
+ -
Addition and subtraction.
space
String concatenation.
< <= > >= != ==
The usual relational operators.
~ !~
Regular expression match, negated match.
in
Array membership.
&&
Logical "and".
||
Logical "or".
?:
A conditional expression. This has the form `expr1 ? expr2 : expr3'. If expr1 is true, the value of the expression is expr2; otherwise it is expr3. Only one of expr2 and expr3 is evaluated.
= += -= *= /= %= ^=
Assignment. Both absolute assignment (var=value) and operator assignment (the other forms) are supported.

See section Expressions.


Go to the first, previous, next, last section, table of contents.