Q:

Sed: Append text containing new lines characters after the first line of a file

I am trying to programatically build a changelog by redirecting the output of git shortlog into a CHANGELOG.md file.
My changelog outputs this (abridged): 

Brendan Deere (4):
      Fix dependency conflicts

My changelog File (empty) looks like this:

CHANGELOG
===

The command I am trying to use is: 
sed  "2a $(git shortlog)" ./CHANGELOG.md
But I get this error: sed: -e expression #1, char 30: extra characters after command
What I want is: 

CHANGELOG
===
Brendan Deere (4):
      Fix dependency conflicts

Can someone help connect the dots i'm missing? 

A:

How about something super basic like:
#!/usr/bin/env bash
head -n 2 CHANGELOG.md >CHANGELOG.md.tmp
git shortlog >>CHANGELOG.md.tmp
tail -n +3 CHANGELOG.tmp >> CHANGELOG.md.tmp
rm CHANGELOG.md
mv CHANGELOG.md.tmp CHANGELOG.md

