You are not logged in.
I'm having problems getting one of my systems to source my .bashrc file automatically during login. I have tried everything that I know, but I may have over looked something.
Here is my .bashrc file:
# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] '
I also have the following entry in my .bash_profile:
. $HOME/.bashrc
But when I manually source the .bashrc file it works just fine:
sh-4.1$
sh-4.1$ source ~/.bashrc
[vendion@Baduhena ~]$
As for any other details I'm sure it is not KDE doing this becaue when I log in on a TTY session the file still does not get sourced.
Last edited by vendion (2010-11-15 03:54:14)
Offline
How are you logging in?
Are you in a terminal logging into a shell?
Is bash the shell called out for your user in /etc/passwd? [Could it be zsh, csh, or rsh]
Are you using Slim, Kdm, Gdm or Xdm? [They don't invoke .bashrc, but rather .xinitrc, etc...]
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Have you tried putting:
. $HOME/.bashrc
in simply .profile (rather than .bash_profile)?
Offline
Do both ~/.profile and ~/.bash_profile exist? If so try using only of the two.
Offline
Where or how I log in does not make any difference, I have tried with both TTY sessions and KDM. Yes I have bash set as my shell session. I only have a ~/.bash_profile I can try to rename it to just ~/.profile.
Offline
Ok so renaming .bash_profile to .profile seems to work in a TTY session, but it still is not working with KDE. I don't know what I need to put in .xinitrc if there is anything that I need to, never had to do this before on any of my other systems.
Last edited by vendion (2010-11-15 03:55:52)
Offline
This may sound like a stupid question, but in your .bashrc script, your checking for an interactive shell, Doesn't it need to start with an if? and end with an end?
I am asking because, just suppose that the .bashrc file is being sourced like it should be, only, it is encountering that statement and quietly dieing at that point.
So, what happens if that -z line were commented out?
Knute
Offline
Check how your terminal emulator in kde invokes the shell.
Is it starting bash as sh ? If you run it as sh it tries to mimic the old Bourne shell and doesn't read .bashrc.
And .profile or .bash_profile are only run when bash is started as a login shell. (for example by login, telnet or ssh).
Offline