How to set an Enviroment variable?
Francisco Borges
francisco.borges at gmail.com
Thu Mar 20 09:30:49 UTC 2008
Hello,
On Thu, Mar 20, 2008 at 12:10 AM, Derek Broughton <news at pointerstop.ca> wrote:
> Dario Figueira wrote:
>
> > the subject says it all, in Windows i know how, My Computer proprieties ->
> > advanced and it's there
> > and here? :)
>
> export abc=xyz
> To set a variable for a specific program invocation, you can just use:
>
> # variable=value program
>
> e.g.:
>
> # LANG=fr_CA kate
>
> To set a variable for a user at login, you can use the export command in the
> ~/.bashrc file.
>From the bash manual:
=========
When bash is invoked as an interactive login shell, or as a
non-interactive shell with
the --login option, it first reads and executes commands from the
file /etc/profile,
if that file exists. After reading that file, it looks for
~/.bash_profile,
~/.bash_login, and ~/.profile, in that order,
=========
So as far as I can tell, bash will only read ~/.bashrc when you start
it "interactive non-login", like when you open an x-term, so if the
environment variable is needed for GUI programs which you will start
through your window manager, you should, AFAIK, set the environment
variable in ~/.profile.
Hope that helps.
Cheers,
--
Francisco
More information about the kubuntu-users
mailing list