This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Migrating from MKS to Cygwin

Hi Sarbjit,

pwd is a bash built-in function.
This means, even if you do not have any pwd installed, you still could
call pwd from Bash.
And no matter what pwd you have installed, it will not be called if
you just call "pad" from Bash.
If you use some path though, the installed one is used.
I guess you tested with the Windows port only from Bash, not from the Makefile?
Because I'd think it should work from there, except if it spawns some
Bash process and makes the call there.

Anyways, I'd rather not replace the Cygwin executable by another one
and depend on this.
E. g. If you update, it gets replaced again and behavior changes.
What I'd recommend is, either put the Windows port, or even better a
shellscript - that is called pwd and calls pwd by path and then uses
cygpath to transform the result - earlier in the PATH (e. g.

For the .bat case, I'd either create a symlink beside the .bat or in
/usr/local/bin, or if it does not work, a shellscript that calls the


2015-07-06 8:12 GMT+02:00 Sarbjit singh <>:
> Hi All,
> My organization is evaluating Cygwin as a replacement for MKS. We will
> be using Cygwin primarily for running our regression cases on windows
> (Regression cases are common for Unix and  Windows Platforms). Goal is
> to migrate to Cygwin with minimal changes to be done at regression
> test cases scripts (Makefile etc.).
> So far, the main challenges are  with "pwd" command and  the
> invocation of applications with .bat extension.
> PWD Command:
> There are few regression cases which uses 'pwd' command in the
> Makefile.Since, in the cygwin environment, POSIX paths are returned
> and these are not compatible with the software applications under test
> i.e. the software application is not able to resolve these paths.
> As a workaround, I did the following :
> - Define a bash function in .bashrc file, which internally calls
> cygpath to return windows style paths. This will return the windows
> style paths on bash shell but this function is not available in
> Makefile.
> - So, for Makefile, I have declared macro (makefile variable) and
> using the cygpath to return windows style paths. But, this would
> require changes in the Makefile i.e. to replace 'pwd' with ${PWD}.
> - In order to minimize any changes in the Makefile, I also tried
> downloading the GNU coreutils for Windows port and replacing pwd.exe
> (/usr/bin) with the pwd.exe from coreutils. In this case, if I do pwd,
> then I still get POSIX paths, but if I call pwd.exe with absolute
> path, then it returns windows style paths. I am not sure, why it is
> not working when pwd is called without any path.
> Invocation of applications with .bat extension:
> Second main difference that is observed is that in Cygwin, you have to
> call the application with extension if it is .bat. This works
> seamlessly on MKS.
> Since, the software installation can't be changed to address this
> problem, so far the workarounds are :
> - Create an alias, but again this won't work in Makefile
> - Create a softlink dynamically while running regressions (pre regression setup)
> - Create a file with the application name and call the .bat file. Keep
> these new executable files in a accessible path.
> Queries:
> - Can someone please conform if the workarounds being used are OK. Is
> there any better way of addressing these problems. Any patches for
> both the problems?
> - Why is the pwd not working, when pwd is used from coreutils.
> Thanks in Advance,
> Sarbjit
> --
> Problem reports:
> FAQ:         
> Documentation:
> Unsubscribe info:

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]