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
 

 

原文地址:https://www.cnblogs.com/sea-stream/p/9882414.html