# Sample Awk Script for CSE326 Winter 2002 #!/bin/sh if [ $# -ne 2 ] # check that two arguments are given then echo "awk-example " exit 1 fi # below are not really necessary but makes the code # easier to read input=$1 output=$2 # print out the 4th and 6th cells of each line from $input # and write them to output with a space in-between # (the , forces a space between them # # NOTE: the line with print is the only line you will usually # have to change awk '{ print $4,$6 }' $input > $output