0
- !/bin/bash
- ##written by wangyl
- ##2016-04-20
- for i in `seq 1 10`;
- do
- echo $i
- done
- i=1
- while [ $i -le 10 ];
- do
- echo $i
- i=$[$i+1]
- done
- i=1
- until [ $i -gt 10 ];
- do
- echo $i
- i=$[$i+1]
- done
0
- #!/bin/bash
- ###by wang
- for ((i=1;i<=10;i++))
- do
- echo -n " $i "
- done
- i=0
- while [ $i -lt 10 ]
- do
- ((i++))
- echo -e "\n $i "
- done
- i=0
- until [ $i -eq 10 ]
- do
- let i++
- echo -n " $i "
- done
0
for i in `seq 1 10` ; do echo $i ; done; i=1 ; while [ $i -le 10 ];do echo "$i" ; i=$[ $i+1 ];done
编辑回复