X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,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: forward101o.mail.yandex.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1567858806; bh=8kvFDTE0rThDjb353GdgR3XTP6RJ2fZnBg+1S+JAmk8=; h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date; b=SPMGkKUOs2E8sPOnUhIRWuVsweC84vHAT5wfIyYE9HTxa4i+30IkU5mBNYc6QVaZY SIQgrzk0VQGZA+1yqbfURNJlVYFlUHTfu7RyphZuuZEQW8UN1vyQNwBbmSwC0qzMB8 WAyrD9NNQklefOte8gWuA9vhZzBqpOHLHJETCgK0= Authentication-Results: mxback1g.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Fri, 6 Sep 2019 23:34:45 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <135817606.20190906233445@yandex.ru> To: Stephen Provine , cygwin AT cygwin DOT com Subject: Re: Command line processing in dcrt0.cc does not match Microsoft parsing rules In-Reply-To: References: 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