X sessions and login shells

James Wilkinson ubuntu at westexe.demon.co.uk
Thu Apr 21 16:35:51 UTC 2005


qd989 wrote:
> Out of curiosity, where does gnome pick up the defaults? 
> 
> I put changes in /etc/profile and they were/are never picked up. I even
> resorted to a windows-sytle reboot :-/

Do you mean "where does bash pick up the defaults?"

man bash says:

       When  bash is invoked as an interactive login shell, or as a non-inter-
       active shell with the --login option, it first reads and executes com-
       mands  from  the file /etc/profile, if that file exists.  After reading
       that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
       in  that order, and reads and executes commands from the first one that
       exists and is readable.  The --noprofile option may be  used when  the
       shell is started to inhibit this behavior.

       When  a  login  shell  exits, bash reads and executes commands from the
       file ~/.bash_logout, if it exists.

       When an interactive shell that is not a login shell  is  started, bash
       reads  and  executes  commands  from /etc/bash.bashrc and ~/.bashrc, if
       these files exist.  This may be inhibited by using the  --norc option.
       The  --rcfile  file option will force bash to read and execute commands
       from file instead of /etc/bash.bashrc and ~/.bashrc.

So it should be picking up changes in /etc/profile if you've got bash
set as a login shell.

But I wouldn't recommend changing /etc/profile systemwide unless you
really mean it. Try .bash_profile, or .bashrc if you're not starting a
login shell bash.

Hope this helps,

James.

-- 
E-mail address: james | As Tim switched off the engine, opened the driver's
@westexe.demon.co.uk  | door, undid his seat belt and fell out of the tree,
                      | he decided that perhaps he didn't have the makings
                      | of the best minicab driver.




More information about the ubuntu-users mailing list