From: Keith MARSHALL <keith.marshall@to...> - 2005-10-17 08:45:36
Neil J. Mackie wrote:
> Also I was expecting .bash_profile or .bashrc in /msys/home/<user>
> to have some effect, at least thats what my bash book led me to
> believe, but only profile is effective.
I don't know what `bash' book you are citing; the explanation of
this is given in the `bash' manpage, (which unfortunately, is not
distributed with MSYS), but it's quite easy to overlook.
- .profile and .bash_profile are read ONLY when starting `bash' as
a login shell; .bashrc is read otherwise, but not IMPLICITLY by
a login shell.
- .bash_profile is read ONLY if `bash' is started as `bash', but
NOT when it is started in compatibility mode, as `sh', (which is
how it is used in MSYS).
- .profile is read by a login shell, when `bash' is started as `sh',
OR if started as `bash' AND .bash_profile is NOT present.
> So why are only changes to profile effective, and is there any way
> to get the shell to initialise from a file on the hard disk?
You can force reading of ANY other setup file; for example, I like
my login shell to read .bashrc, as well as .profile, so I add
to my .profile file. You can use the same technique to source any
other file, from any accessible device, such as the hard drive in
your CD/RW setup.
You can find the `bash' manpage online, at (amongst others)