我米试图查找和替换特定的标签这是继:SED搜索和替换HTML标记
<@include_page path='/FooServlet' params={'itemType': 'component', 'id': '92', 'componentURI': 'foo:92-20975', 'templateURI': 'ttt:92-1082-32','lazyLoad':'enabled' }/>
I want to replace it with
<#-- <@include_page path='/FooServlet' params={'itemType': 'component', 'id': '92', 'componentURI': 'foo:92-20975', 'templateURI': 'ttt:92-1082-32','lazyLoad':'enabled' }/> -->
我能够与 find . -type f -exec sed -i '/20975/d' {} \;
但是要删除的行,我需要注释掉线条20975
同样,我将需要删除注释掉之后。
任何帮助表示赞赏。
更新了问题。 – DarthVader
'sed'/ 20975/s/^/<# - /'' –
尝试'sed -i'/20975/s/.*/ <#-- & --> /'文件' – SLePort