[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: daft question



>>>>> Al == Al Hudson <eah106 [at] york.ac.uk> writes:

Al> On Mon, 17 Jan 2000, Stephen J. Turnbull wrote:

>> >>>>> ps == Paul Sims <wulfie [at] wulfric7.co.uk> writes:
ps> for global paths, i.e. everybody gets one, put it
ps> /etc/profile, otherwise /<home>/.profile or even .bashrc for
ps> the adventurous.

>> ~/.bashrc may be necessary for you if your xterms are properly
>> set up (note to wizards: ie, not as login shells).

Al> Nowt wrong with setting xterm as a login shell ;)

It clutters up your finger display and confuses talk quite a bit.

Al> The general rule is, of course, that /bin/sh will only read

I dunno about /bin/sh, I haven't read the POSIX spec, but ...

Al> $HOME/.profile. /bin/bash will only read $HOME/.bashrc, and
Al> '/bin/bash --login' will read both /etc/.bashrc and
Al> $HOME/.bashrc.

... this is not what `man bash' will tell you:

When bash is invoked as an interactive login shell, or as
a non-interactive shell with the --login option, it first
reads and executes commands from the file /etc/profile, if
that file exists. After reading that file, it looks for
~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one
that exists and is readable. The --noprofile option may
be used when the shell is started to inhibit this behav­
ior.

When an interactive shell that is not a login shell is
started, bash reads and executes commands from ~/.bashrc,
if that file exists. This may be inhibited by using the
--norc option. The --rcfile file option will force bash
to read and execute commands from file instead of
~/.bashrc.

When bash is started non-interactively, to run a shell
script, for example, it looks for the variable BASH_ENV in
the environment, expands its value if it appears there,
and uses the expanded value as the name of a file to read
and execute. Bash behaves as if the following command
were executed:
if [ -n $BASH_ENV ]; then . $BASH_ENV; fi
but the value of the PATH variable is not used to search
for the file name.

Got that?

And to further complicate matters, most distributions seem to proceed
to source the rc files from profile files, and sometimes both source a
common third file.

--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
_________________ _________________ _________________ _________________
What are those straight lines for? XEmacs rules.

Start your own FREE mailing list at

&copy; 2000 Microsoft Corporation. All Rights Reserved