1 |
On Wed, 19 Sep 2007 17:03:16 +0200, David Harel wrote: |
2 |
|
3 |
> I was surprised to find that in man bash the reference to initialization |
4 |
> files is wrong. The bash manual says it reads initialization files from |
5 |
> /etc/profile: |
6 |
> FILES |
7 |
> /bin/bash |
8 |
> The bash executable |
9 |
> /etc/profile |
10 |
> The systemwide initialization file, executed for login |
11 |
> shells |
12 |
> |
13 |
> |
14 |
> Where real life uses /etc/bash/bashrc |
15 |
> This part is taken from strace dump: strace bash -i |
16 |
> open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3 |
17 |
|
18 |
It reads both, this is from /etc/profile |
19 |
|
20 |
if [ -n "${BASH_VERSION}" ] ; then |
21 |
# Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 |
22 |
# including color. We leave out color here because not all |
23 |
# terminals support it. |
24 |
if [ -f /etc/bash/bashrc ] ; then |
25 |
# Bash login shells run only /etc/profile |
26 |
# Bash non-login shells run only /etc/bash/bashrc |
27 |
# Since we want to run /etc/bash/bashrc regardless, we source it |
28 |
# from here. It is unfortunate that there is no way to do |
29 |
# this *after* the user's .bash_profile runs (without putting |
30 |
# it in the user's dot-files), but it shouldn't make any |
31 |
# difference. |
32 |
. /etc/bash/bashrc |
33 |
|
34 |
|
35 |
-- |
36 |
Neil Bothwick |
37 |
|
38 |
"Come on! It's a whole new life out there!" |
39 |
"Oh, no. Not another one!" |