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
#!/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