title: How can I grep complex strings in variables?
body: <p>I am trying to grep for a small string in a much larger string. Both strings are being stored as variables and here is a code example: </p>
  
  <pre><code>#!/bin/bash
  
  long_str=$(man man)
  shrt_str="guide"
  
  if grep -q $shrt_str $long_str ; then
          echo "Found it!"
  fi
  </code></pre>
  
  <p>I don't think variable expansion is working the way I expect it to. I have tried <code>[ ]</code> and <code>[[ ]]</code>, also quoting the variables and piping the output to <code>/dev/null</code> but no matter what I do it won't work. </p>
  
  <p>Does anyone have any ideas?</p>