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 24140 invoked from network); 16 Nov 2020 18:02:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2020 18:02:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605549730; b=jcfceAIsJzrcpyPZMyEmhOKmRhgS8cVWb/h+iVN6OgrgYB1PJ/HtpFRfWacPO6HNkbjdJilTvU Xr7nLwHZYXQz+2j9Fs/NtekgRpvNuzz2WXnEGhKqBQQnQ2J6vqcoNK4VZj8Yy5jtoKBWNb1Vx9 k45mD9rDUpNmHGRJW3rXBLDoEAT2qEyhtbi3R2YEOfClWuw47+M/X1J3yiTdemJwiX9KjMOsjk dQ6NiNryYXoag31DzGHzQ+qmy9nOYVMjitFePoztZ13uq0pabl5xHXA2T+aPqFFuyRr31yv4hQ wsENF4dbjst3UPpjUAJHkrejV5Zl/062dgEW2vmHKXXfGA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605549730; bh=nwN2v7IGZMWgC/WZlwqrmRBqhsgwGOPex5uariZA1TE=; 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:Cc:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=o7RDwxhpuRzYuh7lxvCLZl+vpsvf0crmTdA23tHecPN7v1sxQgIDBU8j4c/2jfCyZKCu39kAYx gf4uukNN7g25qKc0u/8P2xL+0QCg1jVxG3WEd5d+XAKcmbFDj1pH8sTqQMea0DsZjCHRykqHrs 0cAiHkVrfwwfNe9OJ/0Le/FU7+P3w9lmpYqepiy4EPpVej/7M35sRYiX4F2sjONYDJ0btSqRzT /b2LQEoSnCCRZ/LmqUoX0sgjL7K7wJrN3kVrYsrzHpn/9/LVf5dYw78CuuGuLKgUgux6QcFkam vzc0zu6GZjik5Xs653R6v/xDvFmm6elg8jG7UY72/OBrcw==; 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:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=OEtHafoqnYUN1U5fi2RTzi5ej6PQOAiHIADuTRoWxhI=; b=UvjaOewf+RMIfdWiLsLg0SZwJ1 +p7shPb6WAqLqThNkej+cYO+CyGiyqepBMv1GQzUmn30wxKQJIMKTC4KN7GL/vJczHspZvsK8SN1i aRVB1bs/Zip52sr2BO7YkmUIYEIIb/JRYzb7xIiYPlw4kVQn7OsgWm819Xl44KcI15A3bZIo0fp2x hcG7gFjRZtx0diI3YZIeqZzhccdiH5/jmqZQxFJuEbXAtOTiPqb56rbut0hGi2mt4uYIvDcvmmmtk gqQRhO0+4sEJzl+cHkWI09st9la07hI6oVr8+9iLKXOS7XQmkklrzatVcor6Etaa6Gc4mdIB0rVZI 8/HutckA==; Received: from authenticated user by zero.zsh.org with local id 1keipM-000AXQ-Nu; Mon, 16 Nov 2020 18:02:08 +0000 Authentication-Results: zsh.org; iprev=pass (wout5-smtp.messagingengine.com) smtp.remote-ip=64.147.123.21; dkim=pass header.d=daniel.shahaf.name header.s=fm1 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:50501) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1keioq-000AAg-0y; Mon, 16 Nov 2020 18:01:36 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E58889D7; Mon, 16 Nov 2020 13:01:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 16 Nov 2020 13:01:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=fm1; bh=OEtHafoqnYUN1U5fi2RTzi5ej6 PQOAiHIADuTRoWxhI=; b=AkzlR0+/eOWwnI10T/Kao8R4dasdOLST+SlhJnzy+m XWgAMXWnjAjTi3/6Yw2eilRW8zuswRNamisUomzTC7PRBw9QlomqsPDYfuyicds7 qah+4UJxyL/sLH8mSxbl85xq9EHuRGZTUEQhAIP5OlyXuR2cp9xD7shXfrs+LCil UA/EIiTJ22x8+ied8akqsJrvxcishNnPnPGZuP5xAc0nii+oeFJkJHFrgZc8EWyN v3J2pI0ZS/rQWf5ZjWckfU+uGHF2B/Z4x2uRUNOTO/jJWnwt+3hOw7DGXHFfzHWS JY/QNRemM1B64LXFFWkNTb2INq5ZZwT65X8Y6jtg3itA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OEtHafoqnYUN1U5fi2RTzi5ej6PQOAiHIADuTRoWx hI=; b=hUy0D6CNa0vGrdc4S6qdhdQSCsm4ARi1PqeWcfeg7PI1J3MmPLLFjX4rB Md7eGQx3sxIpLuAj+6zdfG29XHaYfwfo49l1eTpHaQ5pgNizvsTUg9mF5DciOEkp kSeuMb8+WI/GrEG2hXfF6ObVK4jQ7+bS0DfyEvRVulmHWVadCBBaCN9eoINYw3bK aaLrSPArX7EauaQVCJMNS4GhD/msgU9Og121pCzIAiSTaQEZkhIvOktgAAxUWovC y6cVc576jJk9oUEbB7V4J+JBvqud7HM1w9+DnaSbQzIjeY2LKHzsvBBbck6QoFWT ydR34jDDg4G/Al6+zv8EeTRye9b5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudefuddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesth hqtddtredtjeenucfhrhhomhepffgrnhhivghlucfuhhgrhhgrfhcuoegurdhssegurghn ihgvlhdrshhhrghhrghfrdhnrghmvgeqnecuggftrfgrthhtvghrnhepieehffegudeiie eukeeghfehieekieeiieegfeegjedvteekvefghfeihfffvddvnecuffhomhgrihhnpehg ihhthhhusgdrtghomhdpshhouhhrtggvfhhorhhgvgdrnhgvthenucfkphepjeelrdduke dtrdeikedrudefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvg X-ME-Proxy: Received: from tarpaulin.shahaf.local2 (bzq-79-180-68-135.red.bezeqint.net [79.180.68.135]) by mail.messagingengine.com (Postfix) with ESMTPA id E6C1D3280063; Mon, 16 Nov 2020 13:01:32 -0500 (EST) Received: from tarpaulin.shahaf.local2 (localhost [IPv6:::1]) by tarpaulin.shahaf.local2 (Postfix) with ESMTP id 4CZcMb2BFyz1vM; Mon, 16 Nov 2020 18:01:31 +0000 (UTC) Date: Mon, 16 Nov 2020 18:01:29 +0000 From: Daniel Shahaf To: Dominik Reichardt Cc: zsh-users@zsh.org Subject: Re: Apple bash to zsh script problems with error control and bash emulation Message-ID: <20201116180129.4f6a851f@tarpaulin.shahaf.local2> In-Reply-To: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com> References: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Seq: 26171 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: Dominik Reichardt wrote on Mon, 16 Nov 2020 16:00 +0100: > I=E2=80=99ve recently moved to zsh as Apple is pressuring us :) >=20 The easiest solution is to keep the script as =C2=AB#!/usr/bin/env bash=C2= =BB: https://github.com/zsh-users/zsh/blob/04bd9a44a74683ad0d83921bfb3aa0c4d5992= c75/Etc/FAQ.yo#L2056-L2102 > Something goes wrong in the error(), pipestatus() and teelog() functions,= I guess. But I can=E2=80=99t quite tell and I=E2=80=99ve built that script= 5 years ago and am a bit rusty to what each of those function do exactly. Well, for starters, $PIPESTATUS doesn't expand to what you think it does. > What I expect is that when the script runs into an error it stops, even i= f the error happens in one of the functions but currently the script goes o= n and on. This used to work before in bash. See =C2=ABset -e=C2=BB. You probably have it set in your bash global setup. See also the ERR_RETURN option. > If I get rid of the =E2=80=94emulate sh, my variables don=E2=80=99t get p= assed on correctly (the error I get in the shorted version of my script is = "configure: error: unrecognized option: `-q --disable-data --with-macosx-st= atic-lib-path=3D/opt/i386/lib=E2=80=99=E2=80=9D >=20 http://zsh.sourceforge.net/FAQ/zshfaq03.html#l18