shell until 循环

 

until 循环

格式:

until condition
do
    command
done

 

#输出0~9

 
#!/bin/bash
a=0
until [ ! $a -lt 10 ]
do
   echo $a
   a=`expr $a + 1`
done
 

结果输出:

 
0
1
2
3
4
5
6
7
8
9
 

 

posted @ 2018-10-31 13:02  anobscureretreat  阅读(125)  评论(0)    收藏  举报