loop
for loop
for i in var1 var2 var3; do echo $i; done
for ((i=1;i<=10;i++)); do echo $i; done
for i in $(ls *.log); do echo $i; done
for t in {1..10};do echo $t; done
1
2
3
4
5
6
7
8
9
10
for t in {1..10..2};do echo $t; done
1
3
5
7
9
## 列出目前資料夾的所有目錄名稱
for dir in */;do echo "${dir%/}"; done
while loop