linux-tutorial/codes/shell/示例脚本/逻辑控制/使用until命令.sh

22 lines
219 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
#using the until command
var1=100
until [ $var1 -eq 0 ]
do
echo $var1
var1=$[ $var1-25 ]
done
var1=100
until echo $var1
[ $var1 -eq 0 ]
do
echo Inside the loop: $var1
var1=$[ $var1 - 25 ]
done