delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/01/23/09:24:12

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Sat, 23 Jan 2010 15:23:51 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Bash process substitution
Message-ID: <20100123142351.GX2402@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4B59F278 DOT 2090902 AT gmail DOT com> <20100123110719 DOT GU2402 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20100123110719.GU2402@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Jan 23 12:07, Corinna Vinschen wrote:
> On Jan 22 18:46, Dave wrote:
> > Is process substitution expected to work in 1.7.1?
> > 
> > Here's what I tried:
> > 
> > kilroyd AT MINIME ~
> > $ uname -a
> > CYGWIN_NT-5.1 MINIME 1.7.1(0.218/5/3) 2009-12-07 11:48 i686 Cygwin
> > 
> > kilroyd AT MINIME ~
> > $ echo LOG:bananas | tee file.txt
> > LOG:bananas
> > 
> > kilroyd AT MINIME ~
> > $ cat file.txt
> > LOG:bananas
> > 
> > kilroyd AT MINIME ~
> > $ echo LOG:bananas | tee >(grep "^LOG:" > file.txt)
> > LOG:bananas
> > tee: /dev/fd/63: Bad file descriptor
> 
> I'm not quite sure how this command works under the hood, but it's
> possible that this can't work in Cygwin due to a restriction in
> Windows.  In contrast to Unix, you can't call open(pipe_fd, O_RDONLY)
> if pipe_fd is the write side of a pipe and vice versa.  If bash's
> process substitution relies on that, it's simply not possible.
> Dunno if there is a way to implement this using some hackery, of course...

Hang on, this is a EBADF.  Looks like bash tries to access a file
descriptor which isn't available (anymore).

Eric, would you mind to have a look into bash to examine what's going
on here?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019