On 19 Jun 22:16, Adam Bower wrote:
On Tue, Jun 19, 2012 at 10:27:59AM +0100, Mark Rogers wrote:
This works: mac=$(ifconfig eth0 | grep -Eo '..:..:..:..:..:..' | sed -e 's/://g')
.. but I'm sure there's a better way. Suggestions?
cat /sys/class/net/eth0/address
Surely, you mean...
mac=$(</sys/class/net/eth0/address)
That does rely on the sys filesystem though...