Script for IP's

From: rmck (rmckeever@earthlink.net)
Date: Wed Aug 20 2003 - 15:58:44 EDT


Hello,

I have a perl script that opens up a text file and displays the data fine.

My textfile:

111.111.111.1-25|DEPTA
222.222.222.50-60|DEPTB

What I would like to do is have it increment 1 through 25, and 50 through
60, and display that like so:

SO FAR ......
here is the data file hosts.dat:

111.111.111.444|DEPTA
# DEPTB Stuff
222.222.222.1-15|DEPTB
222.222.222.20|DEPTB
# DEPTC INFO
333.333.333.20-25|DEPTC
#
444.444.44.555|DEPTF

here is script "create.pl":

#!/usr/bin/perl -w
 
while (<>) {
 
next if /^#/; # skip comments.
 
 if (/\b-\b/){
 
print;
 
}
}

bash-2.03# ./create.pl host.dat
222.222.222.1-15|DEPTB
333.333.333.20-25|DEPTC
bash-2.03#

WHAT I NEED...
So what im looking at doing is having IP's with "-" print out as so and to
a new file....:
222.222.222.1|DEPTB
222.222.222.2|DEPTB
.
.
222.222.222.15|DEPTB
333.333.333.20|DEPTC
333.333.333.21|DEPTC
.
.
333.333.333.25|DEPTC

Thanks up Front?????????

rob
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:57 EDT