sum values in a single line git bash script code example
Example 1: sum bash
#Just use following structure for summing up varibles:
sum=$((var1 + var2))
#For float numbers use next instruction:
sum=$(bc <<< $var1'+'$var2)
Example 2: sum column bash
<cmd> | paste -sd+ | bc
# Using stdin