Click to See Complete Forum and Search --> : ~/.bash_profile not loading in X


eXtremist
12-11-2001, 12:32 AM
Whenever I run a terminal in X, it doesn't exec my .bash_profile. Does anyone know why? Or how I can set it so that it does?

bdl
12-11-2001, 01:18 AM
It has to do with a non-login shell vs a login shell. I'm not a big authority on it, but I believe if you want an xterm to read a config file, you need to put things in ~/.bashrc instead.

eXtremist
01-15-2002, 12:51 PM
thx

Okie
01-15-2002, 03:56 PM
once my user account got trashed (who knows why) well, anyhow,,, the root account was working fine so a figured that the OS was fine and it was just the normal user account that want bad, so i open /home/user and delete EVERYTHING!!! and logout and log back in and everything was rebuilt with the default values just like the OS was just installed...

i thought that was cool...

this happened with Redhat 7.1 and i cannot guarentee this will fix all distros...

Okie
01-15-2002, 03:59 PM
OH YEAH!!!

P.S. if you decide to do this crazy idea, don't forget to save all your personal data like photos, documents, mp3s,etc...etc...

eXtremist
01-15-2002, 04:25 PM
You can also

cp -r /etc/skel/* /home/user/

it will achieve the same effect..

::EDIT:: Will this copy the 'dot' (.) files too?

[ 15 January 2002: Message edited by: eXtremist ]

Hena
01-15-2002, 05:29 PM
Just to add. If you need to add something in profile files, you can use source command "source ~/.bash_profile" or "source /etc/profile" and it will load the changed version to that terminal. Good for checking if things work as they are supposed to work, without need to do re-login.

[ 15 January 2002: Message edited by: Hena ]

AdaHacker
01-15-2002, 06:46 PM
The easy way to use you .bash_profile from an xterm is to just invoke it with
xterm -ls
The ls stands for "login shell," and will execute ~/.bash_profile on startup. The -ls option works with many other terminal emulators as well, including rxvt, aterm, and Eterm. Set your aliases and shortcuts accordingly, and you'll be all set.