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

On 10/11/06, 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?


Read further down that thread and you'll also see that people discovered some additional horrifying things about windows cmd.

I'm not sure if it was ever fully decided that this was a cygwin bug since
windows cmd can also exhibit similar behavior.

I was the original poster back then.  I eventually just worked around
the issue by
writing a native executable that did the same things the batch job was
supposed to do.  Chris' suggestion of shell scripts also works as well.


Unsubscribe info:
Problem reports:

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