how to replace single escape char with double using sed : <p>I would like to replace single escape char \ with double \ using sed
However when I use</p>

<pre><code>`echo $regex | sed 's/\\/\\\\/g'`
</code></pre>

<p>it returns 
sed: -e expression #1, char 8: unterminated `s' command
is there a solution for this?</p>
