perl -ne 'BEGIN {$col=1}' -e 's/\r?\n//; @F=split /\t/, $_; $sum += $F[$col]; END {warn "Sum of column $col for $. lines\n"; print "$sum\n"}' file.tab