Below is a perl script that I wrote a while ago to do pretty much the same
thing to our web site. It should be fairly obvious what you need to change
to apply to your task.
Ben
#!/usr/local/bin/perl -w
##
# Simple script to parse a list of files and change all occurances of one
value to another
# Ben Coughenour - July 1998
##
sub UpdateFile
{
$file = shift @_;
print "Updating $file\n";
my @lines;
open FILEi, "$file" or die "Can't open file $file";
while( <FILEi> )
{
# Using ! instead of normal / operator to accomodate changing directory
names
# format = s!<old_value_reg_exp>!<new_value>!g;
s!http://47.202.33.26:8080/GSFGlobalSystem/Components/Billing/sdm/billing.css!/nma/stylesheets/billing.css!g;
s!http://47.202.33.26:8080/GSFGlobalSeystem/Components/Billing/sdm/!/nma/!g;
push( @lines, "$_");
}
close FILEi;
open FILEo, ">$file" or die "Can't open file $file";
print FILEo @lines;
close FILEo;
}
while( $filename = shift )
{
UpdateFile( $filename );
}
--
Ben Coughenour | 4 am? Already? Oh no, not again!!
[EMAIL PROTECTED] |
(919) 991-7733 |