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: List-Subscribe: List-Archive: List-Post: List-Help: , 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: <6cc83f4b-b0b1-d5c9-8d59-94c51382e4e3 AT gmail DOT com> <37f0fb9b-5d70-ea1f-b1fc-1cd3f3ad0fa7 AT gmail DOT com> <869301960 DOT 20181206031457 AT yandex DOT ru> In-Reply-To: <869301960.20181206031457@yandex.ru> From: David Karr Date: Wed, 5 Dec 2018 17:02:59 -0800 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 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