title: Extract part of a string using bash/cut/split
body: <p>I have a string like this:</p>
  <pre><code>/var/cpanel/users/joebloggs:DNS9=domain.example
  </code></pre>
  <p>I need to extract the username (<code>joebloggs</code>) from this string and store it in a variable.</p>
  <p>The format of the string will always be the same with exception of <code>joebloggs</code> and <code>domain.example</code> so I am thinking the string can be split twice using <code>cut</code>?</p>
  <p>The first split would split by <code>:</code> and we would store the first part in a variable to pass to the second split function.</p>
  <p>The second split would split by <code>/</code> and store the last word (<code>joebloggs</code>) into a variable</p>
  <p>I know how to do this in PHP using arrays and splits but I am a bit lost in bash.</p>