Re: [CentOS] GRabbing MAC address

2008-02-29 Thread Dag Wieers
On Fri, 29 Feb 2008, John R Pierce wrote: ip also has a one-line output mechanism: ip -o link show ... I do wish the mothership would update its standard network configuration scripts to use ip(8) rather than the legacy ifconfig(8). Rather than using the legacy eth0:1 style interface a

Re: [CentOS] GRabbing MAC address

2008-02-29 Thread John R Pierce
ip also has a one-line output mechanism: ip -o link show ... I do wish the mothership would update its standard network configuration scripts to use ip(8) rather than the legacy ifconfig(8). Rather than using the legacy eth0:1 style interface aliases, allow a single /etc/sysconfig/ne

Re: [CentOS] GRabbing MAC address

2008-02-29 Thread Dag Wieers
On Thu, 28 Feb 2008, Paul Heinlein wrote: On Thu, 28 Feb 2008, Wojtek Pilorz wrote: On Thu, Feb 28, 2008 at 08:13:17AM -0600, Les Mikesell wrote: Jerry Geis wrote: I am trying to grab the mac address for eth0 on centos 5.1 with ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything.

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Paul Heinlein
On Thu, 28 Feb 2008, Wojtek Pilorz wrote: On Thu, Feb 28, 2008 at 08:13:17AM -0600, Les Mikesell wrote: Jerry Geis wrote: I am trying to grab the mac address for eth0 on centos 5.1 with ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. What am I not doing right? ifconfig | gre

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Wojtek Pilorz
On Thu, Feb 28, 2008 at 08:13:17AM -0600, Les Mikesell wrote: > Jerry Geis wrote: > >I am trying to grab the mac address for eth0 on centos 5.1 with > > > >ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. > > > >What am I not doing right? > > > >ifconfig | grep eth0 | cut -d ' ' -f 1

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread William L. Maltby
On Thu, 2008-02-28 at 08:51 -0500, Toby Bluhm wrote: > Jerry Geis wrote: > > I am trying to grab the mac address for eth0 on centos 5.1 with > > > > ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. > > > > What am I not doing right? > > > > ifconfig | grep eth0 | cut -d ' ' -f 1 give

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Bob Beers
On Thu, Feb 28, 2008 at 8:47 AM, Jerry Geis <[EMAIL PROTECTED]> wrote: > I am trying to grab the mac address for eth0 on centos 5.1 with > > ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. > > What am I not doing right? > > ifconfig | grep eth0 | cut -d ' ' -f 1 gives me eth0 but a

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Stephen Harris
On Thu, Feb 28, 2008 at 08:56:49AM -0500, Max Hetrick wrote: > Toby Bluhm wrote: > > ifconfig | grep eth0 | tr -s ' ' ' ' | cut -d ' ' -f 5 > ifconfig | grep eth0 | cut -d ' ' -f 11 ifconfig | sed -n 's/^eth0.*HWaddr \([^ ]*\).*$/\1/p' -- rgds Stephen ___

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Les Mikesell
Jerry Geis wrote: I am trying to grab the mac address for eth0 on centos 5.1 with ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. What am I not doing right? ifconfig | grep eth0 | cut -d ' ' -f 1 gives me eth0 but anything else like -f 2, -f 3 etc I get nothing. If sed had

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Matt Hyclak
On Thu, Feb 28, 2008 at 08:56:49AM -0500, Max Hetrick enlightened us: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Toby Bluhm wrote: > > > There's multiple spaces in the output that cut is hitting - use tr to > > reduce them. > > > > ifconfig | grep eth0 | tr -s ' ' ' ' | cut -d ' ' -f

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Milton Calnek
ip is probably a better tool (than ifconfig) ip link show eth0 | tr -s " " | cut -d" " -f3 Max Hetrick wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Toby Bluhm wrote: There's multiple spaces in the output that cut is hitting - use tr to reduce them. ifconfig | grep eth0 | tr -s ' ' '

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Tim Verhoeven
On Thu, Feb 28, 2008 at 2:56 PM, Max Hetrick <[EMAIL PROTECTED]> wrote: > Toby Bluhm wrote: > > > There's multiple spaces in the output that cut is hitting - use tr to > > reduce them. > > > > ifconfig | grep eth0 | tr -s ' ' ' ' | cut -d ' ' -f 5 > > Or: > > ifconfig | grep eth0 | cut -d '

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Max Hetrick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Toby Bluhm wrote: > There's multiple spaces in the output that cut is hitting - use tr to > reduce them. > > ifconfig | grep eth0 | tr -s ' ' ' ' | cut -d ' ' -f 5 Or: ifconfig | grep eth0 | cut -d ' ' -f 11 -BEGIN PGP SIGNATURE- Version:

Re: [CentOS] GRabbing MAC address

2008-02-28 Thread Toby Bluhm
Jerry Geis wrote: I am trying to grab the mac address for eth0 on centos 5.1 with ifconfig | grep eth0 | cut -d ' ' -f 5 and I dont get anything. What am I not doing right? ifconfig | grep eth0 | cut -d ' ' -f 1 gives me eth0 but anything else like -f 2, -f 3 etc I get nothing. Jerry The