#!/bin/bash declare -i sum=0 for ((i=1;i<=100;i++)) do let sum+=$i done echo "Sum:$sum"
|---------------|------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 | #!/bin/bash declare -i sum=0 for ((i=1;i<=100;i++)) do let sum+=$i done echo "Sum:$sum" |