码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本之while

时间:2016-12-10 13:45:24      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:tin   while   bash   ash   shell脚本   let   shell   one   desktop   

#! /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

标签:tin   while   bash   ash   shell脚本   let   shell   one   desktop   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!