$ sed '4 a\
> `grep "key" temp_file`' desired.txt
Try this one. Option a is for after line no. 4. You can also give option i for before line no. 4
Hopefully this should work.
$ sed '4 a\
> `grep "key" temp_file`' desired.txt
Try this one. Option a is for after line no. 4. You can also give option i for before line no. 4
Hopefully this should work.