Discussion: sed with /
Afficher un message
Vieux 25/03/2008, 01h59   #2
Janis Papanagnou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: sed with /

zw wrote:
> Hi Gurus
>
> I'm new to sed.
> How does one replace / with // for a string for example
> //filer/test/test2/test3/test4 to become ////filer//test/t/test2//
> test3//test4 ?


Use another delimiter than the usual / in your sed call, e.g. a comma...

sed 's,/,//,g'


Janis

> I have tried a variety like
> TEMP_VAR=`/usr/bin/sed -e 's/\//K/g' //filer/test/test2/test3/test4 `
> and I still can't get it right.
> I'm not sure how to escape /.
>
> Any is appreciated.

  Réponse avec citation
 
Page generated in 0,04251 seconds with 9 queries