Hi,
Is it possible to use colors at the "ksh" prompt?
I'm not talking about colorsls.
For example here is my prompt:
PS1='\u@\h:\w$ '
Now, how do I color "ONLY" the user (\u) in red at the prompt?
thanks a lot
didier
Printable View
Hi,
Is it possible to use colors at the "ksh" prompt?
I'm not talking about colorsls.
For example here is my prompt:
PS1='\u@\h:\w$ '
Now, how do I color "ONLY" the user (\u) in red at the prompt?
thanks a lot
didier
"didier" <didier.wiroth (at) mcesr.etat.lu> wrote:[color=blue]
> Is it possible to use colors at the "ksh" prompt?
>
> I'm not talking about colorsls.
>
> For example here is my prompt:
> PS1='\u@\h:\w$ '
> Now, how do I color "ONLY" the user (\u) in red at the prompt?[/color]
PS1='\e[1;31m\u\e[0m@\h:\w$ '
Google for ANSI escape sequences.
You may want to look at ksh's \[ and \] also.
didier <didier.wiroth (at) mcesr.etat.lu> wrote:
[color=blue]
> For example here is my prompt:
> PS1='\u@\h:\w$ '
> Now, how do I color "ONLY" the user (\u) in red at the prompt?[/color]
PS1="\[$(tput setaf 1)\]\u\[$(tput op)\]@\h:\w\$ "
--
Christian "naddy" Weisgerber [email]naddy@mips.inka.de[/email]
thanks a lot!!!