Re: Aktuelle IP per Skript auslesen
Tobias Nissen wrote the following on 04.01.2009 20:21
<- *snip* ->
>>>> LANG=C ifconfig ppp0 ...
>>> Oder doch lieber mit LC_ALL=C...
>>>
>>> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#tag_08_02
>> noch besser:
>>
>> LC_ALL=en_US.UTF-8 ...
>>
>> http://people.debian.org/~osamu/pub/getwiki/html/ch09.en.html#thereconfigurationofthelocale
>
> Ein solches Skript wäre aber nicht sehr portabel. Die einzige locale
> auf die man sich verlassen kann ist "C", da diese garantiert auf jedem
> Unix-System existiert.
Guter Einwand. Aber UTF-8 wird zumindest afaik von allen heute gängigen *NIX
unterstützt.
,----[ man 1 locale(1posix) ]-
APPLICATION USAGE
If the LANG environment variable is not set or set to an empty
value, or one of the LC_* environment variables is set to an
unrecognized value, the actual locales assumed (if any) are
implementation-defined as described in the Base Definitions
volume of IEEE Std 1003.1-2001, Chapter 8, Environment Vari‐
ables.
`---------------------------------------------
Ich verstehe das so, das die entsprechende nicht-UTF-8 Applikation einen
fallback macht.
--
bye Thilo
key: 0x4A411E09
Reply to: