Jo asked,
| Works great, but also seems to need at least 2 lines in the footer. Is there | a way to make it work for a one line footer?
To make it work for exactly a one-line footer, sure:
TEXT=`cat footer.txt`
but to make it look for the second line of a file with two or more lines but the only line in a one-line file would be nasty in sed. Pick your poison:
TEXT=`sed -e$q -e1d -eq footer.txt` or TEXT=`sed -e2q -e$q -ed footer.txt`
Another way to deal with a one-line footer is to add a blank line above it so that it now is a two-line footer (with a blank first line).