http://www.perlmonks.org?node_id=389267


in reply to MAC Address of An Interface

Did you say Linux?

Maybe parse it out of the ifconfig output itself?

perl -e '$if=eth0; $mac=(split(/\s+/,qx!/sbin/ifconfig $if!))[4]; prin +t $mac;'


On BSD you'd pull out the "ether" line of ifconfig..