On Friday 16 February 2007 12:40, Jan Engelhardt wrote:
> Hi,
>
> ...
>
> > How could a locale change break a grep for HWaddr ?
> > ...
>
> 21:39 ichi:~ > ifconfig lo
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           ...
>
> 21:39 ichi:~ > LC_MESSAGES=de_DE ifconfig lo
> lo        Protokoll:Lokale Schleife
>           inet Adresse:127.0.0.1  Maske:255.0.0.0
>           ...
>
> 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.

Then perhaps you could fix the locale in the invocation you want to use 
to extract the MAC address (just as you did to generate this example).


Though personally, I think using the system's introspection files 
(e.g., /sys/class/net/eth?/address), while not portable outside Linux, 
is a lot cleaner than scraping information from the output of commands 
that is intended to be read by humans.


>
> Jan


Randall Schulz
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to