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

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"
主站蜘蛛池模板: 贵溪市| 介休市| 女性| 富源县| 桂阳县| 兰考县| 嘉鱼县| 永寿县| 万山特区| 正安县| 龙岩市| 西贡区| 樟树市| 奇台县| 烟台市| 合江县| 张家界市| 钟山县| 平果县| 商丘市| 渝中区| 全南县| 定州市| 绥中县| 故城县| 民丰县| 泰和县| 射洪县| 宽甸| 北流市| 鲁山县| 新巴尔虎右旗| 苏尼特右旗| 贵溪市| 鞍山市| 南城县| 永平县| 保德县| 天津市| 平南县| 弋阳县|