adding the content of a file to another file

Hi everyone,
I am trying to search for a pattern(in this case copyright) in file A and then add the content of file B under the pattern(copyright) found in file A

i did the following

set var=`cat ~/b`
sed "/copyright/ a\${var}" ~/a

this does it job partially because it does not keep the format of file b. for some reason the new lines are being ignored and all the input of file b are written back to back under the pattern"copyright"

is there anyone who could help me with this?

Use the r command of sed to insert the file:

sed '/copyright/r fileB' fileA

Regards

thanks alot for the command but i think there is something wrong with what you wrote here because it does not really wrok

sed '/copyright/r fileB' fileA >fileC

works for me

check this: Sed - An Introduction and Tutorial

yes
i am really sorry for that. it works just fine, and i also saw the same thing on sed tutorial.
Once again i appreciate your help...