title: Position of a string within a string using Linux shell script?
body: <p>If I have the text in a shell variable, say <code>$a</code>:</p>
  
  <pre><code>a="The cat sat on the mat"
  </code></pre>
  
  <p>How can I search for "cat" and return 4 using a Linux shell script, or -1 if not found?</p>