delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/12/05/20:03:35

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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=XbU0EFz
pw5mdE5o3ESeCNC55og7N0OEGUE8f5bEbEXh8fb4QcXSUMNRWTfFVWPKpEcePkUc
4nguIbf8vfSFdpVNmOo3xsxWC20fpKcC1Neg7Iepg0/pzjOheIYeenBz64MJwFU7
vTEejaJhK/lBpeOYYLYMfx64EyLYykkdvXgo=
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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=ZUykmLS/pzCrl
radoKimjCl08+Y=; b=RkY0z75wdzBSYf2xk1tJ9JSx5E11mX/3tzJqcVh1wCkUZ
NdmZINkCdvSM0TAajyx482++Mjp1qmrB+7kuhvG2gbstGXh3rM4B5CC7EistF9Ng
AYH9xDNkJieDH3Y7KiLCGz4gLgnvBpVszHy7IEbI+2qhf8Dd+r2mtUENGxVdP0=
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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=D*yandex.ru, H*c:alternative
X-HELO: mail-ed1-f45.google.com
MIME-Version: 1.0
References: <CAA5t8VrSPx-LgmwCJCzTTHwA8wV6Lq5iMfjx06ApDQRPgx8ByA AT mail DOT gmail DOT com> <6cc83f4b-b0b1-d5c9-8d59-94c51382e4e3 AT gmail DOT com> <CAA5t8VoFRu2ai3c9tVTxAAVBWJg2fUMQWPr8jgjcs-67vUR60g AT mail DOT gmail DOT com> <37f0fb9b-5d70-ea1f-b1fc-1cd3f3ad0fa7 AT gmail DOT com> <CAA5t8VpcYy_tTYHTmJMmA4x3-kSJ91ZgBn0j5C=9hehKyhnxuQ AT mail DOT gmail DOT com> <869301960 DOT 20181206031457 AT yandex DOT ru>
In-Reply-To: <869301960.20181206031457@yandex.ru>
From: David Karr <davidmichaelkarr AT gmail DOT com>
Date: Wed, 5 Dec 2018 17:02:59 -0800
Message-ID: <CAA5t8VqRpa1J=zBxaDS=QXe9PAwe97iQuZG37p4SjczjA=AjYw@mail.gmail.com>
Subject: Re: Redirecting stderr to stdout through pipe doesn't work the way it does in Linux
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

On Wed, Dec 5, 2018 at 4:20 PM Andrey Repin <anrdaemon AT yandex DOT ru> wrote:

> Greetings, David Karr!
>
> > Sigh. What a mess. I can't get this to work.  It was easy enough when a
> > single script has to execute "kubectl", having "winpty" prefix that call,
> > but I'm trying to write a script that calls that other script, and even
> in
> > a pipeline.
>
> > If I have "winpty" prefix the call to the script that calls "kubectl", it
> > says:
>
> >     winpty: error: cannot start '...': Not found in PATH
>
> Either
> kubectl(){ .../winpty ...\\kubectl }; readonly -f kubectl
>
> > When I changed it so it references the absolute path, it then says "%1 is
> > not a valid Win32 application. (error 0xc1)".  So, this makes it clear
> that
> > winpty can only directly execute Windows applications, which makes sense.
>
> > So how can I call a Windows application from more than just the top-level
> > script?
>
> or write a Cygwin wrapper for kubectl and place it where it is usually
> located
> on *NIX system.
> Do NOT add kubectl or winpty to Cygwin $PATH, since both are not Cygwin
> apps
> and their presence only confuses you.
>
> Wrapper would probably be more universal.
>

I don't see how any of this can help.  It appears that I can only "winpty"
a process if it's "at most one level deep", if that makes any sense.  I
tried writing a "kubectl" script and putting it in my path before the
Windows kubectl, and having the script execute that, and prefix the call
with "winpty".  It doesn't work if the call to "kubectl" is "deeper" in the
script chain.

What's even worse is that I didn't need "winpty" for all of the kubectl
subcommands, only "exec".  By now adding "winpty" as a prefix for all
kubectl subcommands, it messes up the output of things that just emit text.
I now have " [0K" ending all my output lines.


>
> --
> With best regards,
> Andrey Repin
> Thursday, December 6, 2018 3:09: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

- Raw text -


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