<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bash on System Overlord</title><link>https://systemoverlord.com/tags/bash.html</link><description>Recent content in Bash on System Overlord</description><generator>Hugo</generator><language>en-us</language><managingEditor>david@systemoverlord.com (David Tomaschik)</managingEditor><webMaster>david@systemoverlord.com (David Tomaschik)</webMaster><lastBuildDate>Mon, 17 Apr 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://systemoverlord.com/tags/bash/index.xml" rel="self" type="application/rss+xml"/><item><title>Bash Extended Test &amp; Pattern Matching</title><link>https://systemoverlord.com/2017/04/17/bash-extended-test-pattern-matching.html</link><pubDate>Mon, 17 Apr 2017 00:00:00 +0000</pubDate><author>david@systemoverlord.com (David Tomaschik)</author><guid>https://systemoverlord.com/2017/04/17/bash-extended-test-pattern-matching.html</guid><description>&lt;p&gt;While my daily driver shell is &lt;a href="http://www.zsh.org/"&gt;ZSH&lt;/a&gt;, when I script, I
tend to target Bash. I&amp;rsquo;ve found it&amp;rsquo;s the best mix of availability &amp;amp; feature
set. (Ideally, scripts would be in pure posix shell, but then I&amp;rsquo;m missing a lot
of features that would make my life easier. On the other hand, ZSH is not
available everywhere, and certainly many systems do not have it installed by
default.)&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve started trying to use the Bash &amp;ldquo;extended test command&amp;rdquo; (&lt;code&gt;[[&lt;/code&gt;) when I write
tests in bash, because it has fewer ways you can misuse it with bad quoting (the
shell parses the whole test command rather than parsing it as arguments to a
command) and I find the operations available easier to read. One of those
operations is pattern matching of strings, which allows for stupidly simple
substring tests and other conveniences. Take, for example:&lt;/p&gt;</description></item></channel></rss>