Command Prompt colors
Hi there
I am using Oracle Enterprise Linux 4.7 (and some servers have 5.x and 6.x but I guess it does not matter). I want to be able to display some information in the unix command prompt in colors. I googled and tried this but it does not work: Code:
export PS1='^[[0;32m^[[1m${HOST}:^[[1;33m${PWD}:^[[0;32m^[[m${ORACLE_SID}^[[0m> ' Code:
^[[0;32m^[[1m:^[[1;33m/export/home/oracle:^[[0;32m^[[1mdevdb1^[[0m> Could someone please help me with thisÉ Thanks so much! |
Hi,
you should replace single ' quotes with double quotes ". Code:
PS1="${USER}@${HOST}:"'${PWD}'"> " good luck. |
Thank you for your response. While I was waiting, I tried this:
Code:
Green="\033[32m" How to fix that please? I am using bash shell. |
It's because the codes are not closed correctly.
Try this prompt: Code:
PS1="(\[\e[33;1;44m\]$WINDOW\[\e[0m\]) [\H:\[\e[33;1;40m\]\u@\[\e[32;1m\]\w\[\e[0m\]] $\[\e[0m\]" Code:
\[\e[0m\] and then modify it to suit yours. You should check here see that you need to set: Code:
tput rmso |
Thanks - how to close the color codes?
I tried your provided code and "(\[\e[33;1;44m\]$WINDOW\[\e[0m\]) " only displays "()". Looks like $WINDOW is not defined. Could you please fix the one I posted? Or let me know how to close the color codes? Thanks a bunch! |
Quote:
PS1="[$Green\u@$Blue$(uname -n)]:$Normal\$PWD: [${Bold}${Red}\${ORACLE_SID}${Normal}]\[\e[0m\] > " but no difference - UP arrows still misbehaves. |
I would try yours like this:
Code:
add |
Quote:
Code:
Green="\033[32m" |
|
Quote:
|
Huh,
I understand you now, but I'm sorry I don't have answer. |
Quote:
|
Quote:
|
Quote:
|
I tried to look at some solutions,
like here (at the bottom) Quote:
and here I hope it helps. |
All times are GMT -5. The time now is 02:54 PM. |