What is the best way to extract the MAC address from ifconfig
's output?
Sample output:
bash-3.00# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 1F:2E:19:10:3B:52
inet addr:127.0.0.66 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
....
....
Should I use cut, AWK or anything else, and what are the merits and demerits of one method over the other.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…