Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

sleep(1) OSS Shell and Utilities Reference Manual
NAME
sleep - Suspends execution for a specied time
SYNOPSIS
sleep seconds
DESCRIPTION
The sleep command suspends execution of a process for the interval specied by seconds, which
can range from 0 to 2,147,483,647 seconds.
seconds can be entered as a non-negative decimal, octal, or hexadecimal value.
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 4-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.
NOTES
If sleep receives a SIGALARM signal before process execution has resumed, sleep terminates
normally with a 0 (zero) exit status. (See the sleep(3) reference page for more information.)
RELATED INFORMATION
Functions: alarm(3), pause(3), sigaction(2), sleep(3).
846 Hewlett-Packard Company 527188-007