1

I'm getting extra output on the command line when changing directories in terminal. The output is:

Casey-MacBook-Pro:~ casey$ cd Envs
-bash: command substitution: line 9: syntax error near unexpected token `done'
-bash: command substitution: line 9: `    done'
Caseys-MacBook-Pro:Envs casey$ 

Any idea on what is causing this? Could it be something in my bash profile? This is what my bash profile looks like when I run subl ~/.bash_profile:

# MacPorts Installer addition on 2013-03-02_at_20:37:40: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
source /usr/local/bin/activate.sh

# MacPorts Installer addition on 2015-09-24_at_12:31:24: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.

export STORMPATH_API_KEY_ID=""
export STORMPATH_API_KEY_SECRET=""
export SENDGRID_API_KEY=""
export SECRET_KEY=""
export FLASK_CONFIG=""
export DEV_DATABASE_URL=""
export TEST_DATABASE_URL=""

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH
8
  • What does type cd show? Commented Apr 23, 2016 at 14:29
  • It shows this: cd is a function cd () { autoenv_cd "$@" } Commented Apr 23, 2016 at 14:31
  • Does one of the files ~/Envs/.env or ~/.env exist? If so, could you add their contents to the question? Commented Apr 23, 2016 at 14:35
  • The directory ~/Envs exists but the file .env does not. I tried to edit it and it was a new file. Commented Apr 23, 2016 at 14:37
  • Well either way, you seem to have autoenv installed, and either the autoenv script itself, or a script that gets loaded by it is broken. Contents of /usr/local/bin/activate.sh? Commented Apr 23, 2016 at 14:42

1 Answer 1

1

Sounds like the problem is that virtualenvwrapper.sh is redefining cd into something broken.

Try commenting these out from ~/.bash_profile and opening a new Terminal window.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
source /usr/local/bin/virtualenvwrapper.sh
source /usr/local/bin/activate.sh
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.