[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Where is Bash Prompt Set??



On Wed, Feb 17, 2010 at 09:48:32AM +0000, Jon Dowland wrote:
> This is a bit slow, mind, if you really want to change the
> text colour for the root user then you should "unwind" the
> control characters instead by preserving the older PS1 and
> keeping track of which control sequences you've "opened":

Working example of this:

    ~root/.bash_login
        OLDPS1="$PS1"
        PS1='\[\e[0;1;31m\]\$ '

    ~root/.bash_logout
        echo -en '\e[0m'
        PS1="$OLDPS1"

Attachment: signature.asc
Description: Digital signature


Reply to: