![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| wait command - cat it wait for not-chile process? | alex_5161 | Shell Programming and Scripting | 2 | 06-26-2008 06:14 PM |
| Sleep Command | Glove | Shell Programming and Scripting | 1 | 10-03-2007 05:02 AM |
| wait / sleep what to use??? | gkrishnag | UNIX for Dummies Questions & Answers | 1 | 09-19-2006 05:13 AM |
| Wait Command | lesstjm | Shell Programming and Scripting | 1 | 03-28-2005 02:55 PM |
| Help with wait command | ultraman | Shell Programming and Scripting | 1 | 10-21-2002 11:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
help in wait or sleep command
Hi All,
I have a script which runs 3 scripts. The first script creates two files. The other two scripts should run only when the files are created. I tried the following for loop , but it is not working. Can someone please help me. Code:
while [ ! -e script3.lck && script4.lck ]; do # Sleep until file does exists/is created sleep 1 done |
|
||||
|
Your "and" conditional is wrong, you need to repeat the -e
Code:
while [ ! -e script3.lck -a ! -e script4.lck ]; do Code:
while [ ! -e script3.lck ] && [ ! -e script4.lck ]; do Code:
while true; do test -e script3.lck && test -e script4.lck && break sleep 1 done Last edited by era; 09-25-2008 at 05:28 AM.. Reason: Sorry, misread the question at first |
|
||||
|
Sorry, I guess precedence problem, the negation covers the whole of the following expression even across an -a apparently. In other words, the second ! in the first solution is wrong, and should be taken out. Another reason to avoid pesky negations I suppose ...
Last edited by era; 09-25-2008 at 05:43 AM.. Reason: Take out the second ! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|