From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7356 invoked by alias); 21 Jul 2018 23:36:46 -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 7331 invoked by uid 89); 21 Jul 2018 23:36:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_05,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL autolearn=no version=3.3.2 spammy=Shell, H*u:5.1, H*UA:en-US, H*u:en-US X-HELO: sonic302-4.consmr.mail.bf2.yahoo.com Received: from sonic302-4.consmr.mail.bf2.yahoo.com (HELO sonic302-4.consmr.mail.bf2.yahoo.com) (74.6.135.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Jul 2018 23:36:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1532216201; bh=r5HYNPZ4WFGzqDLxfATDrH5+pbHXh5ntm/mhkycukuY=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=V7Tle2fXrxpDjr4mufef5ZTgn+Wj9ydRW7ek3XOS79scO5ZJuwPE5CBOm9lu0sHn730rpgJg0zj+dCK4LfktdBY9dsRxVGy8E80SMxInksB+YTKEPjNiYEu1C8dOxVb3Ai2GjaDj2RlrEgHj0BfR0X/+zXiY/c/sr8MJuHuHukj/dZqpvg8bplP9UHdwC6iUDX4/kvpyCNSNoayFxP8wlMgYm7xHWy79ePlzySYgFCO+s+kBh67ctTyHPZUzZoSZDdykffOtamut3J4Wz8SCKpQN8wegSDh5+yflYIxc9sjHnrJR7Rinep9UDxZv+vZCMG+C/Yl1WOVf/FgR8V0urg== Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Sat, 21 Jul 2018 23:36:41 +0000 Received: from pool-173-66-240-59.washdc.fios.verizon.net (EHLO [192.168.1.8]) ([173.66.240.59]) by smtp412.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 016b0a83462eb24873e0ddd9c024b2bc for ; Sat, 21 Jul 2018 23:36:38 +0000 (UTC) Subject: Re: BASH 4.4 mapfile/readarray/read builtins mis-behaving with pipe [edit] documentation bug To: cygwin@cygwin.com References: <69b0bc3c-7ead-920e-f04b-ec631c3453b7@verizon.net> <2beb175e-2291-6b12-6efd-c84704f6762f@verizon.net> <07814e3d-d637-47c2-74fd-cb2916c29099@redhat.com> From: BloomingAzaleas Message-ID: <30b851ee-7144-345c-926d-8a08d9a6a27c@verizon.net> Date: Sun, 22 Jul 2018 05:42:00 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <07814e3d-d637-47c2-74fd-cb2916c29099@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-07/txt/msg00217.txt.bz2 Reply to Eric Blake, At this time, I do not have a Linux image available to me.=C2=A0=C2=A0 If=20 you saw the same behavior on Fedora, then I suggest the behavior=20 originates upstream at or close the the GNU source-code level. Mr. Penny's response asserted the observed behavior "is intended=20 behavior", in which case there should exist a GNU specification=20 document describing the intended pipe STDIN re-direction=20 restrictions for 'mapfile', 'read' and possibly other "builtins".=20 Lacking such a reference nothing can be said about intent.=20 Implementation-as-intent implies errors and conceptual and=20 behavioral=C2=A0 inconsistencies in the implementation were intended.=20 I decline to think that of the distributed BASH maintenance team.=20 He provided a reference to=20 http://mywiki.wooledge.org/BashFAQ/024, where, if you read the=20 page, the behavior inconsistency I reported is shown under the=20 heading of "More broken stuff:".=C2=A0 I take that "More broken=20 stuff:" opinion to mean yet others read the same surface=20 discrepancy between doc and behavior as I did. I believe what we have at this point is: A) GNU doc lacking nuance, attention to consistent terminology,=20 and helpful rule-statement to code example/counter-example=20 illustrations adjacent to rule statements.=C2=A0 For a doc=20 counter-example, the Open Group doc at=20 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html=20 does make an effort to distinguish behaviors between "2.14=20 Special Built-In Utilities" and "2.9.1 Simple Commands" whereas=20 the GNU doc indiscriminately mixes the words "commands" (section=20 3.2) and "builtin" and "command" and the phrase "builtin command"=20 (section 4) as if their behaviors are identical under the section=20 4 title of "Shell Builtin Commands"=20 (https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.= html#Shell-Builtin-Commands).=20 The GNU doc for shopt lastpipeis fairly opaque unless you have=20 deep knowledge and that knowledge is cued when considering the=20 possible meanings of "current shell environment" for built-ins=20 (same process) vs. external child-process executables. B) However conceptually inconsistent, an obsessive BASH doc=20 reader could imply the observed bash built-ins behavior by=20 integrating multiple hints and rule statements scattered across=20 the GNU doc and then, crucially, doubting the plain meaning of=20 the unqualified doc statements of "Read lines from the standard=20 input..." . Thank you for your response. Regards, UN*X Since '85 On 7/20/2018 12:08 PM, Eric Blake wrote: > On 07/17/2018 08:52 PM, BloomingAzaleas wrote: >> Reply to Steven Penny : >> >> =C2=A0=C2=A0=C2=A0 no mis-behaving: this is intended behavior - you your= self=20 >> have given >> =C2=A0=C2=A0=C2=A0 workarounds: either redirect output to a file that ca= n be=20 >> later read, or pipe to >> =C2=A0=C2=A0=C2=A0 command grouping ala {} or () and read stdin from ins= ide=20 >> the subshell >> > >> I suggest the following adjustment to the man pages inserting=20 >> a parenthetical cue regards behavior in pipes: > > Is the behavior you are complaining about unique to Cygwin, or=20 > can it be reproduced on a GNU/Linux box?=C2=A0 If the latter, then=20 > an upstream bug report is better than asking for a=20 > cygwin-specific patch.=C2=A0 [Hint - as the maintainer of the cygwin=20 > bash port, I don't recall adding any cygwin-specific tweaks for=20 > mapfile - and a quick test on Fedora shows the same behaviors] > -- 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