On Saturday 13 January 2007 01:28, Jeff Waugh wrote:
> 'su -' will su into a login shell. /etc/profile will be executed as
> will ~/.bash_profile, ~/.bash_login and ~/.profile.
Almost. /etc/profile will be executed first, and then _one_of_ the
other 3 in the ~ directory, specifically the first one of the 3 that
is found, checked in the same order as listed above.
When I was trying to get my head around that last year, I noted the
following pseudo code:
BASH LOGIN SHELL (interactive login or non-interactive with --login)
if [ -z "$opt_noprofile" ]; then
if [ -e /etc/profile ]; then
source /etc/profile
fi
if [ -e ~/.bash_profile ]; then
source ~/.bash_profile
else
if [ -e ~/.bash_login ]; then
source ~/.bash_login
else
if [ -e ~/.profile ]; then
source ~/.profile
fi
fi
fi
fi
--
Barius
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page