#!/bin/sh
#
#NAME
#  SumCol - sum of a column
#
#SYNOPSIS
#  SumCol N <data
#
#DESCRIPTION
#  Add up column N1 of stdin.  If you pipe the output of "ls  -l"  to
#  this,  it  will  add  up  the  sizes,  which  are in column 4, our
#  default.  You can specify the column for other kinds of files.
#
#BUGS
#  There's a better version available in perl; awk is obsolete.
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>

if [ $# -lt 1 ];then set 4;fi
awk '{s += $'$1'} END {print s}'
