Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The $PATH I have when I run terminal in an nX session is different to that I have when I run terminal after logging on physically.

The former is

/home/agrimm/.rbenv/shims:/home/agrimm/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

while the latter is

/home/agrimm/.rbenv/bin:/home/agrimm/.rbenv/shims:/home/agrimm/.rbenv/bin:/home/agrimm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

The latter has /home/agrimm/bin/ while the former doesn't (and yes, I've rebooted since creating /home/agrimm/bin)

I suspect the difference is that .profile is getting run in the latter, but not in the former.

http://askubuntu.com/a/279374/14772 has in the last paragraph:

Non-login shells have login shells (or something that behaves like a login shell) as their parent, and inherit most of their environment variables, including PATH, from this login shell. So putting path-modifying commands in ~/.profile requires that you log out and back in for them to be effective, but it affects the environment of non-login shells too (as well as the environment for programs that are not shells, since every program gets its own set of environment variables--called its "environment"--inherited from its parent process).

I assume that logging in with nX is "something that behaves like a login shell", and that when I run terminal, the parent process of terminal ought to provide it with a complete $PATH, including home/agrimm/bin.

Is my assumption correct? If so, how do I get nX to run .profile?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.