dougp23
asked on
Add 2 lines to beginning of 200 files
I have looked at cat, but cat doesn't do it.
I have over 200 php files, and I want to add some GNU/GPL and copyright stuff to each file at the top. I want to be able to fire off a script that will add these 2 lines to all 200 *.php files.
Much thanks.
I have over 200 php files, and I want to add some GNU/GPL and copyright stuff to each file at the top. I want to be able to fire off a script that will add these 2 lines to all 200 *.php files.
Much thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
perl -MTie::File -e 'for( @ARGV ){ tie @a, 'Tie::File', $_ or die $_; unshift @a, "line1","line2"; untie @a }' *.php