What is the best way to extract the MAC address from ifconfig\'s output?
ifconfig
Sample output:
bash-3.00# ifconfig eth0 eth0 Link
Note: on OS X eth0 may not work. Use p2p0:
ifconfig p2p0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'