Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <5c8adab704090210405ea696e4@mail.gmail.com> Date: Thu, 2 Sep 2004 13:40:58 -0400 From: Sean Daley Reply-To: Sean Daley To: cygwin AT cygwin DOT com Subject: Re: Re: Problem executing a .bat script in a directory with spaces using bash In-Reply-To: <4137566C.7070203@sbcglobal.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <5c8adab704090207557a3a359a AT mail DOT gmail DOT com> <4137566C DOT 7070203 AT sbcglobal DOT net> X-IsSubscribed: yes Thank you for your most eloquent and considerably rude response. Though maybe that's my fault for not mentioning in my initial email that writing a shell script (which is something that I can do) is not an option. Unfortunately there are reasons why we need these .bat scripts (yes I don't like that and I wish that I could use scripts since they are much more powerful and easier to use) but once again I can't. To give a slightly closer idea of what I'm trying to accomplish: I have a program that can be used to launch native programs. This program can be used to execute batch scripts which are associated with third-party applications. While testing this program linked against cygwin, I ran into the issue documented below. I then thought I'd try to separate my app from the problem so I tested it using cygwin's bash and once again ran into the issue documented below. Now you may not use them (batch scripts) or care about them but I do. Before I delved into src/winsup/cygwin/spawn.cc I thought I would email this list in case someone had something educational to say about the issue. I apologize for making that false assumption. Thanks. Sean On Thu, 02 Sep 2004 10:20:44 -0700, GD wrote: > Sean Daley wrote: > > >I'm currently using cygwin 1.5.10 and I'm having a problem trying to > >run a .bat file in > >a directory with spaces. > > > Geezus, man! You're not going to get a response from the Cygwin list > for shell questions with obvious answers. > > Windows is case insensitive. > *nix systems are case sensitive. > > Windows performs quoting tricks (that no one really understands) behind > the scenes. > *nix systems treats spaces as delimiters > > Windows uses the backslash character to delineate directories > *nix systems and the rest of the world treat the backslash as an escape > character > > To solve your immediate problems: > > -----------cut here-------- > #!/usr/bin/bash > # shell script to echo passed parameter > # scriptname: sean > > if [ $1 ] > then > echo $1 > else > echo "No one here." > fi > --------------------------- > > sean AT home /cygdrive/c > $ mkdir a\ directory\ with\ spaces\ in\ the\ name > > [ sean AT home /cygdrive/c > $ mkdir "a directory with spaces in the name" > > sean AT home /cygdrive/c > $ mkdir 'a directory with spaces in the name' ] > > sean AT home /cygdrive/c > cd "a directory with spaces in the name" > > sean AT home /cygdrive/c/a directory with spaces in the name > $ bash sean foobar > foobar > > And forget the batch files. No one uses them or wants to hear about > them. Write a shell script, write a Perl script, write something more > sensible. Cygwin has provided hundreds of tools for your use. > > Now go read any of the hundreds of shell scripting tutorials available > on the web. > > Cheers. > > -- 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/