include lines in files
Posted on 2011-10-24
I am requiring some help with a way to to take several directories located in
There are several directories under c:\dhcp\ like
In each directory for example
There is a file named dhcpd.conf
What I am interested in...is the contents of dhcpd.conf looking for any include lines like "/etc/dhcpd/...";
For example in c:\dhcp\r2\dhcpd.conf there are several files in there with varoious names.
The dhcpd.conf file has various stuff in the file, then we hit a line or lines that looks like
#Include R10 Tongass Craig
#Include R10 Tongass Hoonah
If the above matches, I need to append all the includes from all the flies its calling into the master file named dhcpd.conf but rename it to c:\dhcp\r2\dhcpd.conf-r2
As the /etc/.... does not exist where the includes are, perhaps if the script can ignor /etc/ part??
Then move on to the next directory and so on.
Can this perl scripted to where I can run it something like...
I can use cygwin as well if thats easier
Thanks in advance !