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=nPqn/fNn2aqoAPj7
	7cSQnNyLljOd2jEz2b/WZhoUyIsUyylzbOyhw9De98vc7TqVgRBR+P5Tpk0nJlYN
	k73jnZaXhKQnrjLYMlCtg3GaMQit2WNZbFpmV4wX3XwGI8W8/BSqF/GMXUanez30
	sFLhouEaiYjWNADwrZD4K5VlUOk=
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=rrCkpv4aYHekK92HjNTvPP
	KpGUw=; b=Tkiyy6XznM0ivi7aaPVR7TcBHBQHj/tTWnTNizmwAhBiUgtYzi5dSA
	yBAHirACcmo5HoYeWqp1qZJjDQ9DL/z0rjCmTkNxxYinXlWyQXZ6y/MqBzed/+kZ
	xPjZ9urY3E9BFSvSK4mGcOWT1fmCrjCOHCGjiwQegGBIjnuJvvU6k=
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-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:904, reproduction, say-something.sh, 4.4.12
X-HELO: mail-wr0-f175.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:subject:to:references:from:message-id:date         :user-agent:mime-version:in-reply-to:content-transfer-encoding;        bh=DvX9jHsD6+en/iU0im0a0UiTar/JOcLNmaJQ/ovfNIc=;        b=dktfKrNj9AaLWBzjMrV4MPrIBm25f+3u44BoxtWtDKq+W7PMd33ODSKPUXOol9fOno         zPHJNrhOFIcHoQ9rwZvja0J2tfSHN13PZuooJsq4iXMEmjOtaJkDDOIy15rjZNWefMnL         M2KGUtRP4o1eb6zjq560XUpMNd8A/SZ3XrpjtkidfM6HIGQdto1+QuAXpnQpYhFFXEaz         dtuodCWivFLzlkjvrJgNrpiU+jvrFZmChsntDSGk319P8gLT6YVB3HV8sdHJj30RQFUl         gZ4Kdiag0vxUneuqFIfDQc/stP+5Y+4+gdamJa45lU+562xVHorsL6y0FylAhJutbfv+         znvw==
X-Gm-Message-State: AIVw111TcFtcwyooRe68jrTv9rMbeuE91Wpm0plY9c7XFa+6hWW/yHCO	QHoxdIrQQ+D+Pd6S
X-Received: by 10.28.127.14 with SMTP id a14mr6863607wmd.91.1499672353659;        Mon, 10 Jul 2017 00:39:13 -0700 (PDT)
Subject: Re: /dev/stderr invalid with nested and chained redirections
To: cygwin@cygwin.com
References: <76d702928e575369da13a1fce2fe4291.squirrel@mail.schneiderp.de>
From: Marco Atzeri <marco.atzeri@gmail.com>
Message-ID: <7532f52a-89de-9fde-e8a6-b93aad54f7df@gmail.com>
Date: Mon, 10 Jul 2017 09:39:12 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <76d702928e575369da13a1fce2fe4291.squirrel@mail.schneiderp.de>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 10/07/2017 09:18, cygwin-mailinglist wrote:
> I have a script which does not find /dev/stderr when its stderr is
> redirected and piped. The minimal reproduction follows below. This is a
> verbatim copy from the terminal with edited-in comments prefixed with
> hashes.
>
> $ uname -a
> CYGWIN_NT-6.1-WOW xxxxxxxx 2.8.1(0.312/5/3) 2017-07-03 14:06 i686 Cygwin
> $ bash --version
> GNU bash, version 4.4.12(3)-release (i686-pc-cygwin)
> [...]
> ########################################################
> $ cat say-something.sh
> #!/bin/sh
> echo something > /dev/stderr
> ########################################################
>
> ############### This is the error:
> $ (x=$(./say-something.sh 2> /dev/stderr)) |& cat
> ./say-something.sh: line 2: /dev/stderr: No such file or directory

I miss the need to redirect stderr "2>" to itself.


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

