BASH: Sum all numbers in a list sum=0 ; for i in `cat list.txt` ; do do sum=`expr $sum + $i`; done ; echo $sum