sleep(1) — Commands
OSF
NAME
sleep − Suspends execution for a specified time
SYNOPSIS
sleep seconds
DESCRIPTION
The sleep command suspends execution of a process for the interval specified by seconds, which can range from 0 to 2,147,483,642 seconds.
EXAMPLES
1.To display a message at 4-minute intervals for 20 minutes, create a shell script called remind containing the following:
for i
do
sleep 240; echo $i
sleep 240; echo $i
sleep 240; echo $i
sleep 240; echo $i
sleep 240; echo $i
done
To display the message Try calling NHK at four-minute intervals, enter:
remind ’Try calling NHK’
2.To run a command at regular intervals, create a shell script containing the following:
while true
do
date
sleep 60
done
This displays the date and time once a minute.
RELATED INFORMATION
Commands: calendar(1).
Functions: alarm(3), pause(3), sigaction(2), sleep(3).