delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/05/29/23:30:43

X-Spam-Check-By: sourceware.org
Message-ID: <465CEFC9.3030107@cygwin.com>
Date: Tue, 29 May 2007 23:30:17 -0400
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070308 Fedora/1.5.0.10-2.fc4.remi Thunderbird/1.5.0.10 Mnenhy/0.7.5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: more on Re: bash process substitution "<(list)" [spot the difference]
References: <465CE9DE DOT 4030907 AT alumni DOT rice DOT edu>
In-Reply-To: <465CE9DE.4030907@alumni.rice.edu>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

B. K. Oxley (binkley) wrote:
> I am exploring how process substitution works on Cygwin.  I have scripts
> which run fine on Linux but not on Windows XP.
> 
> Why does one of these scripts produce an error and the other does not?
> 
> Script #1:
> 
> $ cat a
> #!/bin/bash
> 
> function f()
> {
>    echo "$1"
>    cat "$1"
> }
> 
> f <(echo OK)
> 
> $ ./a
> /proc/self/fd/63
> OK
> 
> Script #2:
> 
> $ cat b
> #!/bin/bash
> 
> function f()
> {
>    ls -l "$1"
>    cat "$1"
> }
> 
> f <(echo OK)
> 
> $ ./b
> lrwxrwxrwx 1 luser None 0 May 29 15:49 /proc/self/fd/63 -> pipe:[1728]
> cat: /proc/self/fd/63: No such file or directory

With the exception of a slight bit of file name conversion, I get the same
result as you do with Cygwin when I run on Linux (FC4):

# /tmp/a
/dev/fd/63
OK

#  /tmp/b
lr-x------  1 lhall lhall 64 May 29 23:26 /dev/fd/63 -> pipe:[916212]
cat: /dev/fd/63: No such file or directory

This is using your scripts verbatim.

-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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