title: how to get substring, starting from the first occurence of a pattern in bash
body: <p>I'm trying to get a substring from the start of a pattern.</p>
  
  <p>I would simply use <code>cut</code>, but it wouldn't work if the pattern is a few characters long.</p>
  
  <p>if I needed a single-character, delimiter, then this would do the trick:</p>
  
  <pre><code>result=`echo "test String with ( element in parenthesis ) end" | cut -d "(" -f 2-`
  </code></pre>
  
  <p><strong>edit: sample tests:</strong></p>
  
  <pre><code> INPUT: ("This test String is an input", "in")
   OUTPUT: "ing is an input"
  
   INPUT: ("This test string is an input", "in ")
   OUTPUT: ""
  
   INPUT: ("This test string is an input", "n")
   OUTPUT: "ng is an input"
  </code></pre>
  
  <p>note: the parenthesis mean that the input both takes a string, and a delimiter string.</p>