我正在尝试搜索并替换以下特定标签:
<@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
同样,我需要在之后删除注释。
任何帮助表示赞赏。
sed 's/.*20975.*/<#-- & -->/' file
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句