title: How to test that a variable starts with a string in bash?
body: <p>For a fixed prefix length I can do it like so:</p>
  
  <pre><code>[ a${filename:0:2} = a.# ] &amp;&amp; echo temporary emacs file
  </code></pre>
  
  <p>How to do it for an arbitrary prefix?</p>
  
  <p>Is there a cleaner way?</p>