I have a file with a lot of rows and they all numbers, and i want to add them and get the total of them all, then i'll put it in a loop so it will do this math all the time supplying the result number of all these rows,, i couldn't do this in bash. This example say i'll run this on 100 different servers and i want to add each line in this somefile to the second one and on, on .
Ex:
netstat -ant | grep -c :80 > /path/to/somefile
Is there a way for this in bash or Python ?