SLEEP(1,C) AIX Commands Reference SLEEP(1,C)
-------------------------------------------------------------------------------
sleep
PURPOSE
Suspends execution for an interval.
SYNTAX
sleep -- seconds --|
DESCRIPTION
The sleep command suspends execution of a process for the interval specified by
seconds. seconds can range from 1 to 65,536 seconds.
EXAMPLES
1. To run a command after a certain amount of time has passed:
echo "SYSTEM SHUTDOWN IN 10 MINUTES!" | wall
(sleep 300; echo "SYSTEM SHUTDOWN IN 5 MINUTES!" | wall) &
(sleep 540; echo "SYSTEM SHUTDOWN IN 1 MINUTE!" | wall) &
(sleep 600; shutdown) &
This command sequence warns all users 10 minutes, 5 minutes, and 1 minute
before the system is shut down.
2. To run a command at regular intervals:
while true
do
date
sleep 60
done
This shell procedure displays the date and time once a minute. To stop it,
press INTERRUPT (Ctrl-C).
RELATED INFORMATION
See the following commands: "shutdown" and "wall."
See the alarm system call and the sleep, pause, and signal subroutines in AIX
Operating System Technical Reference.
Processed November 8, 1990 SLEEP(1,C) 1