Hi there
If I run a 'swap -l' on my solaris box, i get
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 54,65 8 67119560 65655144
/dev/dsk/c1t0d0s2 54,65 8 33119522 32655122
I wanted to run a for loop adding up the totals of each column 4 , excluding the header then divide the total by 2, so i got as far as
for n in `swap -l | grep -v swapfile | awk {'print $4'}; do
# Then i drew a blank on how exactly im going to add them all up
done
can anybody point me in the right direction ?
Any help would be greatly appreciated