by Kiuhrly · 3y ago · 0 comments
sed \
-e '/[/][/]script/r index.js' -e '/[/][/]script/d' \
-e '/ <script defer src="[.][/]index[.]js"><[/]script>/d' \
-e '/[/][*]style[*][/]/r styles.css' -e '/[/][*]style[*][/]/d' \
-e '/ <link rel="stylesheet" href="styles[.]css">/d' \
index.html
The HTML contains something like this: <link rel="stylesheet" href="styles.css">
<style>
/*style*/
</style>
and the script just deletes the <link> tag and replaces the /style/ comment with the contents of styles.css. Definitely not my finest work but it worked well enough.No comments yet.