#!/bin/bash
#准备数组
array=(table1 table2 table3 table4)
#标准for循环
for((i=0;i<${#array[@]};i++))
do
echo ${array[i]}
done
#for ... in形式的循环
for element in ${array[@]}
do
echo $element
done
shell编程(四):简单循环
于 2022-06-19 17:59:05 首次发布