Re: PS1 command prompt bashrc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 Apr 2003, Miguel M wrote:

=>
=>Hi shrike list!
=>
=>In a fresh installation of RHL9 I get variable
=>PS1='\s-\v\$ ' which causes this prompt:
=>
=>-bash-2.05b#
=>
=>
=>I can go back to the usual command prompt with
=>
=>-bash-2.05b# export PS1="[\u@\h \W]\\$ "
=>[root@xxxxxxxxx root]#
=>
=>
=>However that value is lost if I close the session.
=>
=>How can I make that change permanent in a "clean"
=>way (without modifying /etc/bashrc) ?

The PS1 variable is special. Do *not* set it as an environment variable. 
It will be overridden by other factors. The proper place to set it is in 
your .bashrc as a standard (non-env) var. e.g.   PS1="\! > "

The reason you don't export it is because the PS1 variable must be unset 
(by bash) in the event that the shell is non-interactive.

I usually yell at people who set env vars in their .bashrc but in this 
case PS1 is special and it should *not* be set as an env var. It just 
confuses things.

-- 
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question?
steveo at syslang.net





[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux