Hi Folks,
I have a script that I am using. The files are in Directory c:\files\change\options
In that directory I have many other sub folders like R1 R2 R5 E4 etc...
When I run this script in windows, It looks like its just changing the first folder R1 and not the rest.
Can I get an expert please to see why is not working.
I run it like
perl 2012-Convert-ISC-DHCP-FQDN--to--IP.pl rich-input.txt *
in Cygwin I also tried and same thing. Its just working on one folder
./2012-Convert-ISC-DHCP-FQDN--to--IP-Copy.pl rich-input.txt *
Here is the script
#!/usr/bin/perl
use File::Find;
open F,shift or die $!;
my %ip=map/(\S+)\s+(\S+)/,<F>;
close F;
find sub{
if( -f ){
local @ARGV=($_);
local $^I="";
while( <> ){
/^option\s+domain-name-servers\s.*/ && s/([\w.]*\w)\.?/$ip{$1}||($donthave{$1}=$1)/eg;
print;
}
}
},@ARGV;
print "don't have $_ in my input file\n" for values %donthave;