5

I receive this error message each time I launch terminal:

-bash: =/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory 
1
  • I would bet that one of the bash_profile files has something like $NONESUCH_VAR=usr/local/bin:$PATH. So the nonexistent variable disappears and the cmd-line tries to "run" =/usr/local/bin:/usr/local/bin:... . Try grep '^$' .profile .bash_profile .... Good luck. Commented Mar 25, 2015 at 3:03

2 Answers 2

3

You have recently edited one of your shell's startup files and introduced an error.

Probably, ls -lart ~/.bashrc ~/.bash_profile ~/.profile will indicate which one -- if one or more is missing, that's no concern, we just want to see which one out of these you have edited recently. Examine the time stamps and try to remember what you did to change one of these files.

The error probably looks something like

$oopsPATH=/usr/local/bin:$PATH 

where you meant to say

PATH=/usr/local/bin:$PATH 

but without access to your files, we can't know what exactly is supposed to be there, or how you messed it up.

See also https://askubuntu.com/questions/198730/how-to-restore-bashrc-file/198740#198740

In the common case where you have messed up your PATH so that ls and other commands are unavailable (bash: ls: command not found), you can use the full path (/bin/ls pro ls, etc; though obviously, you have to know the correct path) at least until you can restore your configuration.

PATH=/usr/local/bin:/usr/bin:/bin 

is probably a good crutch until you can find the correct default for your OS. You can type that at the prompt, or put it in one of your shell's startup files and start a new shell.

On many platforms, you can find the default user dot files in /etc/skel so if that's present (which unfortunately will not be true for Mac OS, but should be there on most Linuxes):

 cp -b /etc/skel/.bash_profile $HOME/ 

will replace your (presumably broken beyond repair) .bash_profile with the system default one. (Omit the -b option if your OS doesn't have it, but then you'll want to back up your file manually before replacing it.)


Update: This fragment near the top of your .bash_profile is erroneous:

#loginPath =/usr/local/bin:$PATH 

Just take it out; it doesn't seem to do anything useful. There seem to be multiple additional fragments from the MacPorts installer which look wrong, too, but they are just comments. (Perhaps somehow they shouldn't be?)

Sign up to request clarification or add additional context in comments.

10 Comments

Thank you. This is what I get when I use the code you suggested: ls: /Users/jeremy/.bashrc: No such file or directory -rw-r--r-- 1 jeremy staff 197 Mar 24 15:23 /Users/jeremy/.profile -rw-r--r-- 1 jeremy staff 956 Mar 24 15:23 /Users/jeremy/.bash_profile
So do you see anything involving PATH in either .profile or .bash_profile? Did you really edit them both recently?
The error message has been there for a long time, and I'm just now trying to figure out how to fix it. I'm running into problems trying to reinstall Homebrew and TTFautohint, and thought maybe this was the root of the problem. Thanks for your help.
Given that the files are small, simply uploading them to pastebin.com and adding a link here might be a good way forward.
I was going to ask about Homebrew and friends, actually; some of these have install scripts which modify your .bashrc and sometimes they manage to mess it up.
|
0

It seems that you are missing a necessary PATH and that is why it is saying no such file or directory. If, for example, you get this error message when typing in python, it would mean either that (1) python isn't installed; or (2) python isn't on your system path.

2 Comments

Thanks. When I $ echo path I get this message. Does that tell you what's not installed correctly? /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/jeremy/bin/FDK/Tools/osx
No, that would not manifest when you start a new terminal, only when you try to run a command. The problem description seems to indicate an error in one of the shell's startup files (probably @shellter hit the nail on the head).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.