Shell for_while loop
Shell for_while loop
Shell for_while loop功能,範例如下:
for_while_loop.sh
#!/bin/bash #Filename: for_while_loop.sh
for((i=0;i<10;i++)) { echo “for loop $i” } ##################### c=1 while [ $c -le 5 ] do echo “Welcone $c times” (( c++ )) done |
參考出處:Linux Shell 腳本攻略 P 30