#!/bin/sh -e
#
# append_text_top - auto_maintain: append_text_to_top_of_file

error_handler() {
  >&2 echo "Exited with '${2}' in ${0} script at line: ${1}."
  exit "$2"
}
trap 'error_handler ${LINENO} $?' HUP
set -e

text_to_append="$1"
file_to_append_to="$2"
printf '%b' "${text_to_append}" \
  | cat - "${file_to_append_to}" >temp && command mv temp "${file_to_append_to}"
