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

Re: [custom] Some issues for custom debian distributions



Re: Re: [custom] Some issues for custom debian distributions ["Nikita V. Youshchenko" <yoush@cs.msu.su>, Sun, Jul 27, 2003 at 08:30:33AM +0400, <9hkvfb.l79.ln@127.0.0.1>]
> > if [ -r $HOME/.profile ] ; then
> >         . $HOME/.profile
> > fi
> 
> Sterictly saying, this is broken.
> /etc/profile, ~/.profile and other login shell rc files should be read by
> logic shells only, so if a user types "startx" on the console, they should
> not be read.

I've got stuff in my .bash_profile that I really only want on login
(finger, mailq on the mailserver etc.), and in fact I would be very
surprised if it were executed (in that case I could as well make a link
.xsession -> .bash_profile :-P). My .bashrc is much more suitable to be
included in .xsession, and in fact I do that.

The problem that one doesn't want things like .bash_completion read
there is easily solved by

	# check whether we run interactively
	[ "$PS1" ] || return

(Something like that exists in Debian's /etc/skel/.bash_profile.)

So test for reading ~/.bashrc should be done first in X startup files,
only reading ~/{.bash_,}profile if the former doesn't exist.

Christoph
-- 
Christoph Berg <cb@df7cb.de>, http://www.df7cb.de
Wohnheim D, 2405, Universität des Saarlandes, 0681/9657944

Attachment: pgpm80NleVRDr.pgp
Description: PGP signature


Reply to: