Selon Toby 'qubit' Cubitt <[EMAIL PROTECTED]>:

>
> I used to give the shell prompts different colours on different
> machines to help avoid this. Or rather, the local one would always be
> the same colour, but shells under ssh sessions were colour-coded by
> machine.
>
> I've lost the script I wrote for this somewhere in the mists of time
> (if I remember right, it was copied and hacked from a bash prompt
> example that colour-coded according to the login type: ssh, telnet,
> local, etc.)

Here's one I use to make a difference between root (red prompt) and user
(green).
As for other stations, their prompt stays white. Hope it can help :

[ $UID -eq 0 ] && PS1="\e[1;[EMAIL PROTECTED] : \W \! ># \e[0m" || 
PS1="\e[1;[EMAIL PROTECTED] :
\W \! >$ \e[0m"

More readable version
    if test "$UID" = 0 ; then
        PS1="\e[31m\h:\w # \e[0m"
    else
        PS1="[EMAIL PROTECTED]:\w \!>\e[0m "
    fi

-- 
gentoo-user@gentoo.org mailing list

Reply via email to