How to replace comma with "\" in a string using sed
2 answers
You need to escape back slash \/
I'm not sure what your input is, but this will work:
echo "teste,test" |sed 's/,/\\/g'
output:
teste\test
Demo: http://ideone.com/JUTp1X
If the line is in a file, you can use:
sed -i 's/,/\//g' myfile.txt
+2
source to share