delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/12/26/20:16:53

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:message-id:date:from:subject:to:references
:content-type; q=dns; s=default; b=RuophW4F2bbxZ8SzI57lhlWGI+JFc
bnNPigKhCsM05OZnsr9s4nMW63B+aY5kGEe0uJYXrjVbg6Q7e0Oj7mrKVM9ZEKot
OdV8Jcka0rrzkaTTLQAWAUT9iaewPjtE8JklMBMoCNt5RSQC+qE1bvJ2QBRMJVRj
FFcMdNKGAnyieM=
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:message-id:date:from:subject:to:references
:content-type; s=default; bh=rfzELSFVkJxYPhei0rtp/ertcY0=; b=wtd
PaPNzrssJLfIeK3HxPLIOQaskoEw53v0IJrrsgdZreVn+UvJnTODLkA78AJ/ggNH
biWWHMJGcAL/EumnICYo2bWzCiTsXlyTaUImW5brpEvGMFlULzPcIOLu1kFV0kZ/
jN92TNV9L36Ceqgy2Xb1hwy8VQjP7P6FHs2Njprw=
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-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*UA:github.com, H*M:google
X-HELO: mail-ot0-f179.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:subject:to:references :user-agent; bh=WRt2dPLpPO4gKGWx+n9nSDyrFOhL4rBboZcnJF9sxhw=; b=WLZOcsp/xB60jTQuWP3/WBfhAdtYaLTTI3U8/T4PPTQRV9J2Er58KV/rpgjewzt5uD cMLTNS/twNOfppJxCdcPnXgNZkEN97iEpiePHgtvO0szYMlRyMjR1bF1cMFilOJ5zBu5 UoTS0aomiQ+vWQWrtdcRfL+MvhhdJqBe64Y85vyMWIbQQOWyiTisbnhRm6vYRGGROsSK dBCA8LE+DArkbbQhBefSEFiwTAfd1zCS9ApIjguFftjPPUD/VXJH4aDOR79wUJXB6RiJ /XRA6aw87Ij4p/bijda84UxnCn1tSoo1PrzjWkbh/Axg/Q14GuMW4L4zoVVD5Azijs71 uaBQ==
X-Gm-Message-State: AKGB3mI285mWcWbAcvE6NXtxQ89s0i9JYSXgbAmoTSZ5UgeVJwnHPEQ5 D9lZwlWDkVPYRhcTltJp7RqxfA==
X-Google-Smtp-Source: ACJfBosWNzYcnhMFKw/gCiKRuncV67/cSoqaX2ur47NkmtUCK9uthROmzJkmumNnf4NMmLUY+j2g/w==
X-Received: by 10.157.11.59 with SMTP id a56mr22469264ota.154.1514337399572; Tue, 26 Dec 2017 17:16:39 -0800 (PST)
Message-ID: <5a42f476.8335ca0a.1ba14.0c39@mx.google.com>
Date: Tue, 26 Dec 2017 17:16:38 -0800 (PST)
From: Steven Penny <svnpenn AT gmail DOT com>
X-Google-Original-From: Steven Penny
Subject: Re: Run command in new window
To: cygwin AT cygwin DOT com
References: <e12dbeac-a27f-4f41-42c6-d5467433c553 AT gmail DOT com>
User-Agent: Tryst/2.0.1 (github.com/svnpenn/tryst)

On Tue, 26 Dec 2017 17:44:11, cyg Simple wrote:
> If you want to pass quotes to the process on the command line then you need
> to quote them or use a backslash on the quote to prevent the shell doing
> the exec to process them.
> 
> $ cygstart bash -c \'echo 1\; read\'

continuing from my previous email [1], here is an example of your command in
action:

    $ z=1
    $ cygstart bash -c \'echo $z\; read\'

and here is something that breaks your example:

    $ z=\'
    $ cygstart bash -c \'echo $z\; read\'

so you see, your command assumes that no single quotes will be between the
single quotes, which is just not robust. it seems something like one of these
will be needed:

- bash printf %q
- coreutils printf %q
- homebrew function [2]

[1] http://cygwin.com/ml/cygwin/2017-12/msg00263.html
[2] http://github.com/svnpenn/stdlib/blob/45df8cf/libstd.awk#L318-L326


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