eradi
asked on
Appending text to multiple files?
I have a directory of C files(BIG Directory) I want to append (or add) a header (my name...etc) at the beginning of each file in the directory. The header is big so I put it in a file TEXT. I don't want to go through each file and copy/paste the header. So what script can I use?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
perl -i -pe 'BEGIN{open H,shift or die $!;$h=join"",<H>} print $h if $.==1; close ARGV if eof;' TEXT big/*.c