bash add to number in file code example
Example 1: bash add all numbers
awk '{ sum += $1 } END { print sum }' file
Example 2: sum bash
#Just use following structure for summing up varibles:
sum=$((var1 + var2))
#For float numbers use next instruction:
sum=$(bc <<< $var1'+'$var2)