shell 中的 do while 語句

語法介紹

while 用於循環,根據條件執行一段代碼塊

1
2
3
4
5
# 語法
while [ 條件 ]
do
# do something...
done

範例

1
2
3
4
5
6
7
8
9
#!/bin/bash

c = 1
while [ $c -le 5 ]
do
echo welcome $c times
# c = c+1
((c++))
done

shell 中的 do while 語句
https://austin72905.github.io/2023/11/27/linux-shell-while/
作者
Austin Lin
發布於
2023年11月27日
許可協議