Exporting $PS1.

Ag. Hatzimanikas a.hatzim at gmail.com
Sat Mar 17 23:51:19 PDT 2007


On Sat, Mar 17, at 09:32 David Jensen wrote:
> Ag. Hatzimanikas wrote:
> > would rather see a different color prompt for the root (red) and for 
> > user (green maybe) - for obvious reasons. 
> >
> > if [[ ${EUID} == 0 ]] ; then
> > 	PS1='\e[0;31m\u@\h:\e[0;39m\w\$ '
> > 	else
> > 	PS1='\e[0;32m\u@\h:\e[0;39m\w\$ '
> > fi
> >
> >   
> hmmm, those confuse my cursor, especially in history.  Up-arrow is 
> really a crap shoot.
> 
> I use this, cobbled up from an old, (really old) Gentoo I believe.
> 
> PS1='\[\e[1;32m\]\u [ \[\e[00m\]\w \[\e[1;32m\]]\$ \[\e[00m\]'
> 
> 
> I don't know why the escaped bracing helps. 
> Also the'\e[00m' restores default rather than the \e[0;39m you have used.
> '1;' I use for bright colors.
> 
> whatever

Hi David,
and thanks for the report.

I am not qualified to comment about bash.
Could you take care of this?
Also if you do, have a look to #2314 which is relative. It's assigned to
Dan, but he send us a letter that he will be out of town and I know for
sure he wouldn't have any objection.



More information about the blfs-dev mailing list