Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've had a problem with my OSX 10.7 Lion install for some time and I finally took some time to investigate.

The issue is that when running make, I always get an error of the form:

/bin/sh: line 0: cd: [folder]: No such file or directory

This always comes as a surprise because the 'file or directory' is always quite clearly present in the directory and I'm able to cd into it with bash. I finally had the foresight to launch into /bin/sh to try cding into a local build directory. No surprise, it fails:

sh-3.2$ make
mkdir .dist
mkdir .dist/mdoc
tar cf - book.css book.ncx book.xml container.xml css/book.css 
external.png full-head.xml full-tail.xml glossary.xml index.sgml [...]
commands.xml | tar -xf - -C .dist/mdoc
( cd .dist && tar zcf ../mdoc.source.tgz mdoc )
/bin/sh: line 0: cd: .dist: No such file or directory
make: *** [mdoc.source.tgz] Error 1
sh-3.2$ cd .dist
sh: cd: .dist: No such file or directory
sh-3.2$ cd ./.dist
sh-3.2$ pwd

It turns out that I cannot specify paths implicitly with sh. Indeed I had been fixing Makefile by adding explicit paths everywhere by hand.

Does anybody know where this could come from? Could it be that I modified a sh config file somewhere by accident? Could it be a problem with my path?

share|improve this question
up vote 2 down vote accepted

Is it possible there is a conflict with CDPATH? Try:

$ unset CDPATH

and then see if make works?

share|improve this answer
That was it! Thank you. – msutherl Oct 24 '11 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .