Shell脚本学习---控制语句
For语句
用法1:for * in *
结合Shell数组来说明这个问题:
#test05.sh
#!/bin/bash
array=(zl love ll forever)
for elem in ${array[@]}
do
echo $elem
done
[work@yx-dpfqa-a111.yx01.baidu.com shell]$ sh test05.sh
zl
love
ll
forever
Shell脚本学习---控制语句
For语句
用法1:for * in *
结合Shell数组来说明这个问题:
#test05.sh
#!/bin/bash
array=(zl love ll forever)
for elem in ${array[@]}
do
echo $elem
done
[work@yx-dpfqa-a111.yx01.baidu.com shell]$ sh test05.sh
zl
love
ll
forever