1 |
As Etaoin Shrdlu said, bash does not even start /etc/profile. Below grep |
2 |
on strace output on bash: |
3 |
$ grep profile /tmp/bash.trace |
4 |
$ |
5 |
$ # My comment, it got nothing |
6 |
$ grep bashrc /tmp/bash.trace |
7 |
open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3 |
8 |
read(3, "# /etc/bash/bashrc\n#\n# This file"..., 2540) = 2540 |
9 |
open("/home/harel/.bashrc", O_RDONLY|O_LARGEFILE) = 3 |
10 |
|
11 |
|
12 |
Neil Bothwick wrote: |
13 |
> On Wed, 19 Sep 2007 17:03:16 +0200, David Harel wrote: |
14 |
> |
15 |
> |
16 |
>> I was surprised to find that in man bash the reference to initialization |
17 |
>> files is wrong. The bash manual says it reads initialization files from |
18 |
>> /etc/profile: |
19 |
>> FILES |
20 |
>> /bin/bash |
21 |
>> The bash executable |
22 |
>> /etc/profile |
23 |
>> The systemwide initialization file, executed for login |
24 |
>> shells |
25 |
>> |
26 |
>> |
27 |
>> Where real life uses /etc/bash/bashrc |
28 |
>> This part is taken from strace dump: strace bash -i |
29 |
>> open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3 |
30 |
>> |
31 |
> |
32 |
> It reads both, this is from /etc/profile |
33 |
> |
34 |
> if [ -n "${BASH_VERSION}" ] ; then |
35 |
> # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1 |
36 |
> # including color. We leave out color here because not all |
37 |
> # terminals support it. |
38 |
> if [ -f /etc/bash/bashrc ] ; then |
39 |
> # Bash login shells run only /etc/profile |
40 |
> # Bash non-login shells run only /etc/bash/bashrc |
41 |
> # Since we want to run /etc/bash/bashrc regardless, we source it |
42 |
> # from here. It is unfortunate that there is no way to do |
43 |
> # this *after* the user's .bash_profile runs (without putting |
44 |
> # it in the user's dot-files), but it shouldn't make any |
45 |
> # difference. |
46 |
> . /etc/bash/bashrc |
47 |
> |
48 |
> |
49 |
> |
50 |
|
51 |
-- |
52 |
Regards. |
53 |
|
54 |
David Harel, |
55 |
|
56 |
================================== |
57 |
|
58 |
Home office +972 77 7657645 |
59 |
Fax: +972 77 7657645 |
60 |
Cellular: +972 54 4534502 |
61 |
Snail Mail: Amuka |
62 |
D.N Merom Hagalil |
63 |
13802 |
64 |
Israel |
65 |
Email: hareldvd@××××××××××××.com |
66 |
|
67 |
|
68 |
-- |
69 |
gentoo-user@g.o mailing list |