gawk: Running Examples

1 
1 11.1 Running the Example Programs
1 =================================
1 
1 To run a given program, you would typically do something like this:
1 
1      awk -f PROGRAM -- OPTIONS FILES
1 
1 Here, PROGRAM is the name of the 'awk' program (such as 'cut.awk'),
1 OPTIONS are any command-line options for the program that start with a
1 '-', and FILES are the actual data files.
1 
1    If your system supports the '#!' executable interpreter mechanism
1 (⇒Executable Scripts), you can instead run your program directly:
1 
1      cut.awk -c1-8 myfiles > results
1 
1    If your 'awk' is not 'gawk', you may instead need to use this:
1 
1      cut.awk -- -c1-8 myfiles > results
1