<h1 id="bash-tips---15">Bash Tips - 15 <small><small>(More auxiliary Bash tips)</small></small></h1>
<h2 id="pitfalls-for-the-unwary-bash-loop-user">Pitfalls for the unwary Bash loop user</h2>
<p>This is the fifteenth episode covering useful tips for Bash users. In the last episode we looked at the <code>'for'</code> loop, and prior to that we looked at <code>'while'</code> and <code>'until'</code> loops. In this one I want to look at some of the loop-related issues that can trip up the unwary user.</p>
<p>Loops in Bash are extremely useful, and they are not at all difficult to use in their basic forms. However, there are some perhaps less than obvious issues that can result in unexpected behaviour.</p>
<h2 id="long-notes">Long notes</h2>
<p>I have provided detailed notes as usual for this episode, and these can be <a href="https://hackerpublicradio.org/eps/hpr2699/full_shownotes.html">viewed here</a>.</p>
<h2 id="links">Links</h2>
<ul>
<li><a href="https://www.gnu.org/software/bash/manual/bash.html">“<em>GNU BASH Reference Manual</em>”</a>
<ul>
<li><a href="https://www.gnu.org/software/bash/manual/bash.html#Process-Substitution">“Bash Process Substitution”</a></li>
</ul></li>
<li><p><a href="https://www.gnu.org/software/findutils/manual/html_mono/find.html">“<em>GNU Findutils</em>”</a></p></li>
<li><p><a href="https://hackerpublicradio.org/series/0042.html">HPR series: <em>Bash Scripting</em></a></p></li>
<li>Previous episodes under the heading <em>Bash Tips</em>:
<ol>
<li><a href="https://hackerpublicradio.org/eps.php?id=1648">HPR episode 1648 “<em>Bash parameter manipulation</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=1843">HPR episode 1843 “<em>Some Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=1884">HPR episode 1884 “<em>Some more Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=1903">HPR episode 1903 “<em>Some further Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=1951">HPR episode 1951 “<em>Some additional Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2045">HPR episode 2045 “<em>Some other Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2278">HPR episode 2278 “<em>Some supplementary Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2293">HPR episode 2293 “<em>More supplementary Bash tips</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2639">HPR episode 2639 “<em>Some ancillary Bash tips - 9</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2649">HPR episode 2649 “<em>More ancillary Bash tips - 10</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2659">HPR episode 2659 “<em>Further ancillary Bash tips - 11</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2669">HPR episode 2669 “<em>Additional ancillary Bash tips - 12</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2679">HPR episode 2679 “<em>Extra ancillary Bash tips - 13</em>”</a></li>
<li><a href="https://hackerpublicradio.org/eps.php?id=2689">HPR episode 2689 “<em>Bash Tips - 14 (Some auxiliary Bash tips)</em>”</a></li>
</ol></li>
</ul>
<ul>
<li>Resources:
<ul>
<li>Examples: <a href="https://hackerpublicradio.org/eps/hpr2699/bash15_ex1.sh">bash15_ex1.sh</a>, <a href="https://hackerpublicradio.org/eps/hpr2699/bash15_ex2.sh">bash15_ex2.sh</a></li>
</ul></li>
</ul>
