Search code examples
bashterminaliterm

Bash prompt not recognizing variables


I'm customizing my bash prompt (I use iTerm on OS X Lion), and have tried something like:

PS1='\n[\u]-> '

Just for simplicity, but after reloading my ~/.bash_profile, my prompt now says:

\n[\u]->

and not what I'm expecting to (a new line, followed by my username).

Any ideas?


Solution

  • How is the shell being invoked? If it's as sh, or possibly other ways, it won't be interpreted. Try echo $0