Hi, On Feb 16 2007 21:16, Sylvester Lykkehus wrote:
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 ?
21:39 ichi:~ > ifconfig lo lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:838 errors:0 dropped:0 overruns:0 frame:0 TX packets:838 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:108107 (105.5 Kb) TX bytes:108107 (105.5 Kb) 21:39 ichi:~ > LC_MESSAGES=de_DE ifconfig lo lo Protokoll:Lokale Schleife inet Adresse:127.0.0.1 Maske:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:838 errors:0 dropped:0 overruns:0 frame:0 TX packets:838 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 Sendewarteschlangenlänge:0 RX bytes:108107 (105.5 Kb) TX bytes:108107 (105.5 Kb) As you can see: inet addr:127.0.0.1 Mask:255.0.0.0 inet Adresse:127.0.0.1 Maske:255.0.0.0 and whoops, things like /bin/cut -b or head/tail --bytes are not accurate anymore. Jan -- ft: http://freshmeat.net/p/chaostables/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org