Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bash shell prompt
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
tcma
Apprentice
Apprentice


Joined: 28 Jun 2004
Posts: 208

PostPosted: Wed Oct 27, 2004 8:28 pm    Post subject: bash shell prompt Reply with quote

My current bash shell prompt is:
bash-2.05b$

How to change it to:
$
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20097

PostPosted: Wed Oct 27, 2004 8:36 pm    Post subject: Reply with quote

Check out Extra informative Bash prompt.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
mhodak
Veteran
Veteran


Joined: 15 Nov 2003
Posts: 1218

PostPosted: Thu Oct 28, 2004 8:16 pm    Post subject: Reply with quote

Basically, PS1 enviromental variable controls prompt. If you want just $ put
Code:
PS1="$"
into your .bashrc and source it (or relogin). But propmt can be used to display useful information, such as username and current working directory.
Back to top
View user's profile Send private message
chiatello
Guru
Guru


Joined: 21 Jul 2003
Posts: 321
Location: knoxvegas, tn, AMERIKA

PostPosted: Thu Oct 28, 2004 10:34 pm    Post subject: Reply with quote

source /etc/profile, gave me the default one (which is like name@computer dir $)
Back to top
View user's profile Send private message
enigma_0Z
Guru
Guru


Joined: 29 Aug 2004
Posts: 531
Location: Either lurking here or at my forum (see sig)

PostPosted: Thu Oct 28, 2004 10:46 pm    Post subject: Reply with quote

mhodak wrote:
Basically, PS1 enviromental variable controls prompt. If you want just $ put
Code:
PS1="$"
into your .bashrc and source it (or relogin). But propmt can be used to display useful information, such as username and current working directory.


Actually, if you want the user-related symbol, you would have to escape the dollar sign:

Code:
PS1="\$"


Then, if you are root, you will get the # symbol, and if you are a user, you will get the $ symbol
_________________
Check out my...
Website: (CURRENTLY DOWN) http://sledgehammer.ath.cx
Forum: (ALSO CURRRENTLY DOWN) http://sledgehammer.ath.cx/forum/
Back to top
View user's profile Send private message
enigma_0Z
Guru
Guru


Joined: 29 Aug 2004
Posts: 531
Location: Either lurking here or at my forum (see sig)

PostPosted: Thu Oct 28, 2004 10:50 pm    Post subject: Reply with quote

I also have a bash prompt related question...

In Eterm, my prompt is this:

Code:
username@hostname workingdirectory $


And if I change to root, it's still that same prompt (but of course with root@hostname)
Or, if I text login (eg. not GDM or KDM) as root, I get the same.

But, if I start Eterm like this:

Code:
Eterm -e 'su'


Then I get this prompt:

Code:
bash-2.05#


why? and how can I fix it?
_________________
Check out my...
Website: (CURRENTLY DOWN) http://sledgehammer.ath.cx
Forum: (ALSO CURRRENTLY DOWN) http://sledgehammer.ath.cx/forum/
Back to top
View user's profile Send private message
chiatello
Guru
Guru


Joined: 21 Jul 2003
Posts: 321
Location: knoxvegas, tn, AMERIKA

PostPosted: Thu Oct 28, 2004 11:43 pm    Post subject: Reply with quote

have to make it

'su -'

not 'su'


it updates the paths env variables or w/e, same thing as doing source /etc/profile
Back to top
View user's profile Send private message
mhodak
Veteran
Veteran


Joined: 15 Nov 2003
Posts: 1218

PostPosted: Fri Oct 29, 2004 1:46 am    Post subject: Reply with quote

enigma_0Z wrote:


But, if I start Eterm like this:

Code:
Eterm -e 'su'


Then I get this prompt:

Code:
bash-2.05#


why? and how can I fix it?


DO what chiatello suggested, i.e. add a line into your .bashrc
Code:
source /etc/profile

AFter this you will have the "username@hostname workingdirectory $" prompt in any terminal.
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