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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5001 invoked from network); 13 Nov 2023 07:14:00 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Nov 2023 07:14:00 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1699859640; b=aEdgXwabeqE6vfJ/41k6rdZd5wAnQxr4Cuk7aaHgMh1fmnHTfoyqSNhLyxHmx1L4+s02+v/zX8 0YNm8xv8axpnnBLWwple7up9j1elyvLTFsNZC2MtogdMsyKtEkc5DnhX3axQ66Mtftd9HlMwY9 VmEoyJ7/Q+sTG95MOaIgRJwQ1Ug2c8EIpDCNh1IO0qwXXoV+r/aS1coJ3hySf2Pyx2TIfEEDxO BHFYV9XBZNFQlfrU5uWqiktLmvPM5yfoDTz7D8V9tOHgZAzriObO9fNxQSgWsWDNLujIlClnT6 NsksV3NvxeRSke4ao2Li91AJk/dztSs/IOM31qu2XOxIwA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1699859640; bh=tw8YnnhOJTjEHN5ho+rOFjUpxm4cBomtekpMYz53MHE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:DKIM-Signature; b=Fy8C3FxJ7U8TUy3FdaIUBU62Wkgr7CG/fqkuZsV15xDXYOjoZT44DRLpv3Cg7TbxOD8k9s16fX Z8rcdEP4uyiGCt5OrRB5nfnNGxdfR7Tljh/Oj4xpDLl/X76AlHE3YbY8JksJJHIYreWVT81M00 Adk9FrTagwvrjLm4bM3DTCFfRut0BPb33FbVF8NLiOO09gmkMrD+y92FkvbowG2AT6qyIwQ3cD sNGqBSDWuXIXS7IIXVKzA6iHK6fuG4viVMEWNoovQwgqZ4A1YYZqAO65ukElm7Ryn37h+p1cMA 1RQPAE6Ta/zqw8eILcdaz9R/fqDdLx2Ex3kpdaykHiQtMA==; 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:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=KbZRbGq04uRt0W6b2eLos56CQuuyhas7bL1LVqgr03A=; b=VLKepmQVke84Jd+Jo67T1rwX3I hs8rql+sU22ExcgxxQEVQ78PysFq2ibL8UPosI1m+6RWfsF7cDohnc1it44qokoFVxlcC87y/jOYU BnxgTHwKr6IowLN/3hLNTQcu9OMNfnVyUS8wGXPX2oUDbU+8YHDJ+M+deDb474A0gY3hXrWvNiChF vpJl2u2X/CP08fzMN7meHg2doBhkC0rAzhoQRTV6tlQQkTsfYmBJkiLyPIJBPoMx3WgMU1iUBT7+s rqTTg5CE8WNO4fnIU9C/SoZ2KYYpf/u9kVtTrWPXyF3FKQyWaKM3msz9JYb0U2z8CFxLhRbPejJ9p /GrUSI/g==; Received: by zero.zsh.org with local id 1r2R8w-0002Y8-F1; Mon, 13 Nov 2023 07:13:58 +0000 Authentication-Results: zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none Received: from relay2-d.mail.gandi.net ([217.70.183.194]:41439) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1r2R8e-0002Hc-EO; Mon, 13 Nov 2023 07:13:42 +0000 Received: by mail.gandi.net (Postfix) with ESMTPA id 0EC7E40009; Mon, 13 Nov 2023 07:13:38 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 13 Nov 2023 07:13:38 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: Suggested changes to Etc/FAQ In-Reply-To: References: Message-ID: <2da3cd0f2900d052239dc94dc5b2dc44@chazelas.org> X-Sender: stephane@chazelas.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: stephane@chazelas.org X-Seq: 52298 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: About that: > In cmd1 && cmd2 &, only cmd2 instead of the whole expression > is run in the background in zsh. The manual implies this is > a bug. Use { cmd1 && cmd2 } & as a workaround. And in particular the "The manual implies this is a bug". That section was added to the FAQ in October 1997. At the time, the manual had: > If a sublist is terminated > by a `tt(&)', `tt(&|)', or `tt(&!)', > the shell executes it in the background, and > does not wait for it to finish. But that was later (2000: https://github.com/zsh-users/zsh/commit/ed8b82b9b1bf74392caf4f4683f367bc4cbbd193#diff-6a204419ff23048734de2793d1072ec031dcdcd08aeb14cf75c14ec953835bddL68) changed to what we have today: > If a sublist is terminated by > a '&', '&|', or '&!', the shell executes the last pipeline in it in the > background, and does not wait for it to finish (note the difference > from > other shells which execute the whole sublist in the background) So that's no longer considered as a bug but works as documented. So that "The manual implies this is a bug" should be removed I'd think or maybe replaced by something that notes that it was not originally intentional. { cmd1 && cmd2 } & might be better as (cmd1 && cmd2) & so it's portable to other shells and makes it more evident that that runs in a subshell. -- Stephane