for name啥意思

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/02 18:36:31
forname啥意思forname啥意思forname啥意思然后以此执行for内部的循环体.举例说明:假定如下代码eth="eth0eth1eth2"fornamein$ethdoecho"thisi

for name啥意思
for name啥意思

for name啥意思
然后以此执行for内部的循环体.举例说明:
假定如下代码
eth="eth0 eth1 eth2"
for name in $eth
do
echo "this is $name"
done
运行后的结果就是
this is eth0
this is eth1
this is eth2
echo "this is $name" 被执行了三次,每次执行时name变量依次是eth变量所记录单词中的一个