循环:
for:
for 变量名 in 列表;do 循环体 done
while:
until:
获取循环列表:
for循环1..100求和:
#!/bin/bash declare -i sum=0 #声明int变量 for i in {1..100};do let sum+=i done echo sum=$sum
for1..100奇数求和:
linux——shell把编程:循环
原文:https://www.cnblogs.com/franc/p/12520167.html