1 |
On Wednesday 19 September 2007, Neil Bothwick wrote: |
2 |
|
3 |
> On Wed, 19 Sep 2007 17:03:16 +0200, David Harel wrote: |
4 |
|
5 |
> > Where real life uses /etc/bash/bashrc |
6 |
> > This part is taken from strace dump: strace bash -i |
7 |
> > open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3 |
8 |
> |
9 |
> It reads both, this is from /etc/profile |
10 |
> |
11 |
> if [ -n "${BASH_VERSION}" ] ; then |
12 |
> # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 |
13 |
> # including color. We leave out color here because not all |
14 |
> # terminals support it. |
15 |
> if [ -f /etc/bash/bashrc ] ; then |
16 |
> # Bash login shells run only /etc/profile |
17 |
> # Bash non-login shells run only /etc/bash/bashrc |
18 |
> # Since we want to run /etc/bash/bashrc regardless, we source |
19 |
> it # from here. It is unfortunate that there is no way to do # this |
20 |
> *after* the user's .bash_profile runs (without putting # it in the |
21 |
> user's dot-files), but it shouldn't make any # difference. |
22 |
> . /etc/bash/bashrc |
23 |
|
24 |
It reads both, but the "Bash non-login shells run only /etc/bash/bashrc" |
25 |
behavior is not documented in man bash. |
26 |
-- |
27 |
gentoo-user@g.o mailing list |