![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| On relationships among: derived event, composite event, complex event and situation | iBot | Complex Event Processing RSS News | 0 | 07-17-2008 07:50 AM |
| wait command - cat it wait for not-chile process? | alex_5161 | Shell Programming and Scripting | 2 | 06-26-2008 07:14 PM |
| Need to execute 2 scripts, wait, execute 2 more wait, till end of file | halo98 | Shell Programming and Scripting | 1 | 08-01-2006 05:42 PM |
| How to find the File Age and wait for that... | redlotus72 | UNIX for Dummies Questions & Answers | 3 | 06-01-2005 04:13 AM |
| Lock a file. AND Wait if file is locked | sunil_neha | Shell Programming and Scripting | 2 | 07-13-2004 11:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
event wait throu unix
hi
thanks for your response.. i have gone through your link but i would like to explain my case once again I have a script called B.sh Its not scheduled to run at any specific time. Now.. I receive a file A.dat at a specified location daily. Once i see the file ... i should remove it and then B.sh should start This should happen daily . |
|
||||
|
H avronius
i think we are getting close.. but my doubt is say we did not get the file it goes executes sleep10 .. wat next after 10 seconds? and should i write this< if code i>n another a.dat file and schedule it using cron to run continously ? |
|
||||
|
Hi all with your help I think we got the solution
1. Create a file First.dat with the following code mentioned by avronius and methyl's while true do if [ -f A.txt ] -- checks if A.txt file arrived or not then # If the file exists, delete A.txt and run b.sh rm A.txt b.sh exit 0 else # If the file does not exist wait a small increment of time sleep 10 fi done 2. Schedule First.dat to run for every minute Actions: Once it finds A.dat then If condition is satisfied and b.sh will run and program breaks. and it waits for the file for tomorrow again .. the same way sincere Thanks for all of you .. |
|
||||
|
Why don't you test it and see what happens?
I tested by running the script without A.txt I waited about 15 seconds - of course, nothing happened I put the command to sleep, I touched A.txt I brought the command back to the foreground It immediately discovered that A.txt was there - and reported that the condition was met. In it's current state, it will run once - and keep waiting for the file to appear. Once the file appears, it will do whatever is in the "then" part of the loop. It will then stop running. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|