指定循环次数 #!/bin/bash s=0 while (( $s < 11 )) do echo "循环次数:$s"; ((s++)); done 输出某一个文件内容 #!/bin/bash while read line do echo $line done < /etc/hosts