bash script ? Change PS1 color on per user basis
Been trying to change the color of the shell prompt for each user including root. The things I've tried so far do change the color for each user but don't change the su (root) prompt back to bright red. The su color remains what is set for the user.
The code I've been using is in ~/.bashrc Code:
### colorize user shell prompt: 2/12/10 TTT Admittedly I'm a bash script newbie, normally using c or assembly. Thanks for any help.:Pengy: |
Try this:
Quote:
|
Quote:
That doesn't do what I want. That just changes the "$" for ordinary user with "#" for su(root). The color stays the same. I want to change the color each user selects while retaining the bright red when the user goes su(root). In unmodified bash prompts, the user prompt is the default color (usually black) while the su(root) prompt changes to bright red. Your suggestion did give me some ideas about what to research further. Again, thanks. |
I guess I'm not sure what you're trying to do then. I have my user prompt set to brown. When I enter su, enter password and get root prompt it is red. What exactly do you want to change? The entry I posted above was from my user .bashrc, the following, which as you can see is different, is from my root .bashrc:
Quote:
Don't know if this will help any. |
This is what I use in my bashrc
Code:
export RESET='\e[0m' |
Quote:
|
All times are GMT -5. The time now is 06:09 PM. |