I am trying to insert some copy information at the beginning of some source files. I know using sed as follows:
sed "1iSome copyrighted information." sample.txt
will insert the text “Some copyrighted information” at the beginning of sample.txt.
I need to insert text from a file at the beginning of sample.txt. Is there any way in sed that I could use the cat for the specified purpose, say something like this:
sed "1i{cat header.txt}" sample.txt
I have googled for the above and did not find exactly what I was looking for. Any help on this is welcome.
Thanks.
bash insert sed
Sriram
source share