Escaping HTML so you can quote it in HTML
Quick tip: How to escape HTML text so that it can be quoted in another piece of HTML, e.g. in a <pre>
tag.
cat index.html | \
sed 's/&/\&/' | \
sed 's/"/\"/' | \
sed 's/</\</' | \
sed 's/>/\>/'
There’s probably a simpler way to do this, but it works for me, so I’m putting it here before I forget.