#!/bin/bash
# http://stackoverflow.com/questions/29530441/how-do-you-remove-all-the-lines-between-two-html-tags-using-sed-or-similar

sed '/<HEAD>/,/<\/HEAD>/d' <<':'
<HTML>
<HEAD>
< ... stuff ... ></HEAD>
< ... stuff ... > <!-- keep this -->
</HTML>
: