title: Insert text before a certain line using Bash
body: <p>How can I insert a set of lines (about 5) into a file at the <strong>first place</strong> a string is found?</p>
  
  <p>For example:</p>
  
  <p>BestAnimals.txt</p>
  
  <pre><code>dog
  cat
  dolphin
  cat
  </code></pre>
  
  <p>$ "Insert giraffe to BestAnimals.txt before cat" > NewBestAnimals.txt</p>
  
  <p>NewBestAnimals.txt</p>
  
  <pre><code>dog
  giraffe 
  cat
  dolphin
  cat
  </code></pre>