#!/usr/bin/env bash
# Reads HTML file from stdin, prints its content to stdout
# $1 where to start ("text" or "entry")
# $2 where to stop ("text" or "entry")
# $3 "cut" to remove text from
to
# note that this does not remove
line itself,
# so you can see if text was cut or not
declare cut_line
declare cut_tags
declare template_tags_line_header
get_html_file_content() {
awk "//, //{
if (!// && !//) print
if (\"$3\" == \"cut\" && /$cut_line/){
if (\"$2\" == \"text\") exit # no need to read further
while (getline > 0 && !//) {
if (\"$cut_tags\" == \"no\" && /^$template_tags_line_header/ ) print
}
}
}"
}