O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators' Precedence

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

~ !~

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required