O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

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

The following table lists the operators, in order of increasing precedence, that are available in awk.

Symbol

Meaning

= += -= *= /= %= ^= **=

Assignment.

?:

C conditional expression.

||

Logical OR (short-circuit).

&&

Logical AND (short-circuit).

in

Array membership.

~ !~

Match regular expression and negation.

< <= > >= != ==

Relational operators.

(blank)

Concatenation.

+ -

Addition, subtraction.

* / %

Multiplication, division, and modulus (remainder).

+ - !

Unary plus and minus, and logical negation.

^ **

Exponentiation.

++ --

Increment and decrement, either prefix or postfix.

$

Field reference.

Tip

While ** and **= are common extensions, they are not part of POSIX awk.

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