which .profile is used

David A. Bandel david
Mon May 17 11:29:58 PDT 2004


On Tue, 16 Apr 2002 17:02:19 -0400
begin  Douglas J Hunley <doug at hunley.homeip.net> spewed forth:

[snip]
> 
> Bandel, you da man! mine if I put this up somewhere on the site? this
> was one of the biggest stumbling blocks learning unix many moons ago,
> and you just gave the most succint explanation I've ever seen

I rather thought it more incoherent babble in one long run-on sentence. 
So I suggest cleaning it up a bit before posting (but I don't claim rights
-- learned this _years_ ago, maybe 15 or so as pertained to the Bourne
shell, don't remember where).  Only place I know it's documented is in one
or more of my books.

I'd try something like this (files that don't exist are ignored):
login shell (SHLVL=1):
/etc/profile
$HOME/.profile
$HOME/.bash_profile

non-login shell (SHLVL>=2):
/etc/bashrc
$HOME/.bashrc

On logout:
/etc/logout
$HOME/.logout
$HOME/.bash_logout

Ciao,

David A. Bandel
-- 
Focus on the dream, not the competition.
		-- Nemesis Racing Team motto



More information about the Linux-users mailing list