linux-tutorial/codes/shell/示例脚本/逻辑控制/使用while多个测试命令.sh

12 lines
153 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
#testing a multicommand while loop
var1=10
while echo $var1
[ $var1 -ge 0 ]
do
echo 'This is inside the loop'
var1=$[ $var1 - 1 ]
done