public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: David Karr <davidmichaelkarr@gmail.com>
To: The Cygwin Mailing List <cygwin@cygwin.com>
Subject: Re: Redirecting stderr to stdout through pipe doesn't work the way it does in Linux
Date: Thu, 06 Dec 2018 01:03:00 -0000	[thread overview]
Message-ID: <CAA5t8VqRpa1J=zBxaDS=QXe9PAwe97iQuZG37p4SjczjA=AjYw@mail.gmail.com> (raw)
In-Reply-To: <869301960.20181206031457@yandex.ru>

On Wed, Dec 5, 2018 at 4:20 PM Andrey Repin <anrdaemon@yandex.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

      reply	other threads:[~2018-12-06  1:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 20:41 David Karr
2018-12-04 20:52 ` Marco Atzeri
2018-12-04 21:39   ` cyg Simple
2018-12-05 14:58   ` David Karr
2018-12-05 15:11   ` David Karr
2018-12-05 17:42     ` cyg Simple
2018-12-05 18:33       ` David Karr
2018-12-05 19:43         ` cyg Simple
2018-12-05 22:25           ` David Karr
2018-12-06 16:21             ` cyg Simple
2018-12-06  0:20         ` Andrey Repin
2018-12-06  1:03           ` David Karr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA5t8VqRpa1J=zBxaDS=QXe9PAwe97iQuZG37p4SjczjA=AjYw@mail.gmail.com' \
    --to=davidmichaelkarr@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).