#!/usr/bin/awk -f BEGIN { lines=0; total=0; } { lines++; total+=$1; } END { print "average is ", total/lines; }