title: How to split a string by underscore and extract an element as a variable in bash?
body: <p>Suppose I have a string such like <code>s=DNA128533_mutect2_filtered.vcf.gz</code>. How could I extract the <code>DNA128533</code> as an ID variable.</p>
  <p>I tried</p>
  <pre><code>id=(cut -d_ -f1 &lt;&lt;&lt; ${s}
  echo $id
  </code></pre>
  <p>It seems not working. some suggestions? Thanks</p>