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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22615 invoked from network); 19 Nov 2020 13:55:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Nov 2020 13:55:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605794156; b=sCbNBHnArLyG/GPKJ9cYvObws3hGZS44pCULghLkUXyqPnGmpZZGR/DqrvPVJTPPXrnsCZN7X3 8D5VDFm6GmaCoMItxMvbFbc/36HQ/S+iiW1Ui1KFPIh27sq3fN5u75zxQuaQxErkkqFceRorxk TJKQvcXvhISHX81qoUCCsS4r86Hz2uNX72XgZ8S4uJV1s2IjD5pS40hk64Mzi1LFL7kOh2w4kb a9jybxbNTvruMiTXTFQiVDDkUd8oo89IQbjTY816QBJ03w5rW3UwsjQRXB4KRVVz7ZIU1vhSgk oeMP8didIhfCHvnO85vULily2eHbnFDKr+0ZfwCqssNQWA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-40131.protonmail.ch) smtp.remote-ip=185.70.40.131; dkim=pass header.d=reichardt.de header.s=protonmail header.a=rsa-sha256; dmarc=pass header.from=reichardt.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605794156; bh=qA+sBmKUOuKcbXjm+5ntnDYPHb+pEFpm+JxeV7065nA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Subject:Reply-To:From:To:DKIM-Signature: Date:DKIM-Signature; b=nkQO41go2wbTUynmVZcAX16C4orln62jKJNWsKh2rBsONApOI7EPO7uef/RuW51pCYz/1BDXwA UBMLmBXK6QlWJ4XJzJ6yFpyCAQMypYDwM6F6rN8S5vc0u0pwvn3/9Ub5lfhSsBeGFO3WxpNDhZ Tq53ovkuibra5gMezeCkZkQeYuu45sfb7V8dGiDh9EihFRPqhgWeKiI/fgA6URthg9MErxpBoq WSnlTddZEa6wLqjHLaSrQg8zNLTNsgseUIFrxBVp4lzuHk6CCUGnNgsRojKSXpoc/UzB18Ydsn HOgtlzRJWEETsx7Tb8WzyMzV4V1Wr7PZV0mf82N1H9ro7g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Reply-To: From:To:Date:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qA+sBmKUOuKcbXjm+5ntnDYPHb+pEFpm+JxeV7065nA=; b=iklQKsgImuf9oHDmSevZ4/6HPp tTLoXEybQs3k3263RlI8GqySilLAO9iZDY4Zf05szrpg9WSW2KtCRMu9n7AoAV0eQepzqFX3xGP68 EyfmjZ4LQDGHjgnmHCr5GttUc6ojTnYZOa9Hbk5UTeenMZ/bLbhPYkN3uSKcv6quZIrS38bjSNkul hqiK2YRyChce+9GWsI2NagEd1yu+bzzjWTXbCg16eXr1Q5kj7Ia54dEJRT9ZkI9PEl/5JeVgGucAO L0muDTmOFnDt7PFqHRN3Cdg20wd5SJ5MB7zU8OOIxgh86SZnZv8APtUYgbxM0dQA6SE5ljW4czhvH XAllgkMQ==; Received: from authenticated user by zero.zsh.org with local id 1kfkPk-000Ju2-7b; Thu, 19 Nov 2020 13:55:56 +0000 Authentication-Results: zsh.org; iprev=pass (mail-40131.protonmail.ch) smtp.remote-ip=185.70.40.131; dkim=pass header.d=reichardt.de header.s=protonmail header.a=rsa-sha256; dmarc=pass header.from=reichardt.de; arc=none Received: from mail-40131.protonmail.ch ([185.70.40.131]:13163) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kfkPI-000JXp-Oi; Thu, 19 Nov 2020 13:55:29 +0000 Date: Thu, 19 Nov 2020 13:55:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reichardt.de; s=protonmail; t=1605794126; bh=qA+sBmKUOuKcbXjm+5ntnDYPHb+pEFpm+JxeV7065nA=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=LE8EXYIeyIqQ6zF/DBh9rKd3y3+ez9E0IqfFUcCUAG7uEeyKlpVw5GVwoCoSLzQxy a+Z95S7HLHXruqhzo/i5+QA0MAkwYWZTyM6R/hiwhNGPwmbJ2UYW55Fu4F2op92tcv tW90etOTRiDM8dIO6/2EL5JlVMFMKtkJj+Jf5WCM= To: Zsh Users From: Dominik Reichardt Reply-To: Dominik Reichardt Subject: Re: Apple bash to zsh script problems with error control and bash emulation Message-ID: In-Reply-To: References: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com> <20201116180129.4f6a851f@tarpaulin.shahaf.local2> <4254F6E5-249B-4DFF-8D4D-6D253D15AFB2@gmail.com> <5F28C80F-1AAB-4DBB-8B65-6544F66C3CED@gmail.com> <400E3641-0265-4DBC-98A3-D9E4A1E41164@covisp.net> <26ED4B54-363A-4A03-993D-AB447E062E2A@reichardt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 26188 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: > On 19. Nov 2020, at 14:31, Lewis Butler wrote: >=20 >=20 > On 17 Nov 2020, at 09:13, Dominik Reichardt wrote: >> On 17. Nov 2020, at 16:54, Lewis Butler wrote: >>>=20 >>> There is no reason to change a working script from bash to zsh just bec= ause the interactive shell you use has changed. >>>=20 >>> There may be other reasons to change a script for new features or bette= r behavior (For example, I converted many sh scripts to bash because of the= se types of issues, but I also still have plenty of sh scripts as well). >>=20 >>=20 >> Let me rephrase it: >> I switched my interactive shell to zsh on all my machines. >>=20 >> My script did no longer work correctly even though the script invoked ba= sh (Apple=E2=80=99s old bash). >=20 > Most like that would be because you did not have the same version of bash= . If you installed bash via a port manager, you were running bash 5. The ba= sh that comes with macOS is 3.2. this is almost certainly the root cause of= all your issues with the scrip I have to concede the point. I was not able to make the original script run= on any prior macOS version in the 3.2x bash provided by apple. So I MUST h= ave used bash provided by MacPorts but on some migration to a newer macOS m= ust have lost that and completely forgot about it, too. >=20 >> My script did work correctly after I changed ti to invoke zsh without ba= sh emulation and some fixes to make it work. >=20 > That's good, glad it is working now. But the issue of bash versions is on= e to keep in mind, as bash3.2 is very very old (2005?) and most bash script= s use at least some of the fixes and improvements in bash 4.x even if they = haven't adopted bash 5.x changes. >=20 > I would recommend having bash5 installed as you are likely to run into ot= her people's code that is written for bash 4.x >=20 I=E2=80=99ll keep it in mind when I run into problems. If I install it proa= ctively, I will just forget again why I did it :) Cheers, Dom