On 07/25/2006 11:29 AM, Leinier C. Salfran wrote:
El mar, 25-07-2006 a las 17:01 +0200, LeVA escribió:
Hi!

I want to make my shell's prompt colourful :)

I'm using pdksh. There are tons of information provided by google, but none of them are working.

Setting my prompt to:
PS1=$'\E[31m'[EMAIL PROTECTED]'\E[1;33m'`hostname -s`:$'\E[0m>'

makes my prompt:
[EMAIL PROTECTED];33mleva:$\E[0m>

The colour codes gets ignored. Is this only working with the original korn shell? Is there colour support for the public domain korn shell?

Thanks!

Daniel

--
LeVA



Hi .. I never used this but I can say you that you are using 'text
strings' in that variable .. Everything you put enclosed in ' and " is a
'text string' in c, perl, php, bash and others.

PS1=$'\E[31m'[EMAIL PROTECTED]'\E[1;33m'`hostname -s`:$'\E[0m>'

The result looks like this
PS1=$'\E[31m'[EMAIL PROTECTED]'\E[1;33m'`hostname -s`:$'\E[0m>'
    $ \E[31m  [EMAIL PROTECTED] \E[1;33m  leva        :$ \E[0m>

Do you see?

Try to eliminate ' and try .. Maybe it works.



I know /zip/ about {pd}ksh, but, in bash, $'text' is a special syntax that recognizes special character codes such as \E (escape). Under bash, that PS1 string works as expected.

LeVA, it looks like you got advice on how to change the prompt color in bash, but you're using it for pdksh; pdksh probably has a completely different way to change the prompt color.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to