In pattern-action statements, actions are single or multiple statements that are separated by a newline or semicolon. The statements in actions can include the following:
- Expression statements: These are made up of constants, variables, operators, and function calls. For example, x = x+ 2 is an assignment expression.
- Printing statements: These are print statements made with either print or printf. For example, print "Welcome to awk programming ".
- Control-flow statements: These consist of various decision-making statements made with if...else and looping statements made with the while, for, and do constructs. Apart from these, break, continue, next, and exit are used for controlling the loop iterations. These are similar to C programming ...