I'm trying write a sed command in bash that updates all references to javascript and css files in an HTML file with $(name).min.js, however I want to ignore files with the word MANAGER_WIDGET in the path e.g.
Replace:
<script type="text/javascript" src="javascript/scripts.js"/>
But not:
`<script type="text/javascript" src="$MANAGER_WIDGET/Common/API/Plugin.js"/>`
So far I've got the following sed command which adds .min to all files js and css files:
sed "s/\.\([jscss]\+\)\"/\.min\.\1\"/g" index.html
It would be great if someone can show me how I can also exclude lines with MANAGER_WIDGET in them.
sed '/MANAGER_WIDGET/!s/\.\([jscss]\+\)\"/\.min\.\1\"/g' index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With