From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7058 invoked by alias); 20 Feb 2018 09:33:04 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23151 Received: (qmail 28815 invoked by uid 1010); 20 Feb 2018 09:33:04 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.12):SA:0(-1.9/5.0):. Processed in 11.553272 secs); 20 Feb 2018 09:33:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180220092702euoutp0209fd71e197aff0390a36780c0fd837c5~U-oVVYc9Y0176901769euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519118822; bh=lw1l2zLglbnijFE1mmOmSbK4LEcg6cOynPx1+2ky9RI=; h=Date:From:To:Subject:In-reply-to:References:From; b=LkCyW9LdRG3k3F48O4K6l2m8RkxxYXB9IHEWNzU7gUNHmEZNY2zYK0C91EhbEhuIY dmB7IW/m2mUSsS9FiVFO2u91gcmRFG+24jPG9YYB1W5fb5aDPw0Krz6XaMpOg3/D4r vozfyqMinRvfJsWGzhvQJgrKWnPvKY9MEYEqqiQY= X-AuditID: cbfec7f4-6f9ff700000043e4-9c-5a8be9e5c673 Date: Tue, 20 Feb 2018 09:26:59 +0000 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: &&|| Message-id: <20180220092659.2233e6ef@pwslap01u.europe.root.pri> In-reply-to: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRmVeSWpSXmKPExsWy7djPc7pPX3ZHGfTvMrXYcXIlowOjx6qD H5gCGKO4bFJSczLLUov07RK4MprmZxUc5ah4uOMOewPjdbYuRk4OCQETiYm3/wPZXBxCAisY JT5t+cUI4XQzSWy/3MQCU3Vx7WZmiMQyRon1s7ZBtUxhkvi4Yi07hHOGUWL65qNQmbOMEodv 9IJtYRFQldj+vIMJxGYTMJSYumk2I4gtIiAqsXzFZnYQW1hAUOL90ZlgcV4Be4mft++D2ZxA 9sTZi8B6+QX0Ja7+/cQEcZO9xMwrZ6DqBSV+TL4HdiuzgI7Etm2P2SFseYnNa94yQ9RPYJN4 uE4dwnaRWPusD2qOsMSr41vYIWwZic6Og1DxfkaJJ92+IM9ICMxglDh9Zgc0yKwl+m5fZIRY wCcxadt0oAUcQHFeiY42IYgSD4lH7/dDzXGUWLTlJBMkUD4wStxcuZV5AqP8LCR3z0Jy9ywk dy9gZF7FKJ5aWpybnlpslJdarlecmFtcmpeul5yfu4kRGPmn/x3/soNx15+kQ4wCHIxKPLwC d7uihFgTy4orcw8xSnAwK4nwOi3tjhLiTUmsrEotyo8vKs1JLT7EKM3BoiTOG6dRFyUkkJ5Y kpqdmlqQWgSTZeLglGpgXHBjrfQlDvbY6p2fvj86UtCulia14vVZgbvazGrhP3Y3xU+pa9mv v8wizW9qYt0SswNb/DmsfkzMNT5Xem9jLXNMREFVUFXz9X7T/bkfmNitNVRk5Cfp1XnP/37q 6cxUq195ckeen94cf/Sl6dzMnbsarhtcV8+emuDxZNK0y53Rr80PT3VtUWIpzkg01GIuKk4E AP7aUYP4AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t/xa7pPX3ZHGVyZLG2x4+RKRgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZTTNzyo4ylHxcMcd9gbG62xdjJwcEgImEhfXbmbuYuTiEBJY wihx61cPO4QzjUni6sO9bBDOOUaJq/d3QpWdZZRY+fUHC0g/i4CqxPbnHUwgNpuAocTUTbMZ QWwRAVGJ5Ss2s4PYwgKCEu+PzgSL8wrYS/y8fR/M5gSyJ85eBNYrJPCBUWL6fV4Qm19AX+Lq 309MEPfZS8y8cgaqV1Dix+R7YHuZBbQkNm9rYoWw5SU2r3nLDDFHXeLG3d3sExiFZiFpmYWk ZRaSlgWMzKsYRVJLi3PTc4sN9YoTc4tL89L1kvNzNzECg3bbsZ+bdzBe2hh8iFGAg1GJh1fg bleUEGtiWXFl7iFGCQ5mJRFep6XdUUK8KYmVValF+fFFpTmpxYcYpTlYlMR5zxtURgkJpCeW pGanphakFsFkmTg4pRoYk8X9PPfdl2ANCpdMdd+uXnnh1+mvGSrfbQzsXZd/P/xV8a1U9qtL /tNyr7HP+NvR29P/b3WcfmE3v3f80zW/C1tUdq5aWb29J+bBmmt60X8+TFnuecd+JVOQz4uz 1+uz/bT/KE8Jv3payKfgxds9rY96VXYr+fTYrHpn9CDJMLQpcV7dzTpnJZbijERDLeai4kQA n7ragVYCAAA= X-CMS-MailID: 20180220092701eucas1p2f630b95dfb10adf27e47026606caf81b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180219224853epcas1p1db63db3e55fdede639955348264f21aa X-RootMTR: 20180219224853epcas1p1db63db3e55fdede639955348264f21aa References: <64c5472a-b174-00b6-7ab0-b65d664be675@eastlink.ca> <20180219215726.4c25cc7d@ntlworld.com> On Mon, 19 Feb 2018 14:47:12 -0800 Ray Andrews wrote: > > You can affect the precedence with braces, but they need to surround the > > "&&" or "||" expression you want to protect. In your case you've simply > > surrounded a pipeline which would be run in one go anyway: > That's my question, could my code be made to work more or less as it > is? I think you were trying to make the status depend only on what was before the first "&&". You can certainly do first-statement && { any-old-stuff } and it does have the effect of "if", though there's no obvious reason to prefer this form (some old shell code is indeed written this way). The key points are - the open brace is the first thing after the && - the close brace is after the last thing you want controlled by the status of first-statement. The real point, perhaps, is to be able to separate out that any-old-stuff as something contained within the block, however complicated it is by itself, so you may just have been getting distracted by pipelines and ||s etc. pws