文件名称:while-do-done结构-UNIX初级教程
文件大小:1.01MB
文件格式:PPT
更新时间:2024-05-12 12:27:09
UNIX
while-do-done结构 while [ condition ] do 条件真,执行do语句,如 do 不换行,则前面应加分号 “;” commands …… last-commands done 对于无限循环可以用 while true 或 while : (更快) 。 例27:while等待键入Y $ carry_on=Y $ while [ $carry_on = Y ] > do > echo –e “ I do the job as long as you type Y: \c “ > read carry_on > done I do the job as long as you type Y: N $