I needed to cat some files together but I needed a newline between them. I asked my colleague Wan-Ping for a command that would do this and she suggested
cat 1.fa 2.fa 3.fa | sed 's/^>/\n>/g'
So I did this and the sucker added the character 'n' wherever I expected a newline.
It turns out that Macs are special little snow flakes and need a special little command:
cat chr*.fa | sed 's/^>/\'$'\n>/g' > hg38.fa
The magic sauce is the '$' that escapes the '\n'