[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: .bashrc



On Thu, Jul 12, 2001 at 10:24:22AM -0700, Greg Wiley wrote:
> On Thursday, July 12, 2001 8:51 AM,  sasaki@solar.com.br spoke:
> > On Thu, Jul 12, 2001 at 10:20:52AM -0500, Larry W. Irwin Sr. wrote:
> > >   [...] having a problem with .bashrc. It works fine as
> > >   root but does not get executed when I log in as a
> > >   user.
> >   maybe you have a .bash_profile file that is taken in place of .bashrc. 
> 
> Also, in case you are in X and launching a term, .bashrc is
> automatically loaded (instead of .bash_profile, .profile,
> .login) when bash is not a login shell.

If you use xdm, the trick is to put this in the start of ~/.xsession:

  if [ -f ~/.bash_profile ]
  then
    . ~/.bash_profile
  fi

Since programs in your x session are usually descendants of ~/.xsession,
they will automatically be run with the right environment settings.

If there is an .xsession file in your home directory, then it is run
by xdm after you have logged in.  You can use it to start a number of
xclients automatically, set the root window color or picture.  When the
.xsession script exits, the xsession is also finished, so the last command
in the script must not have a '&' appended.  Ususally the last command is
"exec $pet_windowmanager" and when that exits, it is expected that the
xsession also exits and returns to the xdm prompt.

If you have no ~/.xsession, xdm will use the system default script, 
/etc/X11/Xsession, that also starts a default session or window manager.

Since I am not a gdm/kdm user, I cannot tell how it works there, but the
idea shoudl be the same, I guess.

Cheers,


Joost



Reply to: