官术网_书友最值得收藏!

Do while loop

As an alternative, we have included the do while loop. It is similar to a for loop, but better suited to dynamic conditions, such as when you do not know when a value will be returned or performing a task until a condition is met. The condition within the square brackets is the same as an if statement:

#!/bin/bash
CTR=1
while [ ${CTR} -lt 9 ]
do
echo "CTR var: ${CTR}"
((CTR++)) # Increment the CTR variable by 1
done
echo "Finished"
主站蜘蛛池模板: 漳浦县| 云林县| 通州区| 双辽市| 观塘区| 青冈县| 洛宁县| 札达县| 灯塔市| 莱芜市| 南澳县| 桓台县| 武冈市| 桦川县| 德清县| 上杭县| 鹿邑县| 夏河县| 濮阳县| 稷山县| 姜堰市| 章丘市| 峡江县| 白银市| 台北市| 巢湖市| 南漳县| 汕头市| 肇州县| 和田市| 沂南县| 洛南县| 九江县| 沛县| 岳池县| 迁西县| 武冈市| 门源| 安徽省| 弥勒县| 东港市|