sporesbash has asked for the wisdom of the Perl Monks concerning the following question:
I am starting with a snippit of my script like this, but i'm running to problems and this doesn't account for the vfiler0 removal.===Base File=== vfiler0 running ipspace: default-ipspace IP address: 10.42.156.16 [e0a] IP address: 10.42.156.19 [bae_test] IP address: 10.42.156.18 [e5a] Path: / [/etc] UUID: 00000000-0000-0000-0000-000000000000 vfiler1 running ipspace: default-ipspace IP address: 123.123.123.123 [unconfigured] Path: /vol/palermo [/etc] UUID: 4fa0d3d8-ecd6-11df-af94-00a09808463c vfilerbae running ipspace: default-ipspace IP address: 123.124.123.123 [unconfigured] Path: /vol/bae_testing [/etc] UUID: 605f7aa8-ecd6-11df-af94-00a09808463c ===Desired Output File=== 123.123.123.123 123.124.123.123
#! /usr/software/bin/perl open (FaHout, ">> /tmp/vflist2.out"); open (FaH, "/tmp/vflist1.out"); while ( <FaH> ) { chomp; if (m/{[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1 +,3}\.[0-9]{1,3}}/) { $ip=$1; print FaHout "$ip\n"; } } close FaH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracing (and excluding) IP's from a file
by samarzone (Pilgrim) on Nov 09, 2010 at 13:52 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by SuicideJunkie (Vicar) on Nov 09, 2010 at 14:05 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by ELISHEVA (Prior) on Nov 09, 2010 at 19:19 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by usr345 (Sexton) on Nov 09, 2010 at 14:16 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by poolpi (Hermit) on Nov 09, 2010 at 14:57 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by sporesbash (Initiate) on Nov 09, 2010 at 14:08 UTC | |
by sporesbash (Initiate) on Nov 09, 2010 at 14:14 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by mjscott2702 (Pilgrim) on Nov 09, 2010 at 15:39 UTC | |
|
Re: Extracing (and excluding) IP's from a file
by suhailck (Friar) on Nov 10, 2010 at 02:40 UTC |