I have a small project that takes a HTML template file in it like so;
<p>Hi, I'm some text for this project!</p>
and I want it to be read by my bash script but Sed is escaping out at the closing tag which is less than optimmal;
At the moment it looks like this ($postContents being the above HTML text);
## Replace <!-- TITLE --> in Head > Title and in Headder > H1 with RealName
sed -i "s/{{TITLE}}/$realname/g" $webdir/blog/$basefile
## Replace <!-- DATE --> With webdate
sed -i "s/{{DATE}}/$webdate/g" $webdir/blog/$basefile
## Replace <!-- CONTENTS --> With postContents
sed -i "s/{{CONTENTS}}/"$postContents"/g" $webdir/blog/$basefile
Having manually checked, I'm absolutely sure it's catching on the closing tag. What do I need to do to get this working?