I want to replace all single quotes in a string with two single quotes using sed. But when the string contains the & character, the sed command is not repla
&
It's easier to answer if you post your code, but I'm guessing you're not escaping the ampersand. Change & to \& if you want a literal ampersand.
\&
See section 3.1.2 of The sed FAQ for a more detailed explantion, if you're curious.