title: Merge two HTML files into master HTML file
body: <p>Let's say I have the following HTML files:</p>
  
  <p><strong>html1.html</strong></p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;link href="blah.css" rel="stylesheet" type="text/css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div&gt;this here be a div, y'all&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>html2.html</strong></p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script src="blah.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;span&gt;this here be a span, y'all&lt;/span&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to take these two files and make a master file that would look like this:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;link href="blah.css" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="blah.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div&gt;this here be a div, y'all&lt;/div&gt;
      &lt;span&gt;this here be a span, y'all&lt;/span&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is this possible using a simple Linux command?  I've tried looking at <a href="https://stackoverflow.com/questions/10726471/join-multiple-files">join</a>, but it looks like that joins on a common field, and I'm not necessarily going to have common fields... I just need to basically add the difference, but also have the main structure still intact (I guess this could be referred to as a left-join?).  Doesn't look like <code>cat</code> will work either... as that merges by appending one file, then the next, etc.</p>
  
  <p>If there isn't a simple Linux command, my next step is to either write a script that compares both scripts line by line, or create a master HTML file that references these two individual files somehow.</p>