.bash_profile not loading
well I am not so much of a newb timewise but this is kind of a newby question...
whenever I reboot my fedora core 12 box I find that my .bash_profile does not load... I have to issue source ~/.bash_profile how do I get this to load automatically each time? thanks! |
Try adding
Code:
source ~/.bash_profile |
I'm trying to understand how the reboot is involved in this situation.
Are you saying that the first time you login after a reboot, you have to manually load your .bash_profile. Then when you login a second or third time, it will load OK on its own? Or do you have the system configured to automatically log you in? |
The .bash_profile is sourced in at login. The .bashrc is source when opening a terminal after a login. You can source the .bashrc from the .bash_profile.
You say that your .bash_profile doesn't get source during login. Can you verify the permissions and ownership? Can you post your .bash_profile just in case there is something funky in it? |
Quote:
|
Quote:
|
.bash_profile help
Hey guys,
Thanks for your help... Well what I really mean is that every time I load my bash environment (reboot or open a terminal) I want to set certain variables so that they turn up the same every time.... Here is my .bash_profile that I would _hope_ loads each time I start yet it does not... Code:
# .bash_profile Code:
Code:
# .bashrc If I do this, I notice that my machine of late SPECTACULARLY fails to log in to it's environment. It can sit there for several minutes until I switch out of the graphical environment to a shell and log in that way. My system is connected to active directory through an LDAP server. If I remove the line 'source .bash_profile' from my .bashrc file this does not seem to happen. And I've noticed, since I've connected this machine to LDAP I get this cryptic series of messages every time I source .bash_profile from the command line... Code:
[bluethundr@harmony ~]$ source ~/.bash_profile Thanks for playing! :-) |
Quote:
Aliases set in the login shell startup files are only inherited if they are exported; an alternative solution is to set them in ~/.bashrc and source ~/.bashrc from one of the login shell startup files. |
I should have asked this at first. Is your default environmental shell even bash? If your default shell isn't bash then it won't even source these files after login.
|
Did you look at your ~.bashrc file in your text editor? If you have check to see that it isn't just being remembered in the shell; which is a case point where you might consider, "WTF?". You variables should load according to what I've read above. I don't see too many cryptic variables there, only what your desktop has set, what you have set (which is as close to cryptic as I can differentiate). I had similar issues with my ~.bashrc profile not loading in the past; it was always sudo related and you may have noticed that I posted elsewhere about "how can I remove sudo (even though I know it is generally ill advised and a lot of people say just disable it)". Your problem could also lie here:
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions Note the whitespace in the line before fi. I was never too good with these lines though. |
oh and ditto the "is your default shell even bash posted above"
|
I'm not quite sure what the issue was meant to be about this line:
Code:
. /etc/bashrc Also, bash is said to look at it's existing environment when it starts and mark all the variables for export. "declare -x" would do exactly that, so that seems perfectly reasonable. bluethundr, when you say that Quote:
I'm probably missing something, because at first blush it appears that you have a .bash_profile which sources your .bashrc. Then you appear to be saying that you added a line such as: Code:
source .bash_profile So as others have asked, what originally made you think that your .bash_profile wasn't getting "sourced" when you login? |
i've noticed from my use of Linux sporadically over the last like, 2 or 3 years that whitespace isn't very welcome when using the BASH shell.
Quote:
Quote:
|
I'm actually finding confusion with the use of bash_profile and ~./bashrc though because I don't recall editing two files in order to set environment variables and aliases. I only remember appending the ~./bashrc file; which I haven't done in some time either because I abandoned Linux for a while after Ubuntu went all crazy and turned gray screens all the time.
|
# Source global definitions
if [ -f /etc/bashrc ]; then . /etc/bashrc fi could it be the lack of a line break in the first line here and the use of whitespace in the second line? |
All times are GMT -5. The time now is 02:17 PM. |