public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* pipe broken by WSL?
@ 2019-05-01  9:21 Thomas Wolff
  2019-05-02 15:37 ` Stephen Carrier
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Wolff @ 2019-05-01  9:21 UTC (permalink / raw)
  To: The Cygwin Mailing List

Calling WSL seems to break pipe processing:

(echo 1; echo 2) |
while read line
do
   echo $line
   wsl uname
done

The loop is not repeated. Commenting out the wsl command, it works as 
expected. Prefixing wsl with winpty also makes it work.

Thomas

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pipe broken by WSL?
  2019-05-01  9:21 pipe broken by WSL? Thomas Wolff
@ 2019-05-02 15:37 ` Stephen Carrier
  2019-05-02 16:26   ` Eliot Moss
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Carrier @ 2019-05-02 15:37 UTC (permalink / raw)
  To: cygwin

On Wed, May 01, 2019 at 11:20:59AM +0200, Thomas Wolff wrote:
> Calling WSL seems to break pipe processing:
> 
> (echo 1; echo 2) |
> while read line
> do
>   echo $line
>   wsl uname
> done

I don't know about wsl, but could it be absorbing the standard input?
What if "wsl uname" is replaced with "wsl uname < /dev/null" ?

Stephen Carrier
BEAR Center

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pipe broken by WSL?
  2019-05-02 15:37 ` Stephen Carrier
@ 2019-05-02 16:26   ` Eliot Moss
  2019-05-03  2:32     ` Thomas Wolff
  2019-05-03 19:05     ` Andrey Repin
  0 siblings, 2 replies; 6+ messages in thread
From: Eliot Moss @ 2019-05-02 16:26 UTC (permalink / raw)
  To: cygwin

On 5/2/2019 11:37 AM, Stephen Carrier wrote:
> On Wed, May 01, 2019 at 11:20:59AM +0200, Thomas Wolff wrote:
>> Calling WSL seems to break pipe processing:
>>
>> (echo 1; echo 2) |
>> while read line
>> do
>>    echo $line
>>    wsl uname
>> done
> 
> I don't know about wsl, but could it be absorbing the standard input?
> What if "wsl uname" is replaced with "wsl uname < /dev/null" ?

You seem to be right; when I add < /dev/null as described, I get
the expected output.

Regards - Eliot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pipe broken by WSL?
  2019-05-02 16:26   ` Eliot Moss
@ 2019-05-03  2:32     ` Thomas Wolff
  2019-05-03 19:05     ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Wolff @ 2019-05-03  2:32 UTC (permalink / raw)
  To: cygwin

Am 02.05.2019 um 18:26 schrieb Eliot Moss:
> On 5/2/2019 11:37 AM, Stephen Carrier wrote:
>> On Wed, May 01, 2019 at 11:20:59AM +0200, Thomas Wolff wrote:
>>> Calling WSL seems to break pipe processing:
>>>
>>> (echo 1; echo 2) |
>>> while read line
>>> do
>>>    echo $line
>>>    wsl uname
>>> done
>>
>> I don't know about wsl, but could it be absorbing the standard input?
>> What if "wsl uname" is replaced with "wsl uname < /dev/null" ?
>
> You seem to be right; when I add < /dev/null as described, I get the 
> expected output.
Yes, indeed. Thanks.
Thomas
>
> Regards - Eliot
>
> -- 
> 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
>


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pipe broken by WSL?
  2019-05-02 16:26   ` Eliot Moss
  2019-05-03  2:32     ` Thomas Wolff
@ 2019-05-03 19:05     ` Andrey Repin
  2019-05-04  6:49       ` Thomas Wolff
  1 sibling, 1 reply; 6+ messages in thread
From: Andrey Repin @ 2019-05-03 19:05 UTC (permalink / raw)
  To: Eliot Moss, cygwin

Greetings, Eliot Moss!

> On 5/2/2019 11:37 AM, Stephen Carrier wrote:
>> On Wed, May 01, 2019 at 11:20:59AM +0200, Thomas Wolff wrote:
>>> Calling WSL seems to break pipe processing:
>>>
>>> (echo 1; echo 2) |
>>> while read line
>>> do
>>>    echo $line
>>>    wsl uname
>>> done
>> 
>> I don't know about wsl, but could it be absorbing the standard input?
>> What if "wsl uname" is replaced with "wsl uname < /dev/null" ?

> You seem to be right; when I add < /dev/null as described, I get
> the expected output.

Why not just

    wsl uname <&-

I wonder?


-- 
With best regards,
Andrey Repin
Friday, May 3, 2019 21:51:38

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pipe broken by WSL?
  2019-05-03 19:05     ` Andrey Repin
@ 2019-05-04  6:49       ` Thomas Wolff
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Wolff @ 2019-05-04  6:49 UTC (permalink / raw)
  To: cygwin

Hello Andrey,

Am 03.05.2019 um 20:52 schrieb Andrey Repin:
> Greetings, Eliot Moss!
>
>> On 5/2/2019 11:37 AM, Stephen Carrier wrote:
>>> On Wed, May 01, 2019 at 11:20:59AM +0200, Thomas Wolff wrote:
>>>> Calling WSL seems to break pipe processing:
>>>>
>>>> (echo 1; echo 2) |
>>>> while read line
>>>> do
>>>>     echo $line
>>>>     wsl uname
>>>> done
>>> I don't know about wsl, but could it be absorbing the standard input?
>>> What if "wsl uname" is replaced with "wsl uname < /dev/null" ?
>> You seem to be right; when I add < /dev/null as described, I get the expected output.
> Why not just
>
>      wsl uname <&-
>
> I wonder?
That gives me an error "Invalid handle", or, using `head` instead of 
`wsl`: head: failed to reopen 'stdin' with mode 'rb': Bad file descriptor.
By the way, a funny variant of the test case is

(echo 1; echo 2) |
while read line
do
    echo $line
    head -1
done
(Add an 'x' marker to the echo to watch the intricacies...)


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-04  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01  9:21 pipe broken by WSL? Thomas Wolff
2019-05-02 15:37 ` Stephen Carrier
2019-05-02 16:26   ` Eliot Moss
2019-05-03  2:32     ` Thomas Wolff
2019-05-03 19:05     ` Andrey Repin
2019-05-04  6:49       ` Thomas Wolff

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