View Single Post
Old 06-12-2014, 02:06 PM   #29
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,478
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Okay, yep, that wasn't it at all.

It simply parses /var/local/system/locale & /var/local/system/tzVar to add LANG, LC_ALL & KINDLE_TZ to the env.

Simple testcase with env & environ:

Code:
[root@kindle root]# env -i ./environ 
LANG=en_US.utf8
LC_ALL=en_US.utf8
KINDLE_TZ=GMT+01:38
EDIT: I guess I could have gone with Python, too. meh.

environ.c
Code:
#include <unistd.h>
#include <stdio.h>

extern char **environ;

main()
{
        int i = 0;
        while(environ[i]) {
                printf("%s\n", environ[i++]);
        }
}
env.py
Code:
#!/usr/bin/env python2

import os

for key in os.environ.keys():
    print "%s=%s" % (key,os.environ[key])

Last edited by NiLuJe; 06-12-2014 at 02:18 PM.
NiLuJe is offline   Reply With Quote