105

I'm running under Snow Leopard 10.6.8 and I recently added an environment variable which it seems to be messing my bash terminal (I guess).

What I did is add the variable DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.2/lib to my .bash_profile file, which looks like this:

export PATH=/Users/Carlos/pear/bin:$PATH:/Users/Carlos/android-sdks/platforms:/Users/Carlos/android-sdks/platforms-tools:/Library/PostgreSQL/9.2/bin/
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.2/lib

And then run the command:

source ~/.bash_profile

So that now I can see the variable listed along with all the environment variables when I run "set" on the terminal.

The thing is I want to remove it. I've checked several forums and to be honest none of the solutions worked for me so far.

1
  • 1
    Aside from the correct answer by mmmmmm, think of why you had defined the variable in the first place - you must have had a reason for it. I don't know whether the variable makes sense for you productive environment (i.e. using postgresql), but it should not influence or damage your Terminal in any way. Read here about this variable. Commented Jul 17, 2023 at 8:36

1 Answer 1

205

unset it

unset DYLD_LIBRARY_PATH

The bash reference manual says

Once a variable is set, it may be unset only by using the unset builtin command.

1
  • 2
    If you have saved variable in ~/.bash_profile then you need to delete it from there. For example with: nano ~/.bash_profile Commented Jul 17, 2018 at 16:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.