|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need to insert a wait (pause the script) command for a random amount between 1 minuite and 1 hour of time before running the next command.
Example: run this run that wait (random time) run another Can anyone help me with this? Any help is greatly appreciated. |
|
#2
|
|||
|
|||
|
The sleep command will do it for you, you just need to provide it with a suitable random number.
|
|
#3
|
||||
|
||||
|
How about:
Code:
#!/bin/sh seconds=$(( (RANDOM%60+1)*60 )) sleep $seconds |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Shell Script Waiting for a random amount of time |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|