Re: Confused about bash profiles and environment settings.

2002-11-18 Thread Lowell Gilbert
Khairil Yusof [EMAIL PROTECTED] writes:

 According to the man, bash loads up for an interactive shell:
 
 /etc/profile
 ~/.bash_profile
 ~/.bash_login
 ~/.profile
 
No, that's not what it says.  It says that it only loads *one* of the
last three, and that it tries them in that order.

The behaviour you've observed matches this description.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Confused about bash profiles and environment settings.

2002-11-18 Thread Matthew Seaman
On Mon, Nov 18, 2002 at 10:43:32PM +0800, Khairil Yusof wrote:

 So bash is getting it's path settings from somewhere else. /etc/profile
 is commented out.
 
 Where else is it getting my path settings from (login.conf?).
 
 I tried changing PATH in that and it doesn't affect anything.

login.conf is probably where your PATH setting originates from.  If
you modify /etc/login.conf, you will have to run

cap_mkdb /etc/login.conf

(as noted at the top of that file) before the changes will come into
force.

/etc/login.conf is the ultimate place where such settings may be
configured.  You can override the settings from there just for your
own account by modifying ~/.login_conf, or you can override the
settings for a particular shell by modifying the appropriate rc files.
You can change settings in .xinitrc (startx) or .xsession (xdm) so
they will only take effect under X windows.  In any case, you're going
to have to log out and log back in again before your session will
reflect the changes you've made.

 However if I cut and paste this path and put it into ~/.bash_profile
 certain commands don't work, and my addition of /usr/local/jdk1.3.1/bin
 finds java, but java fails to run (complaining about missing libs).
 
 On the other hand root which is using csh, if I edit .cshrc and add the
 java path in, everything works just as expected.

~/.bash_profile or ~/.bash_login is sourced one time, at login.
~/.cshrc is sourced each time you start up a new shell.  You can use
~/.bashrc if you want the 'every new shell' behaviour under bash, and
~/.login for the 'once per login session' behaviour under csh.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   26 The Paddocks
  Savill Way
  Marlow
Tel: +44 1628 476614  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message