Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/profile problem?
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
beseech
n00b
n00b


Joined: 31 Aug 2002
Posts: 4

PostPosted: Sun Oct 20, 2002 11:58 am    Post subject: /etc/profile problem? Reply with quote

My /etc/profile looks like this:

Code:

if [ -e "/etc/profile.env" ]
then
  source /etc/profile.env
fi

#077 would be more secure, but 022 is generally quite realistic
umask 022

if [ `/usr/bin/whoami` = 'root' ]
then
        if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
        then
                export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
        fi
        export PATH="/bin:/sbin:/usr/bin:/usr/sbin:${ROOTPATH}"
else
        if [ "$SHELL" = '/bin/bash' ] || [ "$SHELL" = '/bin/sh' ]
        then
                export PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
        fi
        export PATH="/bin:/usr/bin:${PATH}"
fi
unset ROOTPATH
export EDITOR="/usr/bin/nano"

if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
        export INPUTRC="/etc/inputrc"
fi


but when I login as root my bash prompt looks like this:
server root #
and not like this:
server root $

Why is it # and not $? It works fine with all the other users...
Back to top
View user's profile Send private message
Proteus
Guru
Guru


Joined: 14 Jul 2002
Posts: 346
Location: Hamburg, Germany

PostPosted: Sun Oct 20, 2002 12:08 pm    Post subject: Reply with quote

Can it be because you are logged in as root?
I am not 100% sure but I think I once heard that a # sign shows that you are logged in as the superuser.
_________________
Greetings,
Proteus
Back to top
View user's profile Send private message
Larde
Guru
Guru


Joined: 07 Jun 2002
Posts: 313
Location: Duesseldorf, Germany

PostPosted: Sun Oct 20, 2002 12:19 pm    Post subject: Reply with quote

Quote:
Why is it # and not $? It works fine with all the other users...

Short answer: Because you told it so.
Explaining answer: man bash, /PROMPTING, -> \$ if the effective UID is 0, a #, otherwise a $. So if you always want a $, even as root, just use $ and not \$ in PS1.
Uh, that last sentence sounds like gibberish, but I guess you see what I mean. :-)

Hth,
Larde.
_________________
Someday this will be my home... http://moonage.net/
I'll make you a deal
I'll say I came from Earth and my tongue is taped
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