<h1 id="bash-snippet---extglob-and-scp">Bash snippet - extglob and scp</h1>
<h2 id="the-problem">The Problem</h2>
<p>Following on from my last show on <a href="https://hackerpublicradio.org/eps.php?id=2293" title="More supplementary Bash tips">filename expansion</a>, concentrating on extended patterns and the <code>extglob</code> option, I was asked a question by <a href="https://hackerpublicradio.org/correspondents/0238.html" title="HPR Host Jon Kulp">Jon Kulp</a> in the comment section.</p>
<p>Jon was using <code>ls *(*.mp3|*.ogg)</code> to find all OGG and MP3 files in a directory which also held other files. However, when he wanted to copy this subset of files elsewhere he had problems using this expression in an <code>scp</code> command.</p>
<p>Having done some investigations to help solve this I thought I'd put what I found into an HPR episode and share it, and this is the show.</p>
<p>Along the way <a href="https://hackerpublicradio.org/correspondents/0311.html" title="HPR Host clacke">clacke</a> commented too and this led me to more investigations!</p>
<h2 id="long-notes">Long notes</h2>
<p>As often happens, my idea of a brief episode turned into something much longer, so I converted the notes into <a href="https://hackerpublicradio.org/eps/hpr2317/full_shownotes.html">long notes which you can find here</a>. In them I have marked some sections which you might want to skip over -- unless you are as much of a geek as I am! I have not covered these sections in detail in the audio.</p>
<h2 id="links">Links</h2>
<ul>
<li>HPR Show 2293: <a href="https://hackerpublicradio.org/eps.php?id=2293">More supplementary Bash tips</a></li>
<li>StackExchange question: <a href="https://unix.stackexchange.com/questions/103058/exclude-characters-for-scp-filepattern">Exclude characters for SCP-filepattern</a></li>
</ul>