Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bash Prompt structure
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
IcEonFirE
Apprentice
Apprentice


Joined: 15 Aug 2004
Posts: 174

PostPosted: Sun Sep 25, 2005 9:27 pm    Post subject: Bash Prompt structure Reply with quote

HI

I have red some documentation about bash but I still have something I'd like to change a thing;

the prompt is shown like theis [user@hostname ~] i would like to be able of displaying the home directory instead of the
~.

Any idea please ?

Thanks

IcEonFirE
Back to top
View user's profile Send private message
dgaffuri
Advocate
Advocate


Joined: 05 Jun 2005
Posts: 2078
Location: Italy

PostPosted: Sun Sep 25, 2005 9:39 pm    Post subject: Reply with quote

Take a look here
http://www.gentoo.org/doc/en/articles/prompt-magic.xml
Back to top
View user's profile Send private message
IcEonFirE
Apprentice
Apprentice


Joined: 15 Aug 2004
Posts: 174

PostPosted: Tue Sep 27, 2005 3:15 am    Post subject: Reply with quote

Hi

Thanks fo replying but I still got the ~ instead of the current directory. and besides I have discovered another anomalie while i logged in to serial console i prompt color became in white instead of green and blue

any idea please?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9538
Location: beyond the rim

PostPosted: Wed Sep 28, 2005 5:48 am    Post subject: Reply with quote

IcEonFirE wrote:
Hi

Thanks fo replying but I still got the ~ instead of the current directory. and besides I have discovered another anomalie while i logged in to serial console i prompt color became in white instead of green and blue

any idea please?

Well, the bash info pages don't provide an option to show $HOME as a normal dir in the prompt, so it's probably not possible with the normal $PSx vars, however it's possible to get what you want by using PROMPT_COMMAND="pwd", but I really wouldn't recommend it.
As for the other issue, serial consoles generally don't support colors AFAIK.
Back to top
View user's profile Send private message
alok_singhal
n00b
n00b


Joined: 22 Apr 2003
Posts: 61

PostPosted: Wed Sep 28, 2005 6:02 am    Post subject: Reply with quote

Code:
export PS1='$PWD: \$ '
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