cat foo.txt | awk '{SUM+=$3} END {print SUM/NR}'