It determines how operators are grouped when different operators appear in a single expression. For example, * has higher precedence than +. So, if we have a + b * c ;it means multiply b and c and then add a to the result. Precedence of operators can be overridden by using parentheses.
This is table of AWK's operator precedence order from highest to lowest:
Operator |
Description |
(…) |
Grouping |
$ |
Field reference |
++ or - - |
Increment, decrement |
^ or ** |
Exponentiation |
+, -, ! |
Unary plus, minus, logical not |
*, /, % |
Multiplication, division or remainder |
+, - |
Addition, subtraction |
Space |
String concatenation |
< <= == != > >= >> |
Relational operators |
~ !~ |
Match and no match operator |
in |
Array membership |
&& |
Logical and |
|| |
Logical or |