In an if...else statement, we can specify a list of actions to be performed if the conditional expression becomes false. The syntax of if...else is as follows:
if ( conditional-expression )
If conditional-expression evaluates to true (nonzero), then action1 is performed, and if conditional-expression evaluates to false (zero), then action2 is performed, as shown in the following figure:
AWK also has a conditional ternary operator (? :); it is equivalent to the one in C language. It is the same as an if...else statement. The syntax of the ternary operator is as follows: ...