I am using Redhat 4AS and I'm planning to change the default directory (/home/psuser) upon login to /opt/directory/.
This is my .bash_profile entry:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
. ~/test
This is the entry of my test file:
cd /opt/some directory/
However when i logged in using psuser account, im still directed to /home/psuser. Can anyone know what am i doing wrong?
It's not exactly the same. bash executes .bash_profile when you first log in, but if you are in an X session and open a new terminal window, that doesn't necessarily count as a login. Can you add some simple debug statement to your .bash_profile to see when it is actually executed?