I have these lines to delete in many files, but the sed command on CentoOS doesn't replace the whole sentence.
Example of text:
<!-- insert this +1 -->
<div style="float:left"><g:plusone size="medium" href="http://xxxxx/xx.com"></g:plusone></div>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'it'}
</script>
sed '/<\!-- insert this +1 -->/d' FILENAME.html
sed '/<div style=\"float:left\"><g:plusone size=\"medium\" href=\"http:\/\/xxxxx\/xx.com\"><\/g:plusone><\/div>/d' FILENAME.html
sed '/"<script type=\"text\/javascript\" src=\"https:\/\/apis.google.com\/js\/plusone.js\">/d' FILENAME.html
sed '/{lang: 'it'}/d' FILENAME.html
sed '/<\/script>/d' FILENAME.html
A single command works, but replaces </script>
and other matches in the file.
I tested with |
/ -e
/ perl -0pe
/ a lot of combinations of ''""
, but it doesn't work. How it is possible to replace it by eliminating only that part?