我有这样sed的 - 文本添加变量
<a href="/site/index.php/Something" title="Something">Something cool</a>, <a href="/site/index.php/Nice_Text" title="Nice Text">Nice Text</a>
some text
<a href="/site/index.php/Apple%27s_text" title="Apple's text">Apple's text</a>
HTML代码,我需要添加点(开始)和.html的(端)的链接得到这个:
<a href="./site/index.php/Something.html" title="Something">Something cool</a>, <a href="./site/index.php/Nice_Text.html" title="Nice Text">Nice Text</a>
some text
<a href="./site/index.php/Apple%27s_text.html" title="Apple's text">Apple's text</a>
我正在玩sed,但我不知道,如何与更改的网址一起工作。 类似于 查找"/site/index.php/
并首次出现"
之前"
将.html
(或之间的变量之后)。
谢谢。
你的假设是正确的。谢谢。 – noideahere