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?<br>

<br>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).<br>

<br><div class="gmail_quote">On Sat, Sep 12, 2009 at 4:27 AM, Markus Hitter <span dir="ltr"><<a href="mailto:mah@jump-ing.de">mah@jump-ing.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
Am 11.09.2009 um 16:02 schrieb Yguaratã C. Cavalcanti:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
is there any way to guess if a environment variable was set by system of if<br>
it was defined by the configuration files?<br>
</blockquote>
<br></div>
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.<div class="im">

<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I imagined that i could to this by parsing some files such as /etc/profile<br>
or ~/profile, for example. However it would require a complete bash script<br>
parser, i guess.<br>
</blockquote>
<br></div>
As you can start another shell in a shell, use bash it's self to interpret it's environment:<br>
<br>
$ bash env<br>
<br>
Bash does distinguish a few modes it can run in: "login shell", "ksh emulation", etc. See the man page for more.<br>
<br>
<br>
Markus<br>
<br>
- - - - - - - - - - - - - - - - - - -<br>
Dipl. Ing. Markus Hitter<br>
<a href="http://www.jump-ing.de/" target="_blank">http://www.jump-ing.de/</a><br>
<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Yguaratã C. Cavalcanti<br><br>M.Sc. in Computer Science - <a href="http://www.cin.ufpe.br">http://www.cin.ufpe.br</a><br>RiSE Researcher - <a href="http://www.rise.com.br/research">http://www.rise.com.br/research</a><br>

------------------------------------------<br>Home page: <a href="http://www.yguarata.com">http://www.yguarata.com</a><br>