Computing.Net > Forums > Unix > Handling timeout in scripts.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Handling timeout in scripts.

Reply to Message Icon

Name: Smita K
Date: June 6, 2006 at 01:12:06 Pacific
OS: HPUX
CPU/Ram: N/A
Product: N/A
Comment:

Hi All,
I am writing a script where i am required to check for an existence of a file which gets generated after some time is elapsed as a kind of notification. However i do not want to keep waiting infintely to check if this file has been touched or no.i want to keep polling for it every 20 seconds till a max time of 2 minutes. IF it has not arrived even by the end of 2 minutes, then i want to tell the user that its timedout.
Any suggestions how i can implement this ?


Thanks & Regards
- Smita



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: June 6, 2006 at 09:14:50 Pacific
Reply:

Set up a while loop, and check if the file exists. If it does, break out the loop. If it doesn't sleep 20 seconds and perform the check again. After cycling thru the loop 6 times break out of the loop.



0
Reply to Message Icon

Related Posts

See More


how to check amount of vi... sftp unix script



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Handling timeout in scripts.

Logic in possible in Scripts www.computing.net/answers/unix/logic-in-possible-in-scripts/5591.html

need help in scripting ksh www.computing.net/answers/unix/need-help-in-scripting-ksh/7266.html

error message in script www.computing.net/answers/unix/error-message-in-script/7025.html