X-Recipient: archive-cygwin@delorie.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=TZ2Hrrk+r+1LAA7L
	030ml50+x8UFomTx4ufAG1hvUduxjcAf3UxRPJmj9AmGE4gDYaI4bBL0ifi4vxLY
	aDAyHE/KuMkecO12VQxjiemgIBmObbCf54JzvF/7L5y06S8Zys5I0bQMWy30xpAE
	GaAttxf7lc7YbFklVMkY3ZGqyxc=
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=veA1i49pIU/JO2E2Xi0fgu
	l56Yo=; b=GzKv7pFE/9l64/T5TaRIviyIIy6ZzEQetkQ1mNfvWHoIF5XWmHP+tE
	N4umHphS+iZ5w8hzy7KuetM1yT40rP77Y96BkClsqhbwAvQ5yIsFBSvwk2iPIlAy
	ZTqCBkrDESXK5e+ovOUIyPZ63Rjxt3AOh0L1wGGo3m+qu5bYYY2ZY=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=BAYES_50,FOREIGN_BODY,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=Avast, auf, diese, EMail
X-HELO: mail-wm1-f52.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=subject:to:references:from:message-id:date:user-agent:mime-version         :in-reply-to:content-transfer-encoding;        bh=2YtobbrXfW94EAY59wdxe6ta4CSTX90v+3fA77dcmDs=;        b=YNL0kVn3sjmeV1F/iizklrLG6VFpK07rTTlxIa2oDlzl65d97x57ELgWZ8nYIxV6E1         mWQar6AzpkYg0FW0+WJgL52Mdb3aRXGFcQT9DudEnrnWXsrD4yNDeZcdQCyBFs+btxUm         FkEg9+cl9jw0xJ5IvgRuXagF54eXOjbzAXJiBY2JP9DGlbF/Ewm0qNn/ahfkE1zkn8kW         /n4JnoaGRGT+LEhV0E7+XfEB9IbFLVTPzlQMq0B4lf3VDKURL1eSDXmc7lh+s/DqEAj2         SppvMaSlAS2ZmYXybDu3w8lxeb7zxj855dHn/c0Mc91yJbUOs/tviaLhnjvUVM7n//1z         TLtw==
Subject: Re: grep < fifo fails
To: cygwin@cygwin.com
References: <d56a12c77ecc441ca7dc2e8e1862145c@prosa.dk>
From: Marco Atzeri <marco.atzeri@gmail.com>
Message-ID: <fabf7a9e-43a2-ddd7-ccda-4c32a000c21e@gmail.com>
Date: Wed, 3 Oct 2018 18:50:18 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <d56a12c77ecc441ca7dc2e8e1862145c@prosa.dk>
Content-Type: text/plain; charset=utf-8; format=flowed
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id w93GoWQf013072

Am 03.10.2018 um 17:37 schrieb Ole Tange:
> This works:
>
> $ mkfifo fifo
> $ echo > fifo & grep .  fifo
> [1] 10232
> [1]+  Done                    echo > fifo
>
> But this fails:
>
> $ echo > fifo & grep . < fifo
> [1] 11756
> grep: (standard input): Invalid argument
> [1]+  Done                    echo > fifo
>
> I see the same behavior on MINGW, but I do not see the same behavior on GNU/Linux.
>
>
> Regards,
>
> Ole Tange

I assume it is a consequence of the same problem on files.
You can not use the same source for input and output.

$ echo "prova" > prova.txt

$ cat prova.txt
prova

$ cat prova.txt > prova.txt

$ cat prova.txt

the file was erased



---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus


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


