Re: GRabbing MAC address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Feb 28, 2008 at 2:56 PM, Max Hetrick <maxhetrick@xxxxxxxxxxx> 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 ' ' -f 11

For the sed people, this should also work :

ifconfig | grep eth0 | sed -e "s/^.*HWaddr \(.*\)$/\1/"

Regards,
Tim

-- 
Tim Verhoeven - tim.verhoeven.be@xxxxxxxxx - 0479 / 88 11 83

Hoping the problem  magically goes away  by ignoring it is the
"microsoft approach to programming" and should never be allowed.
(Linus Torvalds)
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux