[plug] Sed regex help

Brad Campbell brad at seme.com.au
Wed Jan 29 16:43:31 WST 2003


G'day all,
I have a script where I need to convert the "\" in dos filenames to "/" 
suitable for feeding to basename.

Lets say

export DOC="C:\BLAH\BLAH\FRED.DOC"
and I want to convert this to C:/BLAH/BLAH/FRED.DOC

Now on the command line
echo $DOC | sed s/\\\\/\//g
gives me the desired output, but in a bash script
DOC2=`echo $DOC | sed s/\\\\/\//g`

gives me the unmodified original string.

What am I doing wrong. I'm sure I'm going to kick myself.

Cheers,
Brad.



More information about the plug mailing list