title: How to get the first part of the string in bash
body: <p>Say I have the following file names from an <code>ls</code> in a bash script:</p>
  
  <pre><code>things-hd-91-Statistics.db
  things.things_domain_idx-hd-38-Data.db
  </code></pre>
  
  <p>In bash, how would it be able to get the first part of the string <code>'things'</code> in either case?
  Basically remove the rest of the string past the first <code>-</code> or <code>.</code></p>