for var in item1 item2 ... itemN
do
command1
command2
... commandN
done
for loop in 1 2 3 4 5
do
echo "The value is: $loop"
done
挨个儿输出12345,比如The value is: 1。。。。
for str in This is a stringdo
echo $str
done
挨个儿输出了单词
for var in item1 item2 ... itemN
do
command1
command2
... commandN
done
for loop in 1 2 3 4 5
do
echo "The value is: $loop"
done
挨个儿输出12345,比如The value is: 1。。。。
for str in This is a stringdo
echo $str
done
挨个儿输出了单词
本文标题:linux for循环
本文链接:https://www.haomeiwen.com/subject/kscnxktx.html
网友评论