Centos系列:shell编程综合练习(个人学习记录)




shell编程

until 循环

until 循环执行一系列命令直至条件为 true 时停止。until 循环与 while 循环在处理方式上刚好相反。一般while循环优于until循环,但在某些时候,也只是极少数情况下,until 循环更加有用

# until 循环格式为:
   until command
   do
   Statement(s) to be executed until command is true
   done


# command 一般为条件表达式,如果返回值为 false,则继续执行循环体内的语句,否则跳出循环


# 例 使用 until 命令输出 0 ~ 9 的数字:

[root@localh
posted @ 2023-12-04 16:39  坦笑&&life  阅读(15)  评论(0)    收藏  举报  来源