#!/bin/bash
# http://s...content-available-to-author-only...r.com/questions/892924/append-text-to-lines-between-two-patterns-every-time-they-appear-in-a-file
sed '/<code>/,\%</code>%s:$:<br/>:' << ':'
some text
some more text
< code>
some code
some more code
</ code>
we are done
heros of the night
< code>
code code code
ka-ching
</ code>
now finally really
done.
:
IyEvYmluL2Jhc2gKIyBodHRwOi8vcy4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uci5jb20vcXVlc3Rpb25zLzg5MjkyNC9hcHBlbmQtdGV4dC10by1saW5lcy1iZXR3ZWVuLXR3by1wYXR0ZXJucy1ldmVyeS10aW1lLXRoZXktYXBwZWFyLWluLWEtZmlsZQoKc2VkICcvPGNvZGU+LyxcJTwvY29kZT4lczokOjxici8+OicgPDwnOicKc29tZSB0ZXh0CnNvbWUgbW9yZSB0ZXh0Cjxjb2RlPgpzb21lIGNvZGUKc29tZSBtb3JlIGNvZGUKPC9jb2RlPgoKd2UgYXJlIGRvbmUKaGVyb3Mgb2YgdGhlIG5pZ2h0Cjxjb2RlPgpjb2RlIGNvZGUgY29kZQprYS1jaGluZwo8L2NvZGU+Cgpub3cgZmluYWxseSByZWFsbHkKZG9uZS4KOgo=