hashbang

A script can be treated as an executable file by using a hashbang

It is possible for an awk script to be treated as an executable file by including a hashbang line as the first line of the script.

The hashbang needs a switch

Because of the way that the awk command line is structured, it is necessary to include a -f command line switch on the hashbang line. This enables the system to run the awk interpreter with the appropriate command line for the script. The hashbang line should read as follows:

#!/usr/bin/awk -f