From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101235 invoked by alias); 4 Dec 2018 14:22:01 -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 101203 invoked by uid 89); 4 Dec 2018 14:22:01 -0000 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 Received: from mail-it1-f195.google.com (HELO mail-it1-f195.google.com) (209.85.166.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Dec 2018 14:22:00 +0000 Received: by mail-it1-f195.google.com with SMTP id g85so15562600ita.3 for ; Tue, 04 Dec 2018 06:21:59 -0800 (PST) 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== Return-Path: Received: from [192.168.0.5] (d47-69-109-131.nap.wideopenwest.com. [69.47.131.109]) by smtp.gmail.com with ESMTPSA id f21sm5245282itc.14.2018.12.04.06.21.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 06:21:57 -0800 (PST) Subject: Re: Bash heredoc on FD 3 To: cygwin@cygwin.com References: <5c0427c5.1c69fb81.d71e5.c8ec@mx.google.com> From: cyg Simple Message-ID: Date: Tue, 04 Dec 2018 14:22:00 -0000 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00041.txt.bz2 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<> 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