I'd like to write a bash script that reads through an html template and inserts a random fortune (or any piece of text) into this template. I've been trying to do this with sed and I can get simple stuff like a date to work. Multiple lines don't seem to work however.
sed "s/DATE/`date`/" test.html > tmp.html
This doesn't work (for the most part):
sed "s/FORTUNE/`fortune -s`/" test.html > tmp.html
n.b. a oneliner works but not multiple line quotes.
After googling this it does seem sed is the tool for the job so I'm wondering what I'm doing wrong. Any advice would be greatly appreciated.