在下面的shell脚本中定义字符串数组。我想显示sql nomal,我该怎么办?
a=("select * from t1;"
"select * from t2;"
"select from t3;")
echo ${#a[@]}"--------"
for var1 in ${a[@]};do
echo "${var1}"
done
答案 0 :(得分:0)
这会为你做到
a=( 'select * from t1;'
'select * from t2;'
'select * from t3;' )
for query in "${a[@]}"; do
echo "$query"
done
RESULT
$ sh SO.sh
select * from t1;
select * from t2;
select * from t3;
$