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: Re: Problem executing a .bat script in a directory with spaces using bash

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/ 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.



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@home /cygdrive/c
> $ mkdir a\ directory\ with\ spaces\ in\ the\ name
> [  sean@home /cygdrive/c
>    $ mkdir "a directory with spaces in the name"
>    sean@home /cygdrive/c
>    $ mkdir 'a directory with spaces in the name' ]
> sean@home /cygdrive/c
> cd "a directory with spaces in the name"
> sean@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:
Problem reports:

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