in reply to How to insert a new line?

Smells like homework .. buth .. here is one way:
perl -pe '$.==6 and $_.="horse\n"' inp.file > out.file
Assumes you want "horse" AFTER line 6.

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams