[COLUG] ~/.profile

Drew saphetiger at post891.org
Fri Apr 20 15:43:25 EDT 2007


Message: 6
Date: Wed, 18 Apr 2007 15:23:05 -0400
From: Rob Funk <rfunk at funknet.net>
Subject: Re: [COLUG] Best place for modifying path
To: Central OH Linux User Group <colug432 at colug.net>
Message-ID: <200704181523.05287.rfunk at funknet.net>
Content-Type: text/plain;  charset="iso-8859-1"

Tom Hanlon wrote:
> > What is the place and where are the overview docs on that ?

For docs, the standard answers are "man bash" and "pinfo bash".
(pinfo is a friendly info browser, but there are others, including info,
emacs, and konqueror.)

> > /etc/profile seems like the most likely candidate .
> >
> > Will /etc/profile be read when a new console is initiated in an
> > already open xwindow ?

The bash man page on my Ubuntu machine 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....
| 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.

So /etc/bash.bashrc is better than /etc/profile, since /etc/profile only
gets invoked on login shells.

Of course, this assumes everyone uses bash as their shell.  If not, it's
probably best to move back a level to the login sequence, and set it
there.  Trouble there is that there are multiple ways of logging in and
getting a shell (login program, various X display managers, remote shell
such as ssh, other PAM-using system).  /etc/login.defs
and /etc/security/pam_env.conf are two places to look.



Doesn't I thought that ~/.profile superceded /etc/profile.


More information about the colug432 mailing list