perl -pe '$.==6 and $_.="horse\n"' inp.file > out.file