shell——for循环与while循环

for循环

基本语法1

# (()) 里面可以写运算符号,比如说>
for (( 初始值;循环控制条件;变量变化))
do
程序
done

案例实操

新建脚本文件
在这里插入图片描述

chmod +x for_test.sh
./for_test.sh 100

5050

基本语法2

for 变量in 值1 值2 值3…
do
程序
done

在这里插入图片描述

./for_test.sh 100 

5050
linux
windows

比较 ∗ 和 *和 @区别

猜你喜欢

转载自blog.csdn.net/chairon/article/details/145679996
今日推荐