Paul Ward wrote:
I want to have a promt that changes colour depending on the user that
I have added the following to the /etc/skel.bashrc and my other users
if [ "$USER" == "root" ]; then
PS1="\[\033[0;31m\]\[email protected]\h:\w\\$\[\033[0;37m\] "
PS1="\[\033[0;32m\]\[email protected]\h:\w\\$\[\033[0;37m\] "
this works great through putty but when using a gui the font changes
to grey which is hard to read, this is due to the ansi color 37m, how
can I add a check to see if I am using a putty terminal session or an
X terminal session?
Any one got any other great tips for changing the prompt?
Try to check environment variable TERM.
if [ x"$TERM" = xxterm ]; then
## X terminal session
## other terminal session