[X-Unix] Modifying .bashrc to display dns name of machine I'm logged into

Alexandre Gauthier supernaut at underwares.org
Wed Oct 13 12:50:44 PDT 2004


Our PAl Al wrote:

>On 10/13/04 10:20 AM, "Lewis, Benjamin (Ben)" <blewis3 at lucent.com> wrote:
>
>  
>
>>>Life would be much easier with my hostname in the prompt. How do I do that?
>>>      
>>>
>>Hello Al
>>
>>Try this (stolen from O'Reillys "Learning the bash shell")
>>
>>PS1="\H> "
>>
>>in your .bash_profile file. Or
>>
>>PS1="\h> "
>>
>>for the hostname up to the first dot.
>>
>>Regards
>>
>>    
>>
In a more specific manner, to get something that looks like the default 
red-hat prompt,

PS1="[\u@\h \W]\\$

or to get the prompt I personally love and use (full paths):

PS1='\[\33[1;37\][\!]\[\33[1;32\]\@\:\[\33[1;34\]\ $ \[\33[\]'



-- 
Alexandre Gauthier
supernaut at underwares.org

underwares.org
Obscure IT knowledge Open Database

The human brain operates at only 10% of its capacity. The rest is overhead for
the operating system. 



More information about the X-Unix mailing list