<h1 id="some-ancillary-bash-tips---9">Some ancillary Bash tips - 9</h1>
<h2 id="making-decisions-in-bash">Making decisions in Bash</h2>
<p>This is my ninth contribution to the <a href="https://hackerpublicradio.org/series/0042.html" title="*Bash Scripting* series"><em>Bash Scripting</em></a> series under the heading of <em>Bash Tips</em>. The previous episodes are listed below in the <a href="#links">Links</a> section.</p>
<p>It seems to me that it would be worthwhile looking at how Bash can be used to make decisions, such as how many times a loop should cycle (<em>looping constructs</em>) or to choose between multiple choices (<em>conditional constructs</em>). Of course we need to look at some of the expressions used in conjunction with the commands that do these tasks – the tests themselves – and we’ll do this in this episode.</p>
<p>This is a complex area which I had some trouble with when I first started using Bash, and there is a lot to say about it all. I have prepared a group of HPR shows about this subject, in order to do it justice, and this is the first of the group.</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/hpr2639/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#Bash-Conditional-Expressions">“Bash Conditional Expressions”</a></li>
<li><a href="https://www.gnu.org/software/bash/manual/bash.html#Bourne-Shell-Builtins">“Bourne Shell Builtins”</a></li>
</ul></li>
<li><a href="https://hackerpublicradio.org/series/0042.html">HPR series: <em>Bash Scripting</em></a></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>
</ol></li>
<li>Resources:
<ul>
<li>Examples: <a href="https://hackerpublicradio.org/eps/hpr2639/bash9_ex1.sh">bash9_ex1.sh</a></li>
</ul></li>
</ul>