[NCLUG] Regexp Help

Michael Dwyer mdwyer at sixthdimension.com
Thu Jul 25 12:10:21 MDT 2002


I'm trying to do something that seems sooooo panfully easy to do, but I 
cannot figure it out...

This snippet returns anything in the kernel ring buffer that looks like 
a MAC address:

    dmesg | grep  ..:..:..:..:..:..

So I get lines like:

    foomatic.c Foo Ethernet Driver at 31:33:7b:ee:fc:ab. Initialized.

How, using only tools like grep, awk, sed, printf, cut, etc,  can I get 
ONLY the mac address?  How do I get output like:

   31:33:7b:ee:fc:ab

Am I missing something totally obvious?




More information about the NCLUG mailing list