delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/05/14:32:16

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:from:reply-to:to:subject:date:message-id
:references:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=L1l5cBoQH/xlASXVw0PZQD+4FJPQ+
iyd8pOjU9jjV4J3nkXWHdg/J4MHHb3xne0lUl4dUREmgG9KrKCxHHpqGJ32PMp8+
Sl9UlHDD2fd/VpauVUdcPg+g2/7DN0Laj2c5lBZHHBMm7AQVS0M0v6eZwJ43Y1fS
L18ofnLWYnESLQ=
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:from:reply-to:to:subject:date:message-id
:references:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=nu46jLv/G9gnXk6L/l5DOtkErYE=; b=acU
8RxYMGYnjvK29rO3kKDmviKmMPZcb3805l0CpyOtrGMcEY16QgTwLfwlYgBRE5J/
Jvo652ihSvhQ+IfHPLK+yarCNaE17qWLUhXLYe8S+NSEcNx/jXh6H+K3qInimThv
2t4T4v5IxnPRzndjaO4vjYrfkHdwc8la6OyeaFwI=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=no version=3.3.1 spammy=
X-HELO: NAM03-DM3-obe.outbound.protection.outlook.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cu9qp/CixUUNiMcD0jKB7ZdgTaoe5KHkc83Vs4ImgxrvfA4AKYYqQY195hyr6vTlo7sODaY11fBFUTh9K1qPDs9gg2DOigAOONBTBuKHhAXmKvXOCqWeAVjjIjw5/z4+JvHyST7oEgpqrCnVk/gXpjNqj14XFJjmFPmZIibCe1hcBl4Zuzu5lGlb+/UuupMZHgp8XES75FkCKFS4Fu1/CblHCHnfegmU+OqddBerSNKPGyxQ+mlqHUkastZBfYvbWT1D/9sx7KIhb4XA4ga612ulupF/rmARAcHOM7mmb5ZMAicaKQiDz6c5faBpUiNXPH8jlBjI08mgKBQIcEincA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eIUluV3+TJOHpfCM9TfTPlli58GKvufplAoKLuxMrCQ=; b=UXwZNxdPokg70wg/T7pOYwNzepafuRHvQI/Geru0LMdhfeHziPyjgBxhRG1sjUGVx0wku9pETq493sF9kBIt04953hvlh/eAs+d4lqBRWJbMFOjPMAv3gYuYkLXLLV03MDUpp1Me3gZQ++MmzTAfhcu+x/NwelNVay29WVkNIS+4ZH19hQf0IwVV8jo6KXBUiC8THTvBIrd0twpzu9sqIxlCyfCImCDObUy0+JTC85SMCYtq1zHltvK5ZgAFXFJlXmDIPpxDava67vmqeZlHxNnJszOvcTHUcfiP8j7d1BsIqXBNybVeFrvBj0MeRb+a2345sca1jug2RZbPI5Yu9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eIUluV3+TJOHpfCM9TfTPlli58GKvufplAoKLuxMrCQ=; b=JY1Ui6aHWUufJQD2GyZ1AK15Axr2kkjUEA7HUsmMNysfQTOTlC8bosq7HOzbkpHC4UDh1+YNkV2apBSnc3OzdQl5zmc/TUxOv9bjW8wdOy/Vqf28Cy5sWcUBvzAOC0PtylC0qNLEHRAiVIo2Edb9FI82MzcIX4DoHmTX36+7W1Y=
From: "Stephen Provine via cygwin" <cygwin AT cygwin DOT com>
Reply-To: Stephen Provine <stephpr AT microsoft DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>,
"Brian DOT Inglis AT SystematicSw DOT ab DOT ca" <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: RE: Command line processing in dcrt0.cc does not match Microsoft parsing rules
Date: Thu, 5 Sep 2019 18:31:10 +0000
Message-ID: <MWHPR21MB0845282E7582DC95ADF0F140B9BB0@MWHPR21MB0845.namprd21.prod.outlook.com>
References: <MWHPR21MB08452919F35B1B0C5F0EB4DCB9BD0 AT MWHPR21MB0845 DOT namprd21 DOT prod DOT outlook DOT com> <MWHPR21MB0845F78385792965A94E0CD9B9BD0 AT MWHPR21MB0845 DOT namprd21 DOT prod DOT outlook DOT com> <MWHPR21MB084508155AB621C7AD81309CB9B90 AT MWHPR21MB0845 DOT namprd21 DOT prod DOT outlook DOT com> <MWHPR21MB08456D9F03AF8BD450E6AB2EB9B80 AT MWHPR21MB0845 DOT namprd21 DOT prod DOT outlook DOT com>
In-Reply-To: <MWHPR21MB08456D9F03AF8BD450E6AB2EB9B80@MWHPR21MB0845.namprd21.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=stephpr AT microsoft DOT com;
x-ms-oob-tlc-oobclassifiers: OLM:8882;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-ms-exchange-transport-forked: True
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ARLFanAXH/bsc0hgXwCGkxc1Alp3VQN6x947FZY2U+WOLkRRV88iuhsAkgz3xxwvflVm42b+z/LMtrgLnF2sMg==
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x85IVpJU028557

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:

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

Can you explain this difference? The reason I ask is that if this worked,
the way Go constructs the command line string would be just fine.

Thanks,
Stephen


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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019