Quote:
Originally posted by pooja
hi!
try this command...........
sed -e 's/\\/\\\\/g' filename > newfilename
hope this will work for u.
--pooja
|
it doesnt:
$abc='\some\var\'
$ res=`print -r $abc | sed -e 's/\\/\\\\/'`
sed: command garbled: s/\/\\/
but I tried this and it works:
$res=`print -r $abc | sed -e 's#\\\\#\\\\\\\\#g'`
+ + print -r \12\13\
+ sed -e s#\\#\\\\#g
res=\\12\\13\\
Needed to escape the backslash twice, once for the shell and then again for sed because i am taking the variable from the print stmt instead of a file.
Thanks,
Rachana.