Relational expressions

Relational expressions are built using relational operators, also known as conditional or comparison operators. These operators are used to test conditions, like if or while. Relational expressions compare strings or numbers for relationships such as equality, greater than , less than, and so on.

These expressions return 1 if the condition evaluates to true and 0 if false. When comparing operands of different types, numeric operands are converted to strings using a built-in variable (using CONVFMT). Strings are compared character to character.

Equal to (==):

This relational operator is represented by the equals symbol repeated twice (==). It returns true if both operands are equal; otherwise it returns false. Here, ...

Get Learning AWK Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.