operator

The awk programming language provides a series of *operators* that allow [[value?]]s and variables to be compared, evaluated or manipulated. These operators can combined together with [[value?]]s and variables to make [[expression?]]s. The operators may take [[unary?]], [[dyadic?]] or [[ternary?]] form, depending on the number of [[operand?]]s that they utilize.

assignment operator

As within most other programming languages, the '''equals sign''' acts as a [[dyadic?]] operator, assigning the value of the [[expression?]] of the right hand [[operand?]] to the variable named by the left [[operand?]].

arithmetic operators

The awk programming language provides a standard set of arithmetic operators for manipulating [[integer?]] and [[floating_point?]] numbers.

string operators

logical operators

The logical operators are used to perform [[boolean?]] operations, returning either [[true?]] or [[false?]].

nudge operators

number sign operators

comparative operators

regular expression operators

numeric operators

comma operator

redirection operators

relationship operators

reference operators

dereference operators

arrow operator

compound assignment operators

ternary operators

Operators not supported in awk

The awk programming language does not support the following operator types:


precedence

[[bracket?]]s