Ok, I'll bite.
Given that you have a file with this content:
Code:
cat aline.txt
line_to_copy
You can get that into a variable like this:
Code:
aline=$(cat aline.txt)
echo $aline
line_to_copy
Now, say that you want to insert at line 3 in this file (
to_insert.txt):
Code:
Line 1
Line 2
Line 3
Line 4
Line 5
You can use this sed:
Code:
sed -i.bak "3c $aline" to_insert.txt
Which gets you the following result:
Code:
Line 1
Line 2
line_to_copy
Line 4
Line 5
You will have to implement that in your own script of course.
Best regards,
HMW