sleep
PURPOSE
Suspends execution for an interval.
SYNOPSIS
sleep time
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 (Alt-Pause).
RELATED INFORMATION
The following commands: "shutdown" and "wall."
The alarm system call and the sleep, pause, and signal
subroutines in AIX Operating System Technical Reference.