Link to home
Start Free TrialLog in
Avatar of dougp23
dougp23Flag for United States of America

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.

ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

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
perl -MTie::File -e 'for( @ARGV ){  tie @a, 'Tie::File', $_ or die $_; unshift @a, "line1","line2"; untie @a }' *.php