Article 5PPCA Add line before a pattern with sed?

Add line before a pattern with sed?

by
shams
from LinuxQuestions.org on (#5PPCA)
I want to add the line "<div class="mycount2"></div>" just before the "</body>" tag in 6000 xhtml pages, what i tried is this:
Code:sed '/</body>/i <div class="mycont2"></div>' *.xhtmlbut after running the obove code got the error:
Code:sed: -e expression #1, char 12: unknown command: `<'latest?d=yIl2AUoC8zA latest?i=DZXT8qW9UZo:6ZqVafqkjWo:F7zBnMy latest?i=DZXT8qW9UZo:6ZqVafqkjWo:V_sGLiP latest?d=qj6IDK7rITs latest?i=DZXT8qW9UZo:6ZqVafqkjWo:gIN9vFwDZXT8qW9UZo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments