X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=LsCjQLm6FiQbsaq3
	qPq8gl8RW7eZE30+s2HDfLZSX72SUDhuWDh1shqPyf1/PjJ8O+fKi1Autr6Mbjth
	WvFO2ZzhjG/nzQq9UcvXU1qGNqd0e3M6j8lonveIqhBXbjPgyTNYGwdPRsDJv0M0
	xc28DuHCCPUty8ETZHXNQmniqjI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=AuaL03S53IYgd52syq3Ps8
	crfx0=; b=ExCueea1rtlzX8N+EuSWyp6aOanezbHXvlr9qBP36H74Qvl75LwAGy
	1oHV1n3wkgk6f8SG1Ipo/Je3rKut/aK5O2ZvnBXZo1QnD4NQuGnP8Hc4c/EUt0ka
	6lnNqTMHjhfNViknFUExa6Z5ueGX2gDmqBf3WwYNoQ7St3EoXUzmI=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=3.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,RCVD_IN_JMF_BL,SPF_PASS autolearn=no version=3.3.1 spammy=H*M:yandex, H*F:D*yandex.ru, UD:yandex.ru, H*i:sk:MWHPR21
X-HELO: forward100o.mail.yandex.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1567857905;	bh=8kvFDTE0rThDjb353GdgR3XTP6RJ2fZnBg+1S+JAmk8=;	h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date;	b=VubA7JCZwM94FJQUpv2E4OQZtcWsGP4+8HGpPxq/gaYJcpbIb6q5oo9OOPB7GBCbM	 3M6Pk06/E8k45GkE3WPlM4wzGbtqYnwS7umYifE8gv0JiPxwfQeCpWAMLE2LO48nre	 Vi3BM2ZUX/NSLaF8YjEdWLkpIR6Zwd2Em/Vfox9U=
Authentication-Results: mxback20o.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Fri, 6 Sep 2019 23:34:45 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <135817606.20190906233445@yandex.ru>
To: Stephen Provine <stephpr@microsoft.com>, cygwin@cygwin.com
Subject: Re: Command line processing in dcrt0.cc does not match Microsoft parsing rules
In-Reply-To: <MWHPR21MB0845282E7582DC95ADF0F140B9BB0@MWHPR21MB0845.namprd21.prod.outlook.com>
References: <MWHPR21MB08452919F35B1B0C5F0EB4DCB9BD0@MWHPR21MB0845.namprd21.prod.outlook.com>   <MWHPR21MB0845F78385792965A94E0CD9B9BD0@MWHPR21MB0845.namprd21.prod.outlook.com>  <MWHPR21MB084508155AB621C7AD81309CB9B90@MWHPR21MB0845.namprd21.prod.outlook.com>  <MWHPR21MB08456D9F03AF8BD450E6AB2EB9B80@MWHPR21MB0845.namprd21.prod.outlook.com>  <MWHPR21MB0845282E7582DC95ADF0F140B9BB0@MWHPR21MB0845.namprd21.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

Greetings, Stephen Provine!

> On 2019-09-04 23:29, Brian Inglis wrote:
>> As standard on Unix systems, just add another level of quoting for each level of
>> interpretation, as bash will process that command line, then bash will process
>> the script command line.

> My mistake - I'm very aware of the quoting rules, yet in my test script for this
> scenario I forgot to quote the arguments. However, if POSIX rules are being
> implemented, there is still something I didn't expect. Here's my bash script:

> #!/bin/bash
> echo "$1"
> echo "$2" 
> echo "$3"

> And I invoke it like this from a Windows command prompt:

> C:\> bash -x script.sh foo bar\"baz bat
> + echo foo
> foo
> + echo 'bar\baz bat'
> bar\baz bat
> + echo ''

> Not expected. Called from within Cygwin, the behavior is correct:

Again, fully expected.

> $ bash -x script.sh foo bar\"baz bat
> + echo foo
> foo
> + echo 'bar"baz'
> bar"baz
> + echo bat
> bat

> Can you explain this difference?

CMD escape character is ^, not \

> The reason I ask is that if this worked,
> the way Go constructs the command line string would be just fine.

No.


-- 
With best regards,
Andrey Repin
Friday, September 6, 2019 23:33:46

Sorry for my terrible english...


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

