Question

I'm using Linux Mint. My login shell (cat /etc/passwd | grep myUserName) is bash.

After I start my graphical desktop environment and run terminal emulator from it, I could see that .bash_profile is not sourced (environment vars that export in it is unset). But if I login from text console (ctrl+alt+F1) or manually run bash -l from terminal emulator, .bash_profile works fine.

Am I wrong when I think that .bash_profile should source when X starts and all export'ed vars should be available in terminal, running from X?

Was it helpful?

Solution 2

You can probably change the default command that a new terminal window runs to be a login shell, which would then source your .bash_profile. How to do that is off-topic for Stack Overflow, however.

The other issue is the shells currently started by your terminal emulator inherit their environment not from another login shell, but from your window manager or desktop environment itself. There is probably some configuration file to which you can add environment variables, which will serve the same purpose as .bash_profile. Again, this is specific to your WM/DE and off-topic for Stack Overflow.

OTHER TIPS

Use .bashrc instead of .bash_profile

Here is some explanation: http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top