<h2 id="bash-parameter-manipulation">Bash parameter manipulation</h2>
<p>I'm a great fan of using the Linux command line and enjoy writing shell scripts using the Bash shell.</p>
<ul>
<li><p><em>BASH</em> (or more usually <em>Bash</em> or <em>bash</em>) is the name of a <a href="https://en.wikipedia.org/wiki/Unix_shell">Unix shell</a>. The name stands for <em>Bourne Again SHell</em>, which is a play on words. Bash is an extension of the shell originally written by <a href="https://en.wikipedia.org/wiki/Stephen_Richard_Bourne">Stephen Bourne</a> in 1978, usually known as <em>SH</em>.</p></li>
<li><p><a href="https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29">Bash</a> was written as part of the <a href="https://en.wikipedia.org/wiki/GNU_Project">GNU Project</a> which forms part of the Linux Operating System.</p></li>
<li><p>A shell is the part of the operating system that interprets commands, more commonly known as the command line.</p></li>
<li><p>A knowledge of Bash is very helpful if you would like to be able to use the power of the command line. It is also the way to learn how to build Bash scripts for automating the tasks you need to perform.</p></li>
</ul>
<p>In this episode we look at what parameters are in Bash, and how they can be created and manipulated. There are many features in Bash that you can use to do this, but they are not easy to find.</p>
<p>As I was learning my way around Bash it took me a while to find these. Once I had found them I wanted to make a &quot;cheat sheet&quot; I could stick on the wall to remind me how to do things. I am sharing the result of this process with you.</p>
<p>The version of Bash which I used for this episode is <em>4.3.30(1)-release</em></p>
<p>The full notes for this episode are to be found here: <a href="hpr1648_full_shownotes.html">hpr1648_full_shownotes.html</a></p>
<h2 id="links">Links</h2>
<ul>
<li>Definitions:
<ul>
<li>Unix shell <a href="https://en.wikipedia.org/wiki/Unix_shell">https://en.wikipedia.org/wiki/Unix_shell</a></li>
<li>Bash <a href="https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29">https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29</a></li>
<li>GNU Project <a href="https://en.wikipedia.org/wiki/GNU_Project">https://en.wikipedia.org/wiki/GNU_Project</a></li>
</ul></li>
<li>References
<ul>
<li>Shell Parameter Expansion <a href="https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html">https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html</a></li>
<li>Bash Hackers on parameter expansion <a href="https://wiki.bash-hackers.org/syntax/pe">https://wiki.bash-hackers.org/syntax/pe</a></li>
</ul></li>
<li>Previous HPR shows on the shell or shell scripting:
<ul>
<li>2008-03-03 HPR0045: Shell Scripting (dosman) <a href="https://hackerpublicradio.org/eps/hpr0045">hpr0045</a></li>
<li>2008-03-12 HPR0052: UCLUG: Newbie Shell Scripting (Dave Yates) <a href="https://hackerpublicradio.org/eps/hpr0052">hpr0052</a></li>
<li>2010-03-24 HPR0531: bash loops (Ken Fallon) <a href="https://hackerpublicradio.org/eps/hpr0531">hpr0531</a></li>
<li>2010-08-11 HPR0562: Introduction to bash scripting (Ken Fallon) <a href="https://hackerpublicradio.org/eps/hpr0562">hpr0562</a></li>
<li>2010-11-17 HPR0598: Bash Scripting: Episode 2 Command Line Basics (Ken Fallon) <a href="https://hackerpublicradio.org/eps/hpr0598">hpr0598</a></li>
<li>2012-05-22 HPR0992: Linux In The Shell 007 - Chmod and Unix Permissions. (Dann) <a href="https://hackerpublicradio.org/eps/hpr0992">hpr0992</a></li>
<li>2012-06-05 HPR1002: Linux In The Shell 008 - free: Understanding Linux Memory Usage (Dann) <a href="https://hackerpublicradio.org/eps/hpr1002">hpr1002</a></li>
<li>2013-03-05 HPR1197: What I do with bash scripts (Jon Kulp) <a href="https://hackerpublicradio.org/eps/hpr1197">hpr1197</a></li>
<li>2013-04-09 HPR1222: LiTS 027: mathematical commands (Dann) <a href="https://hackerpublicradio.org/eps/hpr1222">hpr1222</a></li>
<li>2013-05-14 HPR1247: Recording Terrestrial Radio with bash scipts and cron jobs (Jon Kulp) <a href="https://hackerpublicradio.org/eps/hpr1247/">hpr1247</a></li>
<li>2013-05-22 HPR1253: Linux in the Shell Ep 30 - vmstat (Dann) <a href="https://hackerpublicradio.org/eps/hpr1253">hpr1253</a></li>
</ul></li>
<li>Resources
<ul>
<li>Full show notes <a href="hpr1648_full_shownotes.html">hpr1648_full_shownotes.html</a></li>
<li>Bash man page extract <a href="hpr1648_summary.pdf">hpr1648_summary.pdf</a></li>
<li>Parameter manipulation &quot;<em>cheat sheet</em>&quot; <a href="hpr1648_diagram.pdf">hpr1648_diagram.pdf</a></li>
<li>Various annotated Bash scripts which make up my Magnatune Downloader (described in show <a href="https://hackerpublicradio.org/eps/hpr1204/">hpr1204</a>) <a href="https://gitorious.org/magnatune-downloader/magnatune-downloader/source/master:">https://gitorious.org/magnatune-downloader/magnatune-downloader/source/master:</a></li>
</ul></li>
</ul>
