#!/bin/sh
#
# $Id: addcol,v 1.1 1993/07/12 13:11:58 ejb Exp $
# $Source: /home/ejb/scripts/RCS/addcol,v $
# $Author: ejb $
#
# Print the sum of numbers on column [arg] of the input.
#

whoami=`basename $0`

if [ $# -ne 1 ]; then
   echo "Usage: $whoami col" 1>&2
   exit 1
fi

col='$'$1

awk "BEGIN { s = 0 } { s += $col } END { print s }"
exit 0
