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
You can expand on that to insert again at line 100. It would be long and ugly, but if it absolutely has to fit on one line for some reason it can be done.