Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash PS1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 11, 2013 12:15 pm    Post subject: bash PS1 Reply with quote

hi, guys. i am trying to make my bash environment comfortable for me. the question is to set PS1 value like this: " ~ $ ".
I tried todo these lines:
Code:
# echo $PS1
\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
export PS1='\[\033[01;32m\] \w $\[\033[00m\] '
echo $PS1
\[\033[01;32m\] \w $\[\033[00m\]

and a have got what I want. Now I want to set this value to each user in each session. What config file does PS1 locale in?
By the way, I don't like to set PS1 at .bash_profile.
Back to top
View user's profile Send private message
lagalopex
Guru
Guru


Joined: 16 Oct 2004
Posts: 449

PostPosted: Sat May 11, 2013 12:21 pm    Post subject: Reply with quote

It is set in /etc/bash/bashrc so that should be the right place to modify PS1.
_________________
System: AMD Phenom II X4 840, 16GB RAM, NVidia GeForce GT 520, ASUS M4A87TD/USB3, Raid, Seagate Constellation ES
AMD64 system slow/unresponsive during disk access...
Back to top
View user's profile Send private message
umka69
n00b
n00b


Joined: 31 Mar 2013
Posts: 61

PostPosted: Sat May 11, 2013 12:49 pm    Post subject: Reply with quote

thank you. :)
so... If you you need to set PS1 like in "Tron 2" movie 8) you need just to replace two lines in /etc/bash/bashrc:
Code:
        if [[ ${EUID} == 0 ]] ; then
                #PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
                PS1='\[\033[01;32m\] \W \$\[\033[00m\] '
        else
                #PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
                PS1='\[\033[01;32m\] \w \$\[\033[00m\] '
        fi
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum