I want to escape some special chars inside a string automatically. I thought of echoing that string and pipe it through some seds. This doesn\'t seem to work inside of backt
Usually, it's a case of underescaping
FOO=`echo "foo[bar]" | sed 's/\[/\\\[/g'` && echo $FOO