Guessing environment variables set origin

Yguaratã C. Cavalcanti yguarata at gmail.com
Sat Sep 12 15:28:07 UTC 2009


I forgot something in the initial message, sorry. I would like to guess when
a variable was defined from a system configuration file, like /etc/profile,
or if it was defined by a user configuration file, such as ~/profile. Is it
clear now?

Actually, i am building a GUI application, using pygtk, to configure the
environment variables. Using this GUI, the user could define its own
variables and the system variables (since it has root access, of course).

On Sat, Sep 12, 2009 at 4:27 AM, Markus Hitter <mah at jump-ing.de> wrote:

>
> Am 11.09.2009 um 16:02 schrieb Yguaratã C. Cavalcanti:
>
>  is there any way to guess if a environment variable was set by system of
>> if
>> it was defined by the configuration files?
>>
>
> Well, where exactly do you draw the line between "system" and
> "configuration file"? Ubuntu, as installed from scratch, comes with quite a
> few configuration files and /etc/profile is usually considered as one of
> them.
>
>  I imagined that i could to this by parsing some files such as /etc/profile
>> or ~/profile, for example. However it would require a complete bash script
>> parser, i guess.
>>
>
> As you can start another shell in a shell, use bash it's self to interpret
> it's environment:
>
> $ bash env
>
> Bash does distinguish a few modes it can run in: "login shell", "ksh
> emulation", etc. See the man page for more.
>
>
> Markus
>
> - - - - - - - - - - - - - - - - - - -
> Dipl. Ing. Markus Hitter
> http://www.jump-ing.de/
>
>
>
>
>


-- 
Yguaratã C. Cavalcanti

M.Sc. in Computer Science - http://www.cin.ufpe.br
RiSE Researcher - http://www.rise.com.br/research
------------------------------------------
Home page: http://www.yguarata.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20090912/a854b1a5/attachment.html>


More information about the Ubuntu-devel-discuss mailing list