title: cat html structure from .txt into <body> of .html file
body: <p>I have looked across StackOverflow and haven't found an exact answer to my problem. I am no sed master so I would appreciate your help.  </p>
  
  <p>I have 2 files:</p>
  
  <p><strong>header.txt</strong> which contains the bootstrap standard header html structure:  </p>
  
  <pre><code>&lt;nav class="navbar navbar-default"&gt;
      &lt;div class="container-fluid"&gt;
      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
      &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
          &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;/button&gt;
        &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
      &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
        &lt;ul class="nav navbar-nav"&gt;
          &lt;li class="active"&gt;&lt;a href="#"&gt;Link &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;Dropdown &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Another action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Something else here&lt;/a&gt;&lt;/li&gt;
              &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Separated link&lt;/a&gt;&lt;/li&gt;
              &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;One more separated link&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
        &lt;form class="navbar-form navbar-left"&gt;
          &lt;div class="form-group"&gt;
            &lt;input type="text" class="form-control" placeholder="Search"&gt;
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
        &lt;/form&gt;
        &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;Dropdown &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Another action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Something else here&lt;/a&gt;&lt;/li&gt;
              &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Separated link&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>and my <strong>Index.html</strong>:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;meta name="description" content="Free Web tutorials on HTML and CSS"&gt;
    &lt;link href="https://fonts.googleapis.com/css?family=Work+Sans:100,200" rel="stylesheet"&gt;
    &lt;link rel="stylesheet" href="css/bootstrap.min.css"&gt;
    &lt;link rel="stylesheet" href="css/font-awesome/css/font-awesome.min.css"&gt;
    &lt;link rel="stylesheet" href="css/jquery-ui.css"&gt;
    &lt;link rel="stylesheet" href="css/main.css"&gt;
    &lt;title&gt;Document&lt;/title&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
  
  
  
  
    &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
    &lt;script src="js/jquery-ui.js"&gt;&lt;/script&gt;
    &lt;script src="js/bootstrap.min.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script src="js/main.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my script: <strong>addheader</strong>  </p>
  
  <pre><code>#!/bin/bash
  catOut=$(cat header.txt)
  sed "/&lt;body&gt;/ a $catOut" index.html
  </code></pre>
  
  <p>I am trying to append the structure to the body. (I know I need the -i option to actually append) </p>
  
  <p>I keep getting an error with the $catOut because of the &lt; tags in the header.txt file. It's trying to evaluate it or something.</p>
  
  <pre><code>sed: -e expression #1, char 19: unknown command: `&lt;'
  </code></pre>