Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
/Users/msutherl/src/mdoc/.dist/mdoc/.dist

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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