From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121019 invoked by alias); 6 Dec 2018 01:03:25 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 120995 invoked by uid 89); 6 Dec 2018 01:03:24 -0000 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 Received: from mail-ed1-f45.google.com (HELO mail-ed1-f45.google.com) (209.85.208.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Dec 2018 01:03:14 +0000 Received: by mail-ed1-f45.google.com with SMTP id y56so18609635edd.11 for ; Wed, 05 Dec 2018 17:03:14 -0800 (PST) MIME-Version: 1.0 References: <6cc83f4b-b0b1-d5c9-8d59-94c51382e4e3@gmail.com> <37f0fb9b-5d70-ea1f-b1fc-1cd3f3ad0fa7@gmail.com> <869301960.20181206031457@yandex.ru> In-Reply-To: <869301960.20181206031457@yandex.ru> From: David Karr Date: Thu, 06 Dec 2018 01:03:00 -0000 Message-ID: Subject: Re: Redirecting stderr to stdout through pipe doesn't work the way it does in Linux To: The Cygwin Mailing List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00060.txt.bz2 On Wed, Dec 5, 2018 at 4:20 PM Andrey Repin 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