Shell while循环

来源:互联网 发布:网易域名管理网站 编辑:程序博客网 时间:2024/06/03 18:38

Shell while循环

概述

while循环用于不断执行一系列命令,也用于从输出文件中读取数据。
格式:

while condition
do
statement to be executed if condition is true
done

命令执行完毕,控制返回循环顶部,从头开始直至测试条件为假。