I need to make a command that finds and replace a directory path with another path, in several HTML files, example of part of the HTML file:
<DIV STYLE="margin-top:6pt;margin-left:36pt;" >< FONT ID="f16" >
<A HREF="file:/export100/DOCS_AB/export200/ab.c" >
file:/export100/DOCS_AB/export200/ab.c</A></FONT></DIV>
<DIV STYLE="margin-top:6pt;margin-left:36pt;" >< FONT ID="f16">
<A HREF="file:/export100/DOCS_CD/export200/cd.c">
file:/export100/DOCS_CD/export200/cd.c</A></FONT></DIV>
The names of the directories change as well as the .C
sources, I tried with the find
and sed
commands like this:
find ./ -name *.html | xargs sed -i 's_/export_/media/pendrive_g'
The problem is that directories and fonts always change the name.
I would like the command to return this:
<DIV STYLE="margin-top:6pt;margin-left:36pt;"><FONT ID="f16">
<A HREF="file:/media/pendrive/"nome_arquivo".c">
file:/media/pendrive/"nome_arquivo".c</A></FONT></DIV>