View Single Post
Old 30th July 2008
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

Quote:
Originally Posted by ocicat View Post
As an addendum, I don't deal with ANSI colors on a frequent basis, so remembering all the appropriate sequences isn't something I attempt. Plus, changing or simply debugging the above string has its own set of problems -- especially months, if not years after I originally wrote the code.

My suggestion adding to marcolino's example is to break the string further down into more manageable chunks. What I do is the following:
Code:
green='^[[01;32m'
yellow='^[[01;33m'
blue='^[[01;34m'
no_color='^[[0m'
prefix="${green}\u${yellow}@${green}\h${yellow}:${blue}\w"
char="${yellow} $ ${no_color}"
export PS1="${prefix}${char}"
FWIW.
I don't find my .kshrc file. Can you paste your .kshrc file here? Last thing, where should i put it ?
Reply With Quote