首页 > 系统服务 > 详细

shell脚本之while

时间:2016-12-10 13:42:57      阅读:221      评论:0      收藏:0      [点我收藏+]
#! /bin/bash
echo if num smaller than 5,it will continue 
num=0
while [ $num -lt 5 ]
do
echo now the num is $num
let num++
done

  

[root@lenny Desktop]# ./while.sh 
if num smaller than 5,it will continue
now the num is 0
now the num is 1
now the num is 2
now the num is 3
now the num is 4

  

shell脚本之while

原文:http://www.cnblogs.com/leonarcohen/p/6155307.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!