• put your awk commands in a file: -f
  • here's an example: simple.awk
  • note BEGIN and FS operators
  • minor syntax differences
  • code in BEGIN { } is executed once
  • code after BEGIN's close bracket gets run on each line
  • more code:
  • BEGIN {
    	{ print "A simple addition program\n"; }
    }
    { printf "%i + %i = %i\n",$1, $2, c=$1+$2 }
    
    NEXT
    PREVIOUS
    Master Index