[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to add a new dir to my PATH?



>>>>> "Wilson" == Marc Wilson <msw@cox.net> writes:

    Wilson> On Mon, Feb 06, 2006 at 01:40:53PM -0200, Bruno Buys
    Wilson> wrote:
    >> Apparently the issue is solved, so thanks for everybody's
    >> inputs. But it looks weird, to me. How come there's
    >> .bash_profile and .bashrc on my home, that aren't read when the
    >> systems loads right to X? Or, I can't set my env, when in X by
    >> any other means...

    Wilson> If you want environment variables set for your X session,
    Wilson> then set them in your ~/.xsession file.  That will work,
    Wilson> unless you use gdm/kdm, which ignore established standards
    Wilson> (after all, they're Gnome and KDE) and implement their
    Wilson> own, separate X startup that only root can modify.

    Wilson> No doubt one of the umpteen idiots who think the X startup
    Wilson> should source the user's bash configuration will chime in
    Wilson> at this point.  Ask them the same thing they get asked
    Wilson> every time... what if the user doesn't use bash?  Even if
    Wilson> he does use a Bourne shell, how are you going to deal with
    Wilson> the difference between a login shell, and a non-login
    Wilson> shell, having different configurations?

And from here we can clearly see the answer ;)

.environment -file in ${HOME} which is sourced by .xsession AND
.bash_profile AND .what_ever_shell_you_are_using_profile . Probably
you can make your GNOME/KDE startup-systems to source it too but I'm
using neither so I don't know for sure.

.bashrc is reserved for only bash-spesific stuff as aliases, functions
and so forth. .bash_profile icludes only two lines:

source ${HOME}/.environment
source ${HOME}/.bashrc

.environment is (or at least my .environment is) basically list of
environment-variables and this approach has worked very well for me :)
Now even Emacs (started under X) knows about my HTTP_PROXY and PATH!

-- 

Perttu Muurimäki
Suunnittelija
Tietopalveluyksikkö
Tilastokeskus
sähköposti: perttu.muurimaki@stat.fi
puh. (09) 1734 3236



Reply to: