Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using the default PS1 prompt that MAC OS/Terminal comes with, when you type sh you get a new style prompt.

station-4:~ user$ sh

When you export your own PS1, this functionality goes away. You type sh and you still get the PS1 prompt you specified. Why is this?

station-4:~ user$ export PS1=">>>"
share|improve this question
Try which sh to see what your shell is, and check the result for symlinks. – Kerrek SB Jul 2 '11 at 11:07
up vote 4 down vote accepted

"Export" is the key word. I don't have a Mac myself, but my guess is that its bashrc file doesn't export $PS1, merely sets it, so that bash itself sees the variable but doesn't push it to the environment of new processes. (bash is the default shell used by OS X.)

You can use printenv PS1, env | grep ^PS1 or declare -p PS1 to find out whether a variable is part of the environment. (You will see declare -x if the variable is exported, declare -- otherwise.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.