for循环:
#!/bin/bash
#Description:sum 100
#Author:fansik
#Script:first script
declare -i sum=0
for i in {1..100}; do
sum=$[$sum+$i]
done
echo "The sum is $sum."
for循环:
#!/bin/bash
#Description:sum 100
#Author:fansik
#Script:first script
declare -i sum=0
for i in {1..100}; do
sum=$[$sum+$i]
done
echo "The sum is $sum."