From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35354 invoked by alias); 10 Jul 2017 07:39:18 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 35340 invoked by uid 89); 10 Jul 2017 07:39:17 -0000 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 Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Jul 2017 07:39:16 +0000 Received: by mail-wr0-f175.google.com with SMTP id r103so126628730wrb.0 for ; Mon, 10 Jul 2017 00:39:15 -0700 (PDT) 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) Received: from [172.21.192.193] ([149.6.156.42]) by smtp.googlemail.com with ESMTPSA id p7sm10213548wmf.11.2017.07.10.00.39.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 00:39:12 -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 Message-ID: <7532f52a-89de-9fde-e8a6-b93aad54f7df@gmail.com> Date: Mon, 10 Jul 2017 07:39:00 -0000 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 X-SW-Source: 2017-07/txt/msg00130.txt.bz2 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