From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27079 invoked from network); 22 Oct 2021 14:25:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Oct 2021 14:25:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1634912710; b=Vuq9r0T2U1L+UvF1IDIvjmRbyn4SNVZUECdHWHSSTKObtTX14Dvvpcj9bEhueFvDEsCygXGubA 2dTS8kGFgiU7pcEQ/fDFBJx/m5m8XvhQ/F15x3kUeH4TAIaZQNCbDmW8rx5FKqRQKs5GvnkR5X hBwzYpwPPKVBH8dDwCuQimqRHB89qa1+VKtqZ2h8L54EfrEmNfVB4pgDh+NhyVNZIQh+xjdVV0 kVukBugvBnoQ6bEQDU2bjgk52i38aokfbXpcKP7IPRjE/nLVy98PTeEWsDHjkwx0EaBDWNFXr4 f45ujvVeaZ3PKlOrIbI1PR9rMUjrs0LeMeJUbqcr69/Cww==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (shout01.mail.de) smtp.remote-ip=62.201.172.24; dkim=pass header.d=mail.de header.s=mailde202009 header.a=rsa-sha256; dmarc=pass header.from=mail.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1634912710; bh=f84KUwhJHNbDHF9fmtAu3GFImkmmqTXs0oRF7htJef4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:DKIM-Signature: DKIM-Signature; b=U2ytqkQ+r2mvJcnq4TZZpxoZ1fNM7LHS63ew2Ca+S8In1EmsLVjIYCFk/oGp5+82atjo773MU/ SWK67TPGH1kK4jqOok6SRZwD8VIYXg/S1Zk9HIHUqfNSNeZf61AIpXUgMCCBBKt5+x/DLAU5Wq tlOUdVyN+8Zw8y3wx6WMLuUBrmSKNl6eTNvXsN7ol/uXXkm5olGtkVQLlNkb5iMIj3QXMqLcb7 jewgNlcqa0JQwI5rkalHoeSYJ0LO2DWPQZTs5Ju+CCYEaWu2YirNdV3TxnCu+NuoTTcOdNoP+F YFGpXiFck2Soe7XMaXhhZQL4XpwAqDcBmxGLchFSVshyUg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=eLzlZpROwr3U3f32WB4Q9L20Q5qbsk3zwdwKbdlUa+4=; b=OLCzmRSy3D7S3Tyf4+AEqLEZ0h pcp6KhMYYSm4GgiVXWXV2D7c1/QkjlQywh/nG0RGzEgC61ESQVSoM6UVQcjN5i9TuwKAg3Ke1laVa jvehcyoUoUD6fy3xZBmSWhMDepMfJP6dk7mSMq6ft8afVZ5tWlmeWBNMjrenktHRd3x9Tok0ZJevI wkLYpZsuyJHs9F45kwYwBbq4XOCE4wywVt1oSgX5GQ5ZV5i28uB/4cR8WZriw+mknfKsN1+iXskwJ +sfDNeXed2bnTu/UUU6vIRp8xhPXQo82H/wAKl3eT8T62upIYcr/qg8fCVT+t/DcoOQCoQH+bR72i 3T3Pxz1Q==; Received: from authenticated user by zero.zsh.org with local id 1mdvTp-0005mQ-TA; Fri, 22 Oct 2021 14:25:09 +0000 Authentication-Results: zsh.org; iprev=pass (shout01.mail.de) smtp.remote-ip=62.201.172.24; dkim=pass header.d=mail.de header.s=mailde202009 header.a=rsa-sha256; dmarc=pass header.from=mail.de; arc=none Received: from shout01.mail.de ([62.201.172.24]:55131) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mdvSl-0005Tp-L8; Fri, 22 Oct 2021 14:24:04 +0000 Received: from postfix01.mail.de (postfix03.bt.mail.de [10.0.121.127]) by shout01.mail.de (Postfix) with ESMTP id D397AA0B5D; Fri, 22 Oct 2021 16:24:02 +0200 (CEST) Received: from smtp01.mail.de (smtp01.bt.mail.de [10.0.121.211]) by postfix01.mail.de (Postfix) with ESMTP id BB0CE8002F; Fri, 22 Oct 2021 16:24:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1634912642; bh=f84KUwhJHNbDHF9fmtAu3GFImkmmqTXs0oRF7htJef4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Nm80YWa0DiVKEIcwYRvPxUokp+SV3JmUkzmUq/8+1cA1Ds86FO9xOR0OPOLIwu+V2 RznhhqPEXIyM9G5d0Yji+GYlL+Nfx9xGDT12pT+hY2vEQCYjgqDNO6qHkc2zyA7g+6 IK4ffjlHLFpX1GHoh909uaxvcGnNU6W2hqBZDe1HhCbS1Vq7W0ft+wTHgrxkbTUCyg F20WBziLGh+8/dbkRFR1l0jfp1NHDa0rogqp0+qNNucjzr0ciPXd2JEYRKLt8noTZS 419P4vySVYx034Z7HaGt2jVRyGfqsD8Ts4vGlzUaXb8WbQAvBeRhTtPPolL9lrX/8q B+79Qk3THoC6g== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp01.mail.de (Postfix) with ESMTPSA id 2198A100485; Fri, 22 Oct 2021 16:24:00 +0200 (CEST) Subject: Re: Unexpected stdin-behavior To: Bart Schaefer Cc: Zsh hackers list References: <2abd99f9-c1c0-1385-f8b4-be9b8f14c4d9@mail.de> <13d30855-d91c-7def-6834-f0ec24cfd598@mail.de> From: Tycho Kirchner Message-ID: <8b398ade-e4d2-f795-ad4f-b72b21e7fe75@mail.de> Date: Fri, 22 Oct 2021 16:24:00 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1248 X-purgate-ID: 154282::1634912642-00006C31-16365D07/0/0 X-Seq: 49517 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: I also sent an email to the dash-developers regarding the same issue, you may be interested in Chet's response: On 10/22/21 7:11 AM, Tycho Kirchner wrote: > Dear DASH developers, > I think stdin should be consumed line by line in order to make passing to > other commands possible. Please consider the following difference between > the stdin "consumption" between bash and dash If you're curious, POSIX specifies the bash behavior. From https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html#tag_20_117 "When the shell is using standard input and it invokes a command that also uses standard input, the shell shall ensure that the standard input file pointer points directly after the command it has read when the command begins execution. It shall not read ahead in such a manner that any characters intended to be read by the invoked command are consumed by the shell (whether interpreted by the shell or not) or that characters that are not read by the invoked command are not seen by the shell." Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/