[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Fri Feb 18 00:02:53 2005 -->
- <!--x-from-r13: zquvefpu ng tznvy.pbz ([vpunry Vvefpu) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: Pine.LNX.4.44.0502152230590.2264-[email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Bash scripting question #2 -->
- <li><em>date</em>: Fri Feb 18 00:02:53 2005</li>
- <li><em>from</em>: mdhirsch at gmail.com (Michael Hirsch)</li>
- <li><em>in-reply-to</em>: <<a href="msg00691.html">[email protected]</a>></li>
- <li><em>references</em>: <[email protected]> <<a href="msg00626.html">[email protected]</a>> <<a href="msg00691.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Bash scripting question #2</li>
No, exactly the opposite. It is a logical "OR", so it only executes
if the test returns false. If $fn is not a regular file "test -f $fn"
is false, so the other half of the OR needs to be tested.
I've never seen || used the way you use it in your while loop. I
don't think it works like that. You have
if [ -f $file1 || file2 ] ...
which means "if file1 is a file or file2". Note that I didn't write
"if file1 is a file or file2 is a file". I don't know what it means
to test just a filename. I think you need multiple -f flags like:
if [ -f $file1 || -f $file2 ] ...
Michael
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00702" href="msg00702.html">[ale] Bash scripting question #2</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--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="msg00698.html">[ale] William Gates -- movie villian</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00700.html">[ale] Delivery service mail</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00691.html">[ale] Bash scripting question #2</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00702.html">[ale] Bash scripting question #2</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00699"><strong>Date</strong></a></li>
<li><a href="threads.html#00699"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>