The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 09-25-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Your "and" conditional is wrong, you need to repeat the -e

Code:
while [ ! -e script3.lck -a ! -e script4.lck ]; do
The && goes between two commands, like this:

Code:
while [ ! -e script3.lck ] && [ ! -e script4.lck ]; do
or you could change the flow entirely, to avoid those pesky negations:

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