public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin@cygwin.com
Subject: Re: /dev/stderr invalid with nested and chained redirections
Date: Mon, 10 Jul 2017 07:39:00 -0000	[thread overview]
Message-ID: <7532f52a-89de-9fde-e8a6-b93aad54f7df@gmail.com> (raw)
In-Reply-To: <76d702928e575369da13a1fce2fe4291.squirrel@mail.schneiderp.de>

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

      reply	other threads:[~2017-07-10  7:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10  7:18 cygwin-mailinglist
2017-07-10  7:39 ` Marco Atzeri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7532f52a-89de-9fde-e8a6-b93aad54f7df@gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).