delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/05/04/02:49:32

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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=SXbYTNp0t/VSe0w1
OkTeStD6jT5xtwTehNx1jtKcsr64tdXQ5UnOgOJaUKKaAG789gR29yr29l/ZBBfx
xCCPJrPYEqR71MVTYzzQ2dzkoMp5PsopgwzVC+6AjE692a7i6gvAWjmGT2nczyqz
lV2tF0VK1wUA9UXwjoOTkRRaPY8=
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:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=VR/ihJAMLUz/rLUosZ4nQq
1v4xI=; b=XSyXY0msJzzmNOnqxrqAbxzn+owqeL70R6aL0IANmpI07SFfdkfi0C
g3SDpj8dQtZgoH2ORbpYFCwlHnKiFSlmWrf6mGAEX/aEdm3HEdCq+lxN/d8tjoLd
UJZM5rG+p7mR8ruVBPHFdzkZ/84FpL8Z1rwHkzlOdTVkiWq1b1eIs=
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=-0.7 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=59AM, Moss!, Repin, moss
X-HELO: mout.kundenserver.de
Subject: Re: pipe broken by WSL?
To: cygwin AT cygwin DOT com
References: <2a6d7c3d-f8ff-eafe-3048-8bbd689216c5 AT towo DOT net> <20190502153726 DOT GA1867 AT zebra> <a2cc9af3-eb31-8b7d-e3f4-fa3e2f21cd40 AT cs DOT umass DOT edu> <473270892 DOT 20190503215225 AT yandex DOT ru>
From: Thomas Wolff <towo AT towo DOT net>
Message-ID: <4d4b6878-846e-51ae-4440-ccc90c8bf5a3@towo.net>
Date: Sat, 4 May 2019 08:49:06 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
MIME-Version: 1.0
In-Reply-To: <473270892.20190503215225@yandex.ru>
X-IsSubscribed: yes

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

- Raw text -


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