linux命令学习笔记之sleep

发表于: lnmp | 作者: | 日期: 2008/12/19 10:12
标签:
字号:

命令简介
可以把当前执行动作延迟指定的时间,以秒为单位。sleep命令经常用于shell脚本的编写。

The sleep command suspends execution of a process for at least the interval specified by the Seconds parameter. The amount of time specified in the Seconds parameter can range from 1 to MAXINT (2,147,483,647) seconds.

命令语法

sleep Seconds

例子 :
显示目前时间后延迟 1 分钟,之后再次显示时间 :

date; sleep 60; date;

一个shell脚本的示例:

while true
do
date
sleep 60
done

: https://blog.darkmi.com/2008/12/19/651.html