Trying to change my command prompt in OS X 10.8 / Mountain Lion. Changes to ~/.bashrc and ~/.bash_profile do not make any difference. Like:
export PS1="\W \$"
It defaults to the host name ("\h\%"). Even if I try to set PS1 in the terminal, it changes but displays the variables literally, as below:
ws10% PS1="\W \$"
\W $
(with ws10 being the host name)
My ~/.bashrc file:
export PS1="\W \$ "
Any ideas? I keep getting lost when I cd up and down the directory structure! Thanks a lot.
Best Answer
Typically on Mac OS X, only
.bash_profile
is executing when starting a new terminal. A common solution is to source one file into the other, for example in~/.bashrc
:Apart from that, your example works perfectly fine for me when put in .bash_profile. If you still experience problems, maybe you are overlooking something else?