View previous topic :: View next topic |
Author |
Message |
umka69 Tux's lil' helper
Joined: 31 Mar 2013 Posts: 124
|
Posted: Sat May 11, 2013 12:15 pm Post subject: bash PS1 |
|
|
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 |
|
|
lagalopex Guru
Joined: 16 Oct 2004 Posts: 562
|
Posted: Sat May 11, 2013 12:21 pm Post subject: |
|
|
It is set in /etc/bash/bashrc so that should be the right place to modify PS1. |
|
Back to top |
|
|
umka69 Tux's lil' helper
Joined: 31 Mar 2013 Posts: 124
|
Posted: Sat May 11, 2013 12:49 pm Post subject: |
|
|
thank you.
so... If you you need to set PS1 like in "Tron 2" movie 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 |
|
|
|