LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   colored prompter/shell (https://www.linuxquestions.org/questions/linux-newbie-8/colored-prompter-shell-87316/)

spank 08-30-2003 09:15 AM

colored prompter/shell
 
I tried to make my promter colored by adding the next code to the .bashrc file

function myprompt{
local GRAD1=`tty|cut -d/ -f3`
local COLOR1="\[\033[1;34m\]"
local COLOR2="\[\033[0;34m\]"
local COLOR3="\[\033[1;36m\]"
local COLOR4="\[\033[0m\]"
local COLOR5="\[\033[1;32m\]"
local COLOR6="\[\033[0;32m\]"

case $TERM in
*term* | rxvt )
PS1="$COLOR1[$COLOR3\$(date +%I:%M) $COLOR3\u \w$COLOR1]$COLOR3\$$COLOR4 \[\033]0;\u \w\007\]" ;;
*)
PS1="$COLOR1[$COLOR3\$(date +%I:%M) $COLOR3\u \w$COLOR1]$COLOR3\$$COLOR4 "
#PS2="$COLOR2-$COLOR1-$COLOR3-$COLOR4 " ;;
#PS2='[\w]\$ ';;
PS2="[$(date +%I:%M) \u \w]\$ \[\033]0;\u \w\007\]" ;;
esac

}

myprompt

and when I try to open the new shell it gives me the next error:

# bash: /home/spank/.bashrc: line 11: syntax error near unexpected token `local'
# bash: /home/spank/.bashrc: line 11: `local GRAD1=`tty|cut -d/ -f3`'

PS: how can I change the directory ls color.. I have RH9 and the blue color doesn't read very well

Azmeen 08-30-2003 09:45 AM

u might want to check out dircolors...

try man dircolors

darthtux 08-30-2003 06:02 PM

Delete the line
local GRAD1=`tty|cut -d/ -f3`

and do
source .bashrc


All times are GMT -5. The time now is 06:56 AM.