cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Repository broken?


From: Johan Holmberg
Subject: Re: Is Repository broken?
Date: Mon, 28 Jan 2002 14:30:38 +0100 (MET)

On Mon, 28 Jan 2002, Nadim Khemir wrote:
>
> 2/ cygwin problem( response to Johan Holmberg).
> Sure cmd.exe is not much better still it is a little better as it reconizes
> quotes properly. (I might have an old version of cywin but not that old)
>

You should note that the following (from your mail)

> $./x.bat a b=c d
> $./x.bat a 'b=c' d
> $./x.bat a "b=c" d

means exactly the same in all three cases in Bash/cygwin.

Bash follows the  quoting rules of  Bourne shell, and the argument
b=c *doesn't need* to be quoted. So both ways of quoting means the
same as *no* quote.

So there should be no surprise that all give identical result.
It's just a consequence of the Bourne shell rules (that Bash
follows).

I think the complexity of these quoting issues comes from the fact
that both Bash and cmd.exe are involved. When you issue the command

    $./x.bat a "b=c" d

in Bash, I guess Bash actually runs a command like:

    cmd /c ./x.bat a b=c d

And the quoting rules of cmd.exe aree *very poorly* documented.
I think this just proves my point in my earlier mail:

    > BUT, I think using BAT-files is asking for trouble ....

You can't expect things to work unless you understand the quoting
issues of all involved programs.

The simplest way to achieve this, I think is to avoid "cmd.exe"
(ie. BAT-files) altogether.

If BAT-files are used, I think %* should be used instead of %1 %2 %3
... . %* actually passes things like b=c correctly to the underlying
program. The drawback of this is that %* may not work on all
Win32-platforms (eg. Windows 95 I think, and maybe others).

( I think it is fascinating that Microsoft can make so poor command
line tools, and not even be compatible between different versions of
Windows. It's an illusion that "Windows" is *one* platform .... )

/Johan Holmberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]