=== Throwaway one-liners It is often useful to type a simple program at the command line for use within [[awk]]. An [[awk]] program can be supplied as an [[argument]] of the [[awk]] command: {{{ sh awk 'BEGIN {print "Hello World!"}' }}} === Running an awk script An [[awk]] script can be started at the command line, by passing the script name as a parameter to the [[awk]] interpreter: {{{ sh awk -f foobar.awk }}} === Using a shebang (hashbang) As with other Unix scripts, an [[awk]] script can be started using a [[hashbang]]. However, because of the syntax of the [[awk]] command line, it is necessary to include a the -f switch in the [[hashbang]] line as follows: {{{ sh #!/usr/bin/awk -f BEGIN { print "Hello World!" } }}} === Using awk as a filter
Summary:
This change is a minor edit.
Username: