AWK tutorial: awk workflow

AWK follows a simple workflow − Read, Execute, and Repeat.

BODY block

This block is the core of the awk command. It consists of three parts.

  • Read

AWK reads a line from the input stream (file, pipe, or stdin) and stores it in memory.

  • Execute

All awk commands are applied sequentially on the input. By default, AWK executes commands for each line entered. However, we can restrict it to a specified pattern.

  • Repeat

This process repeats until the file reaches its end.

More about awk:

8 Comments

Add a Comment

Your email address will not be published. Required fields are marked *