title: Bash - replace escaped characters
body: <p>I have to replace all slashes, antislashes, single and double quotes in a variable, possibly in on pass, with their escaped version:</p>
  
  <pre><code>' --&gt; \'
  " --&gt; \"
  \ --&gt; \\
  / --&gt; \/
  </code></pre>
  
  <p>At this point, I use this to replace single quote:</p>
  
  <pre><code>${MYVAR//\'/\\\'}
  </code></pre>
  
  <p>But I'm stucked when I'm trying to replace slashes, antislashes, single and double quotes in one pass.</p>