delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/11/22:44:17

X-Spam-Check-By: sourceware.org
Message-ID: <452DABED.5030409@cs.berkeley.edu>
Date: Wed, 11 Oct 2006 19:43:57 -0700
From: Johnathon Jamison <jjamison AT cs DOT berkeley DOT edu>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060501 Fedora/1.7.13-1.1.fc5
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Bash fails to run .bat file with spaces in pathname and argument
References: <452D5DF0 DOT 9070605 AT cs DOT berkeley DOT edu> <452D8FE7 DOT 9090705 AT byu DOT net>
In-Reply-To: <452D8FE7.9090705@byu.net>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

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:
http://sourceware.org/ml/cygwin/2004-09/msg00081.html
Apparently this is a bug in cygwin:
http://sourceware.org/ml/cygwin/2004-09/msg00145.html
Is anybody working on this?

Johnathon

Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> According to Johnathon Jamison on 10/11/2006 3:11 PM:
> 
>>Hello,
>>
>>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             ebb9 AT byu DOT net
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (Cygwin)
> Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFFLY/n84KuGfSFAYARAm9yAJ974wSz/HMicGxpVa5V5HMd90W6AgCfUfht
> 1MJ1anx8zornyb7X+jKkC3I=
> =5Yj/
> -----END PGP SIGNATURE-----
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019