Bash While循环
示例
#! /bin/bash
i=0
while [ $i -lt 5 ] #While i is less than 5
do
echo "i is currently $i"
i=$[$i+1] #Not the lack of spaces around the brackets. This makes it a not a test expression
done #ends the loop在测试期间(在while语句之后),请注意括号内有空格。这些空间是必需的。
该循环输出:
i is currently 0 i is currently 1 i is currently 2 i is currently 3 i is currently 4
热门推荐
10 关于扬州的祝福语简短
11 班级群毕业祝福语简短
12 新娘妈妈祝福语简短的
13 简短祝福语蛋糕简笔画
14 新年给大哥祝福语简短
15 幽默的离职祝福语简短
16 给女儿祝福语简短精辟
17 工人生日祝福语简短
18 水晶婚夫妻祝福语简短