一.while循环语句 1.循环语句 循环愈久就是重复执行一条指令或一组执行,知道条件不在满足时停止,shell循环语句包括,while.until.for.select语句 2.while循环 主要用来重复执行命令或语句,常用来守护进程或持续运行的程序,其实大多数循环都会用for循环语句 3.语法 while <条件表达式> do 指令... done 4.流程图 二.until循环语句 1.until循环语句语法 until <条件表达式> do 指令... done unti
一.shell脚本介绍 (一)脚本案例及介绍: #!/bin/bash LOG_DIR=/var/log ROOT_UID=0 if ["$UID -ne "$ROOT_UID"] then echo "must be root run this script." exit 1 fi cd $ LOG_DIR || { echo "cannot change to necessary directory" exit 1 } cat /d