Broken Snow Leopard Shell --how do I fix?

1

I think I managed to break my Snow Leopard shell, but I'm not sure. Is there a way to reset all env variables to default?

Ritwik Bose

Posted 2010-01-07T08:07:34.053

Reputation: 828

What exactly did you do? – John T – 2010-01-07T08:09:44.173

And what is the error? – Felix – 2010-01-07T08:22:41.197

I was trying to install Sphinx4 from src. I changed a whole bunch of env variables to use the specific java library, but in the process made some bad changes so now no java program runs. – Ritwik Bose – 2010-01-07T10:03:55.143

Answers

1

Close terminal and re-open a new one. Any environments variables you set in the last session will be gone.

If the problem persists, you probably edited ~/.bashrc or ~/.bash_profile; edit them again and remove any changes (or if you want to get right back to the default OS X state, just remove them completely - a default OS X install has these files empty or non-existent).

James Polley

Posted 2010-01-07T08:07:34.053

Reputation: 5 892

1

One of the following:

  • Exit the shell and start it again.
  • Log out and log in.
  • . /etc/bash.bashrc
  • . ~/.bashrc
  • exec bash -i

The two that start with "dot" source your startup files which will reset some of your environment variables (but may make your $PATH variable longer - probably with no consequences).

Paused until further notice.

Posted 2010-01-07T08:07:34.053

Reputation: 86 075

Isn't it ~/.bashrc, not ./bashrc? – user1686 – 2010-01-07T13:37:06.927