title: How does the leading dollar sign affect single quotes in Bash?
body: <p>I need to pass a string to a program as its argument from the Bash CLI, e.g</p>
  
  <pre><code>program "don't do this"
  </code></pre>
  
  <p>The string may include any character like <code>'$'</code>, <code>'\'</code>, etc. and I don't want Bash to do any modification. So I think about using single quotes.</p>
  
  <p>However the following does not work:</p>
  
  <pre><code> program 'don\'t do this'            //escape doesn't work in single quote
  </code></pre>
  
  <p>While the following two works:</p>
  
  <pre><code> program $'dont\'t do this'          //seems fine, but any other side effects?
   program 'dont'\''do this'           //breaking into 3 parts
  </code></pre>
  
  <p>The first approach seems better in that it acquires less pre modification (put the dollar symbol in front and substitute every <code>\</code> to <code>\\</code>), but I don't know what else the DOLLAR SIGN might do.</p>
  
  <p>I've really googled this but I can't find what I need...</p>