I can grap a specific line from a file using sed. Is there an easy way to take this line or paragraph and insert onto a specific line in another file?
sed -n 1,10p >> foo appends the result to foo, which places it at the bottom. Is there a standard unix tool to insert onto a specific line?
Perhaps you are looking for
sed‘srcommand?inserts the contents of
file.txtat line 123 ofmain.txt, printing everything to standard output.(If your
sedhas the-ioption, you can make it modifymain.txtdirectly; otherwise, it will not modify its input files.)