#!/bin/sh set -euo pipefail usage() { echo 'Usage: feedentry FILENAME.htmlbody' } FILENAME="${1:-}" eval "$(assert-arg -- "$FILENAME" 'FILENAME.htmlbody')" . ./"${FILENAME%.*}.conf" update_xml= if [ -n "${updatedat_iso:-}" ]; then update_xml=" $updatedat_iso " fi cat < $title_html $date_iso $update_xml $url_absolute $author $email EOF head -n5 < "$FILENAME" | htmlesc printf ' \n' printf ' \n' "${url:?}" htmlesc < "$FILENAME" printf ' \n' printf ' \n'