delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/05/20:47:30

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:to:subject:references
:content-type; q=dns; s=default; b=Wnjtv1eTmwzAZUD1UuCyD5kHVMTLB
xO+6YLO2esNrK4TytBZUCT8NPDNdSEdk2Tq3PtA28mUnNcy85tBu2WJuP2jKuCew
QIzDybLPmJWUjc672IovzksNjoTtSposnIT7LNMKtRSkTXqyiLd6P9RXfcRP5VMZ
SvjpnQ+eRovp2E=
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:to:subject:references
:content-type; s=default; bh=WlNR6OxrZnxcHv+885v3j+s7QKU=; b=q/+
gBPsw3p/pIY2BFvK4GUF2ZnYq9Z5qWgR5WX64IV+5tZjOE+o1DzR8etZFBRab7sA
NOiJFnm9mp1Sck9vOmiJxoZRxa3dmDklCQw2PhMzPEaI60LbvcXkoumEb3AFyHAI
zO5IewQjl8xSEXdZDzZ7ryXXULdaDGz94gYprAYg=
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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*UA:github.com, H*r:289, H*M:1c69fb81, H*M:google
X-HELO: mail-oi1-f181.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:to:subject:references:user-agent; bh=hs/avTML3zpDFxqNeVasoSAuFJ6E0VF7033/08+Psdo=; b=K30N3Mw4UbFCfgyhrIPmhT5oCFUxp+v9ICHWYnpbwEjHpagVmPq9ptLulb8x2itiUo vIV5BUWc6uJLj//o3OOIvt4RNf5VP5cguL9HqM0cMmxRlZ5lEGbJe42jV+Xw4/7d6xeg sdtLj3m/4bu9Xi2c62w4Pex97VKgJenlItAq24DJ8jza6Tqj6rhQcu/bOUzigq23WylV kD7GMFaR1/GBw9XEs52E0BjSBWQcwNZkzkW/OrIsJTa+WzPP73QBIeqVhRNsnyHt/Iv4 ALQZ8xHv8aPxj6zl4vQWrwtWrdvn6tQXZew8rBGziObxhwUk/hobrG62UXE/kKXvbqdk X5qA==
Message-ID: <5d71ac65.1c69fb81.686f1.8589@mx.google.com>
Date: Thu, 05 Sep 2019 17:46:29 -0700 (PDT)
From: Steven Penny <svnpenn AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: RE: Command line processing in dcrt0.cc does not match Microsoft parsing rules
References: <MWHPR21MB0845845AC5AD54E3A2EAA05EB9BB0 AT MWHPR21MB0845 DOT namprd21 DOT prod DOT outlook DOT com>
User-Agent: Suede Mail/2.8.0 (github.com/cup/suede)

On Thu, 5 Sep 2019 23:45:44, "Stephen Provine via cygwin" wrote:
> package main
> 
> import (
> 	"log"
> 	"os"
> 	"os/exec"
> )
> 
> func main() {
> 	cmd :=3D exec.Command("C:\\cygwin64\\bin\\bash.exe", "test.sh", "foo", "ba=
> r\"baz", "bat")
> 	cmd.Stdout =3D os.Stdout
> 	cmd.Stderr =3D os.Stderr
> 	if err :=3D cmd.Run(); err !=3D nil {
> 		log.Fatal(err)
> 	}
> }

Why are you doing this? I hate to be that guy, but examples are important.
Arguably the most important lesson I have learned with computer programming is:
use the right tool for the job.

So when I need to do something, I start with a shell script. Then once a shell
script doesnt cut it anymore, I move to AWK, then Python, the Go. Substitute
your language of choice.

What I dont do is call a shell script from Go or anything else. I might call
"git.exe" or "ffmpeg.exe", but even then you could argue against it as those
binaries have libraries too.

I agree that Cygwin should be parsing to and from cmd.exe correctly. But unless
you have a valid use case, its kind of like "Cygwin theory". I have found that
historically those type issues are less likely to be resolved in timely manner,
if at all.


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