Hi,
In the shell script, i need to remove the special charater "\" with "\\". For example, i need to replace "D:\FXT\ABC.TXT" with "D:\\FXT\\ABC.TXT".
However, when trying to do something like , i get the below error :-
-->echo "D:\FXT\ABC.TXT" | sed -e 's#\#\\#g'
sed: 0602-404 Function s#\#\\#g cannot be parsed.
Can you suggest me why this is wrong , or how to replace the above.
Hi,
Thanks for your reply.
The above is working fine in standalone basis,
When I try to assign this to a variable, the same error comes :-
$1= echo
var1=`echo "D:\FXT\ABC.TXT" | sed 's/\\/\\\\/g'`
sed: 0602-404 Function s/\/\\/g cannot be parsed.
Sometimes quoting backslashes can be tricky and surprising. If quoting them once solved it the first time, I would try quoting them again to solve the same error the second time.
var1=`echo "D:\FXT\ABC.TXT" | sed 's/\\\\/\\\\\\\\/g'`