Unfortunately, Windows programs do not understand POSIX pathnames, such as the ones produced by Cygwin, e.g. “/cygdrive/c/some_folder”. Consequently you will run into problems when trying to call Windows applications from within Cygwin, or even when supplying POSIX pathnames to these programs as parameter.
Fortunately, there is an easy way to convert between POSIX pathnames and the ones used by Windows in Cygwin: cygpath to the rescue!
Thus, for instance if you want to require() a file in PHP using an absolute path the following example demonstrates how to make the correct conversion using cygpath:
PHP_REQUIRE="require('$(cygpath -aw $(pwd)/../src/config/base.php)')" echo $PHP_REQUIRE
Or in case you just need a Windows conformant version of $(pwd):
CWD="$(cygpath -aw $(pwd))"
The -a switch tells to produce an absolute path and -w to produce Windows conformant pathnames. That’s it!