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

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?


Eric Blake wrote:
Hash: SHA1

According to Johnathon Jamison on 10/11/2006 3:11 PM:


I am having some funny behavior.  If I have a .bat file that is in a
directory whose pathname contains a space, and an argument is given to
the .bat file that has a space in it, then the .bat file fails to run.
Instead, I get "'xxx' is not recognized as an internal or external
command, operable program or batch file." where xxx is the portion of
the complete path to the .bat file before the first space.

Sounds like you need to read up on shell quoting.

- --
Life is short - so eat dessert first!

Eric Blake   
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


Unsubscribe info:
Problem reports:

-- Unsubscribe info: Problem reports: Documentation: FAQ:

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