X-Recipient: archive-cygwin@delorie.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:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=f50tq55bC8IaCsAi
	cY6lIoV0BChjnWE13XoRW/qXzwI3rUyvpZ/couXEBxOx2hagE9rq2QydtNbCVWZS
	EAnGvE8CSXUmHj+Ur+06qi8PjBf5wQxjn3m3cPsPZ5ND+uKLY3Megi7epIXT06wS
	URgLtXct1haD5NceuMihJxqjQRc=
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:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=R8/gKkTXAx3wUNT47sSETk
	BCe2Q=; b=rOQ+YDAYD7hCfcME/o6JxrejwscB3OaYNv54TCAda3R7jI167G3K0F
	VzUiZQEyLxPJI1tgHYMrFR/A+jSF8lAPHvVnejcBIGUra0clYG4kltPMoD+lBxOh
	sEqFQHN8sGG4dhKZBTZErG6W/WBUdFV3V6aenZKPJJx1NUL+pEJAQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=cyg
X-HELO: mail-it1-f195.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s=20161025;        h=subject:to:references:from:message-id:date:user-agent:mime-version         :in-reply-to:content-language:content-transfer-encoding;        bh=tBa/qgT//UAgGaQqmNkF0FkOiyw+BqARUSzBuUKsJUo=;        b=Qq9et7IkLFF+6WjdVRnRJ+x5Yxzr9OfKU7IpLenvibagih2WDTcvZet3waBYj67T9T         7MzSbmgbUnascy1qHCgdn2GNZdX88Uk06Dg/j3ieNonfn+3DZuFLWJ3MGXn1nznl1R9o         lpfpjKCUegSOQzHbCWFK/1y8LKUx1MDsa5F2GBBLTV7YcQdVNwuHSO7RgB2fqwo/AdCH         fTkhrD/C0pi5pfmuuluCDX+V7/4dViS060jUZdm8drKF11k4FTwMdARvmugIXpI7c4A/         E8ZrhQggSXbXsGmP876OBcE9NGXdbRFK7js/XYTFXCUBKlCjHaMCV8ywu9amSpQ7By5i         kzLw==
Subject: Re: Bash heredoc on FD 3
To: cygwin@cygwin.com
References: <5c0427c5.1c69fb81.d71e5.c8ec@mx.google.com> <c6d1ba2d6a7a0daa32aee92f806a30dd@smtp-cloud7.xs4all.net>
From: cyg Simple <cygsimple@gmail.com>
Message-ID: <f720272e-c246-e807-d9a5-1cbccbd36a62@gmail.com>
Date: Tue, 4 Dec 2018 09:21:55 -0500
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2
MIME-Version: 1.0
In-Reply-To: <c6d1ba2d6a7a0daa32aee92f806a30dd@smtp-cloud7.xs4all.net>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

On 12/4/2018 7:13 AM, Houder wrote:
> On Sun, 02 Dec 2018 10:43:17, Steven Penny  wrote:
>> Using this file:
>>
>>      $ cat hello.sh
>>      awk -f /dev/fd/3 3<<eof
>>      BEGIN {
>>        print "hello world"
>>      }
>>      eof
>>
>> it runs as expected with Dash:
>>
>>      $ dash hello.sh
>>      hello world
>>
>> However it fails with Bash:
>>
>>      $ bash hello.sh
>>      awk: fatal: can't open source file `/dev/fd/3' for reading (No such file or
>>      directory)
>>
>> I tried also with Debian and both Dash and Bash work as expected. What is
>> causing Cygwin Bash to fail here?
> 
> File to which symlnk /dev/fd/3 refers has "gone"; different from Linux, where
> the file is "deleted", but still "available".
> (note: dash uses a different implementation)

Dash is faster in processing the data but can be made to fail if you add 
-d to the ls commands you're using.

-- 
cyg Simple

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

