I have file.txt that has some content. I want to find a line in file1.txt , if this line matches, I want to replace this line with the contents of file.txt . How can I achieve this?
I tried using sed :
sed -e 's/%d/cat file.txt/g' file1.txt
This is finding the matching string in file1.txt and replacing it with the string cat file.txt , but instead I want the contents of file.txt .
source share