BASH: is it possible to use "\n" in a search command?
I need to find a way to insert a string in a text after a pattern. The problem is that the pattern can not be found in one line, so I would need to tell the command in bash that the second part of the pattern comes in the next line after the first part of the pattern was found. So I tried:
sed -i '/[^ ]*<nta>'\n'<declaration>[^ ]*/ a\string' file.txt
But sadly the sed command like this can't find in the text what I want him to find...
Here is the text (the pattern I'm looking for is highlighted):
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE nta (View Source for full doctype...)>
<declaration>// 971204, Arne, Fredrik, Kim & Paul. // Fairmont Hotel, San Francisco.</declaration>
<name x="32" y="16">Door</name>
Does somebody knows a solution for this?