title: Escape dollar sign in string by shell script
body: <p>Suppose I have a script named dd.sh, and I run it like this</p>
  <pre><code>./dd.sh sample$name.mp4
  </code></pre>
  <p>So <code>$1</code> is the string <code>sample$name.mp4</code>.</p>
  <pre><code>echo '$1' // shows $1
  
  echo &quot;$1&quot; // shows &quot;sample.mp4&quot;; want &quot;sample$name.mp4&quot;
  </code></pre>
  <p>Then how to process <code>$1</code> that I can detect whether there is a dollar sign in parameter <code>$1</code></p>
  <p>I want to process the string to <code>sample\$name.mp4</code> or just detect whether there is a dollar sign in parameter <code>$filename</code></p>