bash sum code example
Example 1: bash sum variable
x = 2
y = 2
echo $((x + y))
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)
x = 2
y = 2
echo $((x + y))
#Just use following structure for summing up varibles:
sum=$((var1 + var2))
#For float numbers use next instruction:
sum=$(bc <<< $var1'+'$var2)