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: Bash fails to run .bat file with spaces in pathname and argument

Christopher Faylor wrote:
On Wed, Oct 11, 2006 at 07:43:57PM -0700, Johnathon Jamison wrote:
Respectfully, I think I know how shell quoting works. If you look at the sample run, all spaces are properly escaped with either backslashes or double quotes. The problem only surfaces when BOTH the program AND the argument have spaces, AND the program is a .bat file. If you run what I have with only one item containing a space, or use a .sh script, things work. Further, if you look at one of my examples, there is no space in the program being executed; the space is only present in the current working directory, and so clearly the proper quoting of the program is not at issue here.

I have finally found someone else who has come across the same issue:
Apparently this is a bug in cygwin:
Is anybody working on this?

You found a message from more than two years ago and are asking if anyone is working on the problem? You must be a pretty optimistic person.

Yep, the eternal optimist. Still hoping for world peace. ;-)

Cygwin is a linux/UNIX emulation which has some accomodations for native
Windows things like .bat files.

The likelihood that any core cygwin developer is going to want to devote
time or effort into providing workarounds to make things work better for
Windowsisms like .bat files is not high.  So, if a Windowsism doesn't
work the way you want it to then you generally have two options 1)
(preferred) switch to using shell scripts or 2) provide a patch to fix
the behavior.

I was afraid of that. The only reason I pursued it this far was that I did not write the .bat files; my company did, and I came across this during our QA pass. Looks like I will have to add this as a known issue to our docs. Anyway, thanks for the reply.


Lastly, why is CreateProcess used to exec a process instead of _spawnve? It would appear to me on the face of things that _spawnve would get around the quoting issues entirely.


Unsubscribe info:
Problem reports:

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