My former prompt is this:
PS1='[\u@\h $(x=${PWD%/*}; echo ${x##*/}/${PWD##*/})] \! $ '
That is a monochrome prompt which will dynamically display the last 2 directories in the current working directory. I changed it to this to add colour:
PS1="\[\033[01;32m\]\u@\h\[\033[01;35m\] $(x=${PWD%/*}; echo ${x##*/}/${PWD##*/})\[\033[00m\] \! $ "
The colour works but the directory doesn't change as you cd
around the system. Why not?
This one with single quote works fine :