Link to home
Start Free TrialLog in
Avatar of eradi
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
Avatar of sgoldgaber
sgoldgaber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
perl -i -pe 'BEGIN{open H,shift or die $!;$h=join"",<H>} print $h if $.==1; close ARGV if eof;' TEXT big/*.c