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:message-id:date:subject:from:to:reply-to :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=m6G+6vEjcp91hRGUEXCP05SoCJqcc1TmQiHDF720tfZeo5VBbFwpO +Yr2mXKfWKF+QqwIVgYyRap3uZNvFg1ZPt7HjXHUeePIj4wkyyUIj//oC81FbRim TTlYMIAuY/DeiH7JosNwHQlqJa8mS/GzU/Lg3cWPnUSpODOZGJrtiY= 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:message-id:date:subject:from:to:reply-to :mime-version:content-type:content-transfer-encoding; s=default; bh=hTMKdoyXc6ASwrUh61+IqwnsG+g=; b=F5dZPSdpHk0SCHbaCCDgfrcP55L0 U0xh3QM6QLsvpRblbV5nJRRFIXjbHYI3CI/NN63RWLuraU0LXWrBEYl22Btzkn+D F447CE2dPEQbtTlTNHh2TGVz3NRDQbjDF+1ROmxiS4V4/mmMNw1IyE05fVN4ecBr 37WNL3Bhj1h0ev8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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-Virus-Found: No X-Spam-SWARE-Status: No, score=1.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*UA:SquirrelMail, H*u:SquirrelMail, H*M:squirrel, H*MI:squirrel X-HELO: www.schneiderp.de Message-ID: <76d702928e575369da13a1fce2fe4291.squirrel@mail.schneiderp.de> Date: Mon, 10 Jul 2017 09:18:03 +0200 Subject: /dev/stderr invalid with nested and chained redirections From: "cygwin-mailinglist" To: cygwin AT cygwin DOT com Reply-To: cygwin-mailinglist AT schneiderp DOT de User-Agent: SquirrelMail/1.4.23 [SVN] MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 ############### Variants without sub-shell, piping or redirection work: $ (x=$(./say-something.sh 2> /dev/stderr)) | cat something $ (x=$(./say-something.sh 2> /dev/stderr)) something $ x=$(./say-something.sh 2> /dev/stderr) |& cat something $ (x=$(./say-something.sh > /dev/stderr)) |& cat something $ (x=$(./say-something.sh 2> /dev/stdout)) |& cat $ -- 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