- Bash Cookbook
- Ron Brash Ganesh Naik
- 85字
- 2021-07-23 19:17:31
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"
推薦閱讀
- Vue.js 3.x從入門到精通(視頻教學版)
- 實戰Java程序設計
- Julia機器學習核心編程:人人可用的高性能科學計算
- 深度學習:算法入門與Keras編程實踐
- 軟件架構:Python語言實現
- Procedural Content Generation for C++ Game Development
- ArcGIS for Desktop Cookbook
- C語言程序設計習題與實驗指導
- Machine Learning With Go
- Hadoop 2.X HDFS源碼剖析
- 從0到1:HTML5 Canvas動畫開發
- PHP+MySQL動態網站開發從入門到精通(視頻教學版)
- Mastering Unreal Engine 4.X
- Java程序設計教程
- SOA Patterns with BizTalk Server 2013 and Microsoft Azure(Second Edition)