Jan Engelhardt wrote:
On Feb 16 2007 16:15, Sylvester Lykkehus wrote:
I could fiddle with `hwinfo --network` or try parse `ip l sh dev br0` output, but what's actually best? [Using sh.]
How about this?
% cat /sys/class/net/eth?/address
Wonderul, many thanks.
Or the long version: /sbin/ifconfig [interface] | grep HWaddr | tail --bytes=20 | head --bytes=17
^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That is what I wanted to avoid because it will totally break when the locale changes.
How could a locale change break a grep for HWaddr ? No really, could you give an example, I never did use another locale than EN. Even if it would, couldn't you export the environment variable first ?
This will work on other dists aswell, where as /sys/class/net/eth?/address does not exists on e.g. debian iirc.
Did you really need to mention the worst example! (Anyway, even debian 3.1r4/2.6.8 has that sysfs file.)
Of course I had to! ;-) Always consider "worst" case scenario :)
Jan
Sylvester -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org