manpagez: man pages & more
info gawk
Home | html | info | man

File: gawk.info,  Node: Running Examples,  Next: Clones,  Up: Sample Programs

11.1 Running the Example Programs
=================================

To run a given program, you would typically do something like this:

     awk -f PROGRAM -- OPTIONS FILES

Here, PROGRAM is the name of the 'awk' program (such as 'cut.awk'),
OPTIONS are any command-line options for the program that start with a
'-', and FILES are the actual data files.

   If your system supports the '#!' executable interpreter mechanism
(*note Executable Scripts::), you can instead run your program directly:

     cut.awk -c1-8 myfiles > results

   If your 'awk' is not 'gawk', you may instead need to use this:

     cut.awk -- -c1-8 myfiles > results

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.