sans-clue has asked for the wisdom of the Perl Monks concerning the following question:
10.1.2.1 myhost 1-4-3-2/0
I'd like to cat to pipe that file and do a perl regex to print only valid ip addresses.
cat file | perl -.......
and the output would in this case be
10.1.2.1
I looked around and just found entire scripts. thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Match Ip Address on cmd line
by NetWallah (Canon) on Sep 09, 2011 at 05:13 UTC | |
by sans-clue (Beadle) on Sep 09, 2011 at 14:03 UTC | |
by halley (Prior) on Sep 09, 2011 at 14:45 UTC | |
by sans-clue (Beadle) on Sep 09, 2011 at 15:43 UTC | |
by RyuMaou (Deacon) on Sep 09, 2011 at 14:58 UTC | |
|
Re: Match Ip Address on cmd line
by afoken (Chancellor) on Sep 09, 2011 at 06:07 UTC | |
|
Re: Match Ip Address on cmd line
by zentara (Cardinal) on Sep 09, 2011 at 10:08 UTC |