On Thu, May 29, 2003 at 10:31:42PM -0400, Justin Johnson spoke thusly:
> I'm looking to tweak my shell prompt so that it includes the full path
> to the current directory, i.e instead of "[EMAIL PROTECTED] justin]$" I would
> have "[EMAIL PROTECTED] /home/justin]$"

Mine does color and also sets the title on some xterms. here's the
relevant parts :

# .bashrc

# echo "setting up terminal" 
export TERMIMON=`tty|cut -d/ -f3`
export COLOR1="\[\033[1;36m\]"
export COLOR2="\[\033[0;37m\]"
export COLOR3="\[\033[1;37m\]"
export COLOR4="\[\033[1;37m\]"

HOSTNAME=`hostname -s`

# echo "Setting up prompts for $HOSTNAME"

if [ "$BASH" ]; then
  case $OSTYPE in
  linux-gnu)
    PS1="[EMAIL PROTECTED]($COLOR3\w$COLOR2)$COLOR3>$COLOR4 "
    if [ "$TERM" = "dumb" ]; then
       PS1='[EMAIL PROTECTED](\w)\$ '
    fi
    ;; 
  *)
    PS1='[EMAIL PROTECTED](\w)\$ '
    ;;
  esac;
fi

if [ "$TERM" = "xterm" ]; then
    PROMPT_COMMAND='WD=${PWD#$HOME}; if [ "$WD" != "$PWD" ]; then WD="~$WD"; fi; echo 
-ne "\e]0;[EMAIL PROTECTED]:${WD}\007"'
fi

if [ "$TERM" = "Eterm" ]; then
    PROMPT_COMMAND='WD=${PWD#$HOME}; if [ "$WD" != "$PWD" ]; then WD="~$WD"; fi; echo 
-ne "\e]0;[EMAIL PROTECTED]:${WD}\007"'
fi
export PS1 

# echo "Done!"

> I looked through the Red Hat docs and didn't see any pointers, as well
> as Googling on <RedHat prompt customize>.

You probably want to look for "bash prompt customization" or
similar, since this is a bash thing and not Red Hat Linux specific.

-- 
----------------------------------
--         Kevin Sonney         --
--  ICQ: 4855069  AIM: ksonney  --
----------------------------------
320C 0336 3BC4 13EC 4AEC  6AF2 525F CED7 7BB6 12C9
 Reality is that which, when you stop believing in it, doesn't go away
 -- Philip K. Dick

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to