Awk call Syntax:
Awk [-F <ch>] {pgm} | {-f <pgm_file>} [<vars>] [-| <data_file>]
-- Where:
Ch: Field-separator character.
Pgm: Awk command-line program.
Pgm file: File containing an Awk program.
Vars: Awk variable initializations.
Data file: Input data file.
Note:
1. The data file is optional. If not specified, AWK retrieves data from the standard input, and each input ends with a CTRL-D. Multiple data files can be specified. AWK will scan each file in sequence and generate continuous output.
2. Note that the "-F" option allows you to change the field separator of the AWk (any space by default)
An AWK program has the following basic structure:
BEGIN {<initializations>}
<Search pattern 1 >{< program actions>}
<Search pattern 2 >{< program actions>}
...
END {<final actions>}
Note:
If the AWK program is written in the command line, it should be enclosed in single quotes ('{pgm}') to prevent shell from parsing words in the program as special shell characters.