[Gllug] Sum trouble

Michael Still mikal at stillhq.com
Tue Apr 8 09:31:09 UTC 2003


On Tue, 8 Apr 2003, Leigh Mason wrote:

> I have retrieved the particular column which gives me a list of byte
> values thus:
> cut -f10 -d" " access_log

[ Untested, but should be close ]

#!/bin/bash
sum=0
for number in `cut -f 10 -d " " access_log`
do
  sum=$(( $sum + $ count ))
done

echo "The total is $sum"

Cheers,
Mikal

-- 

Michael Still (mikal at stillhq.com) | Stage 1: Steal underpants
http://www.stillhq.com            | Stage 2: ????
UTC + 10                          | Stage 3: Profit


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list