title: Execute a cat command within a sed command in Linux
body: <p>I have a <code>file.txt</code> that has some content. I want to search for a string in <code>file1.txt</code>, if that string is matched I want to replace that string with the content of the <code>file.txt</code>. How can I achieve this?</p>
  
  <p>I have tried using <code>sed</code>:</p>
  
  <pre><code>sed -e 's/%d/cat file.txt/g' file1.txt
  </code></pre>
  
  <p>This is searching for the matching string in the <code>file1.txt</code> and replacing that with the string <code>cat file.txt</code>, but I want contents of <code>file.txt</code> instead.</p>