shell编程---while循环

                        while循环

  1 #! /bin/bash
  2 #while looping structure
  3 
  4 let i=1
  5 var=$0
  6 
  7 while [ "$var" ]
  8 do
  9         echo "i = $i"
 10         let i=$i+1
 11         if [ $i -eq 5 ]
 12         then
 13                 echo "i = $i"
 14                 exit 0
 15         fi
 16 done

猜你喜欢

转载自blog.csdn.net/yanlaifan/article/details/114463655