Handling HTML/PHP with sed is always a PITA - but it would be hard to come up with a more pathological example than that (double quotes AND single quotes in the pattern, as well as the usual special characters like / and ?). You will need to escape or bracket (turn into literal character ranges) those - which you do where is partly a matter of style. I *think* that these work:
1) using the sed append (a) command
Code:
$ sed "/<a href=\"tv\/recorded\"><[?]php echo t('Recorded Programs') [?]><\/a>/a\your first new line\nyour second new line" yourfile
2) with the more common sed substitute (s) command (can get rid of the escapes of the slashes by using a different character such as | as the separator)
Code:
$ sed "s|<a href=\"tv/recorded\"><[?]php echo t('Recorded Programs') [?]></a>|&\nyour first new line\nyour second new line|" yourfile
Bookmarks