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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19996 invoked from network); 19 Nov 2020 13:32:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Nov 2020 13:32:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605792725; b=xVaBwCpnJBk2R/IErD0eepZhwKkiIzk2buHekmANqL5PbX1FifX0qXNTZRArB70CAcI9EeNTk/ 4Ue+VN9ukPTGrDkDHWmCepSj+eHMHGcvlSq4Ca7TrivOv+YchnJ5s7our5fBEQkZA5jmRbAuwJ HyW+bkE+S2FChpX/YX4iHkDXc+tm4QVGBCRN/J7ykOekHGtvck/JQ2xAtoAwyHWcnS0yOzdQ20 tymMInzEEpZvFHJhOR1/IwUX9KP0zn68qk6lafO+7INKdNcrom5pdta3HnO/tCXYLB/59wUKjs om7u9kg9HFnAR/a8vCqIdF/PPYj0ZYjvGp12ZzMenC/G/g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail.covisp.net) smtp.remote-ip=65.121.55.42; dmarc=none header.from=covisp.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605792725; bh=JjqYgMJIwMBdt6+q4QbSVIkKNkRlxFTY79t8QCv1iQg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Date: In-Reply-To:From:Subject:Content-Type:DKIM-Signature; b=zEp/f/KEi3+TY4tdTssHdn5V5R+xc1OvVpEkxjamBHtByVXWzWN/0cXFig80d9aHbIwNnrmnwV ZtTwpmlcICUVshQym/mI4Rkl5dx47UkyJhbqtYZ9Ez4C3GPkh1jG32UgR7utX1YOhAMUsojd9J cuILTwDGjXkTIeLi8DsrxGXIfxVx8AeTtwoRsTcrua331Il7YXyjFH46UVmfUmVQPWwHfglhO5 gSnr1nIgv5vCHbuNYB2Ck8wYyS6pbZWPDT8Q3ecwHt4juIp10TUo7htS8Xukl5JqqmqEOfPgYX /atEpwOXuHbzem9AO+DC36W2Xoz5atp0QvxZk8GURhONOg==; 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:To:References:Message-Id: Content-Transfer-Encoding:Date:In-Reply-To:From:Subject:Content-Type:Reply-To :Cc:MIME-Version:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JjqYgMJIwMBdt6+q4QbSVIkKNkRlxFTY79t8QCv1iQg=; b=GfxZkyO+c2JMidye3E3WKwmK4i Ok1g7snSz2WdbdDdEdCvTa2iVdEqIqMDj5qyCx4aajsPobQ/1M/zVdxpoULO3gKiel3jxPzigTbqm nqu95szWVWwi0Ff7Qptbi2wYvHIge2+sKQJDHszkTwE2jw500kLog4BwPs4EP2xPJWXvKhN3qo5lq ZOb9lVaVw/V7my/DcRJb0zrzgblHqVtcPvjvil5g1mJvwIBbeyiBeFRKfmTSJRGTprhHK90RhR3cS 8TSNOg86e4baNcgTNkG6bTeV1IymOLxDyBVs0oQrLtGAPP2Y7LLgnTrMGO3y15bzl+XsraR9jC4GN +B8o4SoA==; Received: from authenticated user by zero.zsh.org with local id 1kfk2X-000Imp-3S; Thu, 19 Nov 2020 13:31:57 +0000 Authentication-Results: zsh.org; iprev=pass (mail.covisp.net) smtp.remote-ip=65.121.55.42; dmarc=none header.from=covisp.net; arc=none Received: from mail.covisp.net ([65.121.55.42]:33660) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kfk1y-000IPz-2i; Thu, 19 Nov 2020 13:31:23 +0000 Content-Type: text/plain; charset=utf-8 Subject: Re: Apple bash to zsh script problems with error control and bash emulation From: Lewis Butler In-Reply-To: <26ED4B54-363A-4A03-993D-AB447E062E2A@reichardt.de> Date: Thu, 19 Nov 2020 06:31:18 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: 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> To: Zsh Users X-Mailer: Apple Mail (2.3654.20.0.2.21) X-Seq: 26187 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 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 = because the interactive shell you use has changed. >>=20 >> There may be other reasons to change a script for new features or = better behavior (For example, I converted many sh scripts to bash = because of these 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 >=20 > My script did no longer work correctly even though the script invoked = bash (Apple=E2=80=99s old bash). 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 bash that comes with macOS is 3.2. this is almost certainly the root = cause of all your issues with the scrip > My script did work correctly after I changed ti to invoke zsh without = bash emulation and some fixes to make it work. That's good, glad it is working now. But the issue of bash versions is = one to keep in mind, as bash3.2 is very very old (2005?) and most bash = scripts use at least some of the fixes and improvements in bash 4.x even = if they haven't adopted bash 5.x changes. I would recommend having bash5 installed as you are likely to run into = other people's code that is written for bash 4.x --=20 =C9=B9=D7=9F=CA=87nq=D7=9F tel:+1.303.219.0564