I want to insert file content at specific pattern match. The following is an example: add file2.txt content in file1.txt between <tag> and </tag>.
file1.txt
<html>
<body>
<tag>
</tag>
</body>
</html>
file2.txt
Hello world!!
I have tried following and it didn't work.
# sed "/\<tag\>/ {
h
r file2.txt
g
N
}" file1.txt
<html>
<body>
Hello World!!
<tag>
</tag>
</body>
</html>