[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



No, it's a logical or.  The point is that even though the sym link 
exists, if you test for existance of the file, and the file is not 
there, it will return false.

To test to see if it's a sym link you would do

test -L foo

> 
> I have a script that I'd like to have watch 10 files and when the last 
> one is removed, then move on to the next command in the script.  I 
> initially tried testing for the existence of all 10 files but I know I 
> have the syntax wrong.
> 
> Here is the while loop that failed:
> 
> ## Wait and watch for locks to disappear
> cd $CWD
> LK=biased.lck
> TERM="BatchMin normal termination"
> 
> while :
> do
> 
>    if   [ -f $CWD/00/biased/$LK || $CWD/01/biased/$LK || 
> $CWD/02/biased/$LK || $CWD/03/biased/$LK || $CWD/04/biased/$LK \
>           || $CWD/05/biased/$LK || $CWD/06/biased/$LK || 
> $CWD/07/biased/$LK || $CWD/08/biased/$LK || $CWD/09/biased/$LK ]

You want to use:

if [ -f foo -o -f bar -o -f foobar ]; then doit; fi

Different syntax inside the brackets.

-- 
Until later, Geoffrey


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00619" href="msg00619.html">[ale] Bash (or whatever) question</a></strong>
<ul><li><em>From:</em> johnmills at speakeasy.net (John Mills)</li></ul></li>
<li><strong><a name="00626" href="msg00626.html">[ale] Bash (or whatever) question</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
<li><strong><a name="00691" href="msg00691.html">[ale] Bash scripting question #2</a></strong>
<ul><li><em>From:</em> Dow.Hurst at mindspring.com (Dow Hurst)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00700.html">[ale] Delivery service mail</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00702.html">[ale] Bash scripting question #2</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00707.html">[ale] Bash scripting question #2</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00697.html">[ale] Bash scripting question #2</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00701"><strong>Date</strong></a></li>
<li><a href="threads.html#00701"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>