Re: help on ip addr

2007-10-29 Thread Matthew Whipple
lists user wrote: > Hello, > > I want to do the things below: > > a) get all binded IPs on a redhat linux os.there are maybe more than > one IP,like eth0,eth1,eth0:1 etc. > > b) for each IP,I need to know if it's a private network address (like > 192.168.0.1) or a public network address. > > for th

Re: help on ip addr

2007-10-27 Thread John W . Krahn
On Friday 26 October 2007 22:13, lists user wrote: > Hello, Hello, > I want to do the things below: > > a) get all binded IPs on a redhat linux os.there are maybe more than > one IP,like eth0,eth1,eth0:1 etc. Just Ethernet NICs? What about Token Ring? DECNet? Wifi? IP6 tunneled through IP4?

Re: help on ip addr

2007-10-27 Thread tfe
Hello, You should do it, maybe with a regex like that: perl -e '$/=undef; $ips = `ifconfig`; while($ips =~ /(?:^|\n)(\S+)[^\n] +(?:\n\s[^\n])*\n\s+inet addr:(\S+)/gm) { print "$1 is $2\n";}' -- tfe http://tfeserver.homelinux.com On 27 oct, 07:13, [EMAIL PROTECTED] (Lists User) wrote: > Hello, >

help on ip addr

2007-10-26 Thread lists user
Hello, I want to do the things below: a) get all binded IPs on a redhat linux os.there are maybe more than one IP,like eth0,eth1,eth0:1 etc. b) for each IP,I need to know if it's a private network address (like 192.168.0.1) or a public network address. for the first problem I can read something