how can i add 2 txt file into a different locations of another file?
Hello guys,
I know sed can do this: sed '40r textfile.txt' < aaa.conf > tempfile.txt insert the contents of textfile.txt into line 40 of aaa.conf, but can i insert another text file into aaa.conf on line 100 in one command? thanks very much! |
On my system that command just copies aaa.conf to tempfile.txt
Another option is to use head, cat, and tail Code:
(head -40 aaa.conf && cat textfile.txt && tail -n +41 aaa.conf) > tempfile.txt |
All times are GMT -5. The time now is 12:38 PM. |