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

Re: login, path and ~/.profile



On Fri, Sep 30, 2005 at 11:02:23AM +0100, Jan T. Kim wrote:
> On Fri, Sep 30, 2005 at 08:50:05AM +0200, Benedict Verheyen wrote:
> > Hi,
> > 
> > i was looking to change the prompt of a UML and while i was at it i 
> > noticed something in regards to the path that is set.
> > When logging in these files are processed (used echo to find out)
> > /etc/profile
> > /etc/bash.bashrc
> > ~/.bash_profile
> > ~/.bashrc
> > 
> > This might differ on your system as I:
> > * source /etc/bash.bashrc from /etc/profile
> > * source ~/.bashrc from ~/.bash_profile
> > 
> > When doing su, these files are executed
> > /etc/bash.bashrc
> > ~/.bashrc
> > 
> > As for my questions:
> > 1. Why isn't ~/.profile run?
> 
> The su command does not launch a login shell, and the login scripts
> (/etc/profile and ~/.profile) are only executed by a login shell. That's
> the difference between the two.

Sorry, that was not clear: What I mean is that the difference between
login scripts (/etc/profile and ~/.profile) and startup scripts
(/etc/bashrc and ~/.bashrc) is that login scripts are only executed
by login shells, but not by other shells, whereas the startup scripts
are executed by each shell process upon being launched (unless this
is suppressed).

The difference between /etc/profile and ~/.profile is that the former
is the system-wide login script and the latter is the account-specific
(personal) one, of course.

Best regards, Jan
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |    *NEW*    email: jtk@cmp.uea.ac.uk                               |
 |    *NEW*    WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*



Reply to: