Reputation: 2332
I am trying to replace a string in a file1 with a file2
file1.txt
This is first line in file.
file2.txt
Hello world
I am trying to replace "This" word with "Hello World"
file1.txt
Hello world is first line in file.
I tried with sed
sed -i 's/This/`cat file2.txt`\g' file1.txt
cat file2.txt is first line in file.
Upvotes: 2
Views: 435