Search Path in Bash
Peter Risdon
peter at circlesquared.com
Mon Mar 1 01:14:10 PST 2004
Gerard Seibert wrote:
>Sunday, February 29, 2004 6:01:48 PM
>
>If I am following you correctly, then having a ~/,bashrc, ~/.bashrc or
>~/.profile file is worthless, if bash reads only the first file that it
>finds.
>
Just a couple more observations:
/etc/profile and ~/.profile are both in fact the configuration files for
sh, but bash reads them, presumably because it is at root a feature-rich
version of sh. Having both shells read the same files would normally be
a good thing on any given system (if you want, say, a non-standard path
in sh you'll probably want it in bash too) and so this is the default
and FreeBSD does not create any of the ~/.bash* files. Therefore, the
~/.profile file is not worthless on a standard installation of FreeBSD,
in fact it _is_ the user config file when an interactive bash shell is
started.
But, as I understand it, if you want to you can override the sh config
for bash while leaving it in place for sh by using a ~/.bash* file.
Different versions of these files match different file naming
conventions of different unixen. But only one such will be read, in a
stated order of precedence, to avoid confusion.
PWR.
More information about the freebsd-questions
mailing list