I am trying to replace a string inside a shell script by a string with special character:
name="test&commit"
echo "{{name}}" | sed "s/{{name}}/$name/g"
and the result I am getting is
test{{name}}commit
I know that adding \ before & will make it work but the name param is given by the user so I'd like my code to somoehow predict that. Do anybody knows how to achieve this ?