I installed a program to try it out, and decided I didn't like it so I moved the app to the trash.

Today, in my shell, I noticed that there are a couple of PROGRAMNAME_BLAHBLAH environmental variables set. I'd like to remove those, too.

I don't even have a .bashrc or .bash_login, so I grepped every file I could think of (~/.* ~/Library/* /Library/* /etc/*). The only place these variables turned up was a file ~/.MacOSX/environment.plist, so I removed it from there (Xcode can edit binary plists), but new shells still have these variables set.

What other files does Mac OS X 10.7's terminal/bash run on startup? How might these variables get set?

Or is it something funny like "need to reboot after editing environment.plist"?

  • Can you list some specific examples of env variables you want to get rid of? Might make it easier to identify potential sources. And after changing environment.plist you need at least to logout/login again. – nohillside May 20 '12 at 17:29
  • patrix: Log out, as in "Apple Menu -> Log Out" (as opposed to logging out of the shell)? – Ken May 21 '12 at 4:22
  • Yes, as in "Apple Menu -> Log Out". – nohillside May 21 '12 at 5:43
  • See also How to determine where an environment variable came from (which isn't Mac-specific) – Gilles 'SO- stop being evil' May 21 '12 at 21:05
  • Is there anything we can add to daniel's answer to get your problem sorted out? – bmike Apr 24 '13 at 15:52

~/.MacOSX/environment.plist is read at session start. If you want your change to it to be tested immediatly you have to restart your session.
A restart of the system is useless.
You can edit this environment initialisation file with:

plutil -convert xml1 environment.plist
vi environment.plist

I advise you to simply recover it to its version prior to your software installation.

Other hint, check all the files which were modified on the date of installation of your unwanted software. If you installed your software 15 days ago, you can perform this with:

find / -mtime -16 -mtime +14 -ls

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .