I need a general solution, if possible with sed
util, to find a multiline block of text. The text is not known in advance and it might contain specific symbols, so I cannot escape symbols. This block must be considered as a raw text.
Then I need to insert into the file, another block of text, which also might contain different specific chars, not known in advance.
Here is an example. Original file which contains several qq§$<>ui
lines:
line1
line2
qq§$<>ui
klfd</de>
qq§$<>ui
line gg
qq§$<>ui
line aaa
qq§$<>ui
line bbb
lastButOneLine
lastLine
Text to search:
qq§$<>ui
klfd</de>
Text to add after it:
qq§$<>ui
another2ndLine</de>combination
The result:
line1
line2
qq§$<>ui
klfd</de>
qq§$<>ui
another2ndLine</de>combination
qq§$<>ui
line gg
qq§$<>ui
line aaa
qq§$<>ui
line bbb
lastButOneLine
lastLine