How do I do a short delay (milliseconds) in a shell script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How do I do a short delay (milliseconds) in a shell script?
# 8  
Old 08-24-2011
I've never heard about builtin sleep. It's just not GNU sleep (BSD on Mac, or something else). The variant with perl is the best solution (on modern enough boxes).
# 9  
Old 08-24-2011
Quote:
Originally Posted by yazu
I've never heard about builtin sleep. It's just not GNU sleep (BSD on Mac, or something else). The variant with perl is the best solution (on modern enough boxes).
ksh93 does indeed have a built-in sleep.

GNU sleep is not special in this regard. I regularly use *BSD and every BSD's sleep(1) supports fractions of a second.

Regards,
Alister
This User Gave Thanks to alister For This Post:
# 10  
Old 08-24-2011
Oh, yes. I checked it in ksh with "which" but I should do it with "type". Too many shells, too many *nixes, too little experience... )))
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I am learning shell scripting and i would like to understand how sort -k3,3 -k 4,4 short* works

Please help me understand how sort -k3,3 -k 4,4 short* works , is it sorting 3 and 4 th field ? what is the use of specifying 3,3 and 4,4 in sort and what is actually does and i see sort -k3 short* and sort -k3,3 -k 4,4 short* giving the same output. Sort output attached Please help (2 Replies)
Discussion started by: Antony Ankrose
2 Replies

2. Shell Programming and Scripting

Delay in running script from crontab

I am facing an issue where sometimes crontab is running script with some delay. Below is the stmt in script and it is the only stmt in script. echo "running at `date` " >> CRONCHECK.log Below is the cron entry. 0 11 * * * CRONCHECK.sh Below is the time of run each day. running at Fri... (8 Replies)
Discussion started by: Nishant Singh
8 Replies

3. OS X (Apple)

Shell Script to change desktop short cut Icon

I have installed my flash application using shell script. I have created short cut to desktop. Now i want to change the default short cut Icon. Please tell me script to change the short cut icon. ---------- Post updated at 12:54 AM ---------- Previous update was at 12:33 AM ---------- Working... (0 Replies)
Discussion started by: rohaneee
0 Replies

4. Shell Programming and Scripting

How to introduce delay in Shell Script till a key stroke.

Hi All, How to introduce delay in the Bash/Shell Script till key stroke. Below is the requirement.. 1.Execute set of commands. 2.Display the message echo "press any key to continue" Introduce a delay till key stroke. 3.Execute next set of commands. Thanks in Advance Sunil.K (5 Replies)
Discussion started by: sunilrk07
5 Replies

5. Shell Programming and Scripting

Want to have delay in multiple instances of the same shell script

Hello, My goal is to run the same Shell script in a parallel mode. This script will get triggered from different machines and different application teams by some job scheduling tool. They may trigger the process at the same time. so I want to have them in QUEUE ..and release them for execution on... (3 Replies)
Discussion started by: chetan_sonar
3 Replies

6. UNIX Desktop Questions & Answers

Script that will display a short message

Can anyone point me to the right direction on how to write a simple script that will display a message on any terminal when implemented? Basically I need it so the script runs at a certain time, say April 30, 2010 and that the message will be displayed to me no matter which terminal I am logged... (2 Replies)
Discussion started by: jmack123
2 Replies

7. Shell Programming and Scripting

adding delay in script

Hi Expert, I need to run some command 5 times with 5 mins interval whenever one of the application on server hang. Can I use below scripts ? Thanks! ------------- #!/bin/sh command1 sleep 300 command2 sleep 300 command3 sleep 300 command4 sleep 300 command5 sleep 300... (2 Replies)
Discussion started by: skully
2 Replies

8. Shell Programming and Scripting

how to introduce delay in the script??(urgent)

Hi all, i would like to know how to introduce a delay in the execution of a cmd? am trying to copy a file which is about 650 mb and then perform some actions on it.. however since its huge i would like to introduce a delay in exection until the process is over i dont want it to proceed to... (10 Replies)
Discussion started by: wrapster
10 Replies

9. Shell Programming and Scripting

short script help

how do i find out the date of the last time the system was last booted from? (8 Replies)
Discussion started by: jodders
8 Replies

10. UNIX for Dummies Questions & Answers

Insert a delay in a script

Hi all, i need help. I want to write a script and insert a delay time of 10 seconds. Which is the command for do this? Thanks in advance (1 Reply)
Discussion started by: christian
1 Replies
Login or Register to Ask a Question