#!/bin/sh set -euo pipefail usage() { echo 'Usage: feedentry FILENAME.htmlbody' } FILENAME="${1:-}" eval "$(assert-arg -- "$FILENAME" 'FILENAME.htmlbody')" . "$(realpath -- "${FILENAME%.*}.conf")" update_xml= if [ -n "${updated_at:-}" ]; then update_iso="$(date -ud "$updated_at" -Is)" update_xml=" $update_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'