shell脚本之-无限循环

/*********************************************************************
 * Author  : Samson
 * Date    : 11/06/2013
 * Test platform:
 *               3.6.10-4.fc18.i686.PAE
 *               GNU bash, version 4.2.39

 * *******************************************************************/
for 实现:
#!/bin/bash
set i=0
set j=0
for((i=0;i<10;))
do
        let "j=j+1"
        echo "-------------j is $j -------------------"
done

while实现:
#!/bin/bash
set j=2
while true
do
        let "j=j+1"
        echo "----------j is $j--------------"
done

你可能感兴趣的:(shell无限循环)