Converting a zsh prompt to bash

Kyrre Nygard kyrreny at broadpark.no
Tue May 16 01:25:13 PDT 2006


Hello!

I have a real nice prompt in zsh however I feel its setting in /etc/zshrc might
be a bit too much to just specify a prompt.

This one, with a real nice color setting:

(kyrre at merhaba)(09:58+16/05)
(%:~)

Requires all this:

PROMPT=$'%{\e[01;36m%}(%{\e[22;36m%}%n%{\e[01;30m%}@'
PROMPT+=$'%{\e[22;36m%}%m%{\e[01;36m%})%{\e[01;36m%}%{\e[01;36m%}('
PROMPT+=$'%{\e[22;36m%}%D{%H:%M}%{\e[01;30m%}+%{\e[22;36m%}%D{%d/%m}'
PROMPT+=$'%{\e[01;36m%})%{\e[01;30m\e[00m%}\n%{\e[01;36m%}('
PROMPT+=$'%{\e[22;36m%}%#%{\e[01;30m%}:%{\e[22;36m%}%~%{\e[01;36m%})'
PROMPT+=$'%{\e[01;30m\e[00m%} '

if [[ `whoami` = root ]] then
         PROMPT=$'%{\e[01;31m%}(%{\e[22;31m%}%n%{\e[01;30m%}@'
         PROMPT+=$'%{\e[22;31m%}%m%{\e[01;31m%})%{\e[01;31m%}%{\e[01;31m%}('
         PROMPT+=$'%{\e[22;31m%}%D{%H:%M}%{\e[01;30m%}+%{\e[22;31m%}%D{%d/%m}'
         PROMPT+=$'%{\e[01;31m%})%{\e[01;30m\e[00m%}\n%{\e[01;31m%}('
         PROMPT+=$'%{\e[22;31m%}%#%{\e[01;30m%}:%{\e[22;31m%}%~%{\e[01;31m%})'
         PROMPT+=$'%{\e[01;30m\e[00m%} '
fi

I was wondering, were I to convert to bash, how would it then look like?

All suggestions welcome,
Kyrre



More information about the freebsd-questions mailing list