Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-30-2003, 09:15 AM   #1
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
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='[\w]\$ ';;
PS2="[$(date +%I:%M) \u \w]\$ \[\033]0;\u \w\007\]" ;;



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
Old 08-30-2003, 09:45 AM   #2
Senior Member
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
u might want to check out dircolors...

try man dircolors
Old 08-30-2003, 06:02 PM   #3
Senior Member
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
Delete the line
local GRAD1=`tty|cut -d/ -f3`

and do
source .bashrc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running GRUB at its prompter grautu Linux - General 6 09-19-2005 09:01 AM
colored vlinks? synaptical LQ Suggestions & Feedback 2 07-15-2005 07:54 PM
colored shell devit Slackware 1 03-15-2004 09:23 AM
colored shell spank Linux - General 3 08-31-2003 02:18 AM
Colored prompter spank Linux - Newbie 1 08-25-2003 01:25 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration