0

I've used virtualenv to program using my mac terminal for about 1/2 a year w/no issues. Suddenly today I began to get relative path errors when I tried to load python. There was no apparent reason for it, and eventually I tried restarting my computer.

Then I opened a new terminal window, and these new errors were present for the first time:

-bash: eval: line 4: unexpected EOF while looking for matching `"'
-bash: eval: line 5: syntax error: unexpected end of file

I assume the two misbehaviors are related in some way. Any idea what would be causing it? What files could the terminal be looking at that would cause this? AFIAK, I haven't changed anything on which it would depend.

Thx for any advice!

1 Answer 1

1

My guess is that a bash startup file (~/.bashrc, or possibly /etc/profile, ~/.bash_profile, ~/.bash_login or ~/.profile) contains a syntax error, and that causes all sorts of errors for other programs because the setup of the environment they expect does not take place.

From the error message it seems like an unterminated string constant, i.e. a missing ".

The bash manual on startup files has information about this.

You can also try to start bash in debug mode (bash -x (interactive shell) or bash -lx ( login shell)) to try to identify the error.

3
  • Thanks for your suggestion. Can you suggest a tutorial on how to "start bash in debug mode" ? I've googled it but not finding the right steps so far.
    – ouonomos
    Jul 25, 2013 at 6:42
  • Just start your terminal and type bash -x or bash -lx as command - that will start a new bash interpreter. Jul 25, 2013 at 6:52
  • Hmmm, perhaps I'm not communicating well. The errors above happen when I open a mac terminal, and as you say a new bash shell is begun when I type in bash -x in that terminal. But a new terminal doesn't open, so the source of the boot up errors don't appear. Do you know how to see the files that are sourced when the mac terminal boots up? This would tell me where it's reading the offending files. Thanks again!
    – ouonomos
    Jul 25, 2013 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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