首页 > 代码库 > for和while与until的无限循环总结

for和while与until的无限循环总结

for无限循环

for ((i=0;i<1;i+=0))

do

    echo "infinite loop"

done


for ((;1;))

do

    echo "infinite loop"

done


while的无限循环

while ((1))

do

    echo "infinite loop"

done


while true

do

    echo "infinite loop"

done


while :

do

    echo "infinite loop"

done


until循环

until ((0))

do

    echo "inlinite loop"

done


until false

do

    echo "inlinite loop"

done

本文出自 “YHT的运维笔记” 博客,请务必保留此出处http://yht1990.blog.51cto.com/9014030/1918694

for和while与until的无限循环总结