1 |
On Wed, 2005-09-14 at 11:15 +0200, Charles Trois wrote: |
2 |
> Hello! |
3 |
> |
4 |
Hi Charles, |
5 |
|
6 |
> I am getting confused with profile, bashrc, etc. |
7 |
> The prompt string I want to use is |
8 |
> |
9 |
> PS1="[\u@\h \W]\$ " |
10 |
> |
11 |
> I therefore wrote it in /etc/profile (at two levels, root and non-root), |
12 |
> ~/.bash_profile and ~/.bashrc. |
13 |
> |
14 |
> If I log in as a plain user (moi), I get this: |
15 |
> |
16 |
> [moi@sirrah moi]$ |
17 |
> |
18 |
> which is all right. But, if I log in as root, I get the basic default |
19 |
> |
20 |
> bash-2.05b# . |
21 |
> |
22 |
> I thought that /etc/profile should provide the default, but I was |
23 |
> obviously wrong. Trying to mend things, I created two files |
24 |
> /root/.bash_profile and /root/.bashrc, writing just PS1 in each. Now, |
25 |
> logging in as root, the result is |
26 |
> |
27 |
> [root@sirrah root]$ |
28 |
> |
29 |
> which is wrong, since "$" appears in place of "#", as though my syntax |
30 |
> of PS1 were incorrect, but I don't see that it is. |
31 |
> |
32 |
> How am I to clean up all this? I'll be grateful for all suggestions. |
33 |
> |
34 |
|
35 |
Put this into /home/user/.profile |
36 |
|
37 |
PS1="[\u@\h \W]$ " |
38 |
|
39 |
and this into /root/.profile |
40 |
|
41 |
PS1="[\u@\h \W]# " |
42 |
|
43 |
And all should be fine. |
44 |
|
45 |
> Charles |
46 |
> |
47 |
> |
48 |
> |
49 |
Greg |
50 |
|
51 |
-- |
52 |
gentoo-user@g.o mailing list |