shell循环输出1-10

#!/bin/bash
for_1(){
for ((i=0;i<10;i++))
  do
    echo $i
done
echo for_1
}

for_2(){
for i in {1..10}
  do
    echo $i
done
echo for_2
}

for_3(){
for i in `seq 1 10`
  do
   echo $i
done
echo for_3
}

main(){
for_1
for_2
for_3
}
main

 

posted on 2020-04-03 13:55  明.Sir  阅读(5280)  评论(0编辑  收藏  举报

导航