When I run terminal using the icon on my desktop, I get this error:

-bash: export: `:/System/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin': not a valid identifier

And subsequently, no commands are working (ls, ssh, sudo, rm, cp and so forth). What is happening???

migrated from stackoverflow.com Nov 20 '11 at 1:14

This question came from our site for professional and enthusiast programmers.

  • "When I run terminal"? What does this mean? What exact line are you typing at the terminal prompt. Please Update your question with the exact command and exact response. Please read the markup documentation so that you can format your inputs and outputs exactly, please. – S.Lott Jul 14 '11 at 22:12
  • sounds like a bad /etc/profile (or the osx equivalent) – serotonin Jul 14 '11 at 22:13

Somewhere in your ~/.bashrc or ~/.bash_profile, there is a variable preceded by $ to the left of a = sign. Probably something like this:

export $PATH=...

You should fix it with:

export PATH=
  • or more likely in ~/.profile on OS X. – Simon Jul 14 '11 at 22:17

You've probably set PATH to a bad value. Try to reset it to something sensible:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.