Previous Section  < Day Day Up >  Next Section

sleep—suspends execution for some number of seconds


sleep time


sleep suspends execution for time seconds. It is used to execute a command after a certain amount of time.

Example A.50.

1   (sleep 105; command)&

2   (In Script)

    while true

    do

        command

        sleep 60

    done


EXPLANATION

  1. After 105 seconds, command is executed. Prompt returns immediately.

  2. Enters loop; executes command and sleeps for a minute before entering the loop again.

    Previous Section  < Day Day Up >  Next Section