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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2532 invoked from network); 16 Nov 2020 19:46:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2020 19:46:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605555980; b=S6mzzEzeyhN88FNnfnr3gnaWvvNYYtfYqnbeaS1GyuahDRHr9h0wQblyIq2DbHdM0Iz3oBe/lr XdER1jZ7ZSMFAg/Kl82z/Z/L2XVUhHFrMvkuYuTQHIUtYGJyMZge1r7aEngqI2gbCo7GdOoTXG joV4eDJu5uwnd6DKgSGiiK94o5ye5yTm3r7suqV9B3sV0bDXbZu7GOVdSq3bLmUoK/VtdwZaIw gMmO88Qg5QOpxzndKkXqSfyqXPuu5/pixdjwZq4+THt5oXyagXSrFJQb3Gmw24AESh52sK1GqN N3K7L3z8KOOfVCSTo8RjjwOkMr/YhQZ6qIGVUDtdYz4kCQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f50.google.com) smtp.remote-ip=209.85.221.50; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605555980; bh=ejWAWcGALAQMb5wxNarPjXRVOYVWoQppSINW+TRI0cY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature: DKIM-Signature; b=SrYUIvh6N9FNpKMZj1dB5/NwONeEvLfsSGcRvXZla1FM7XDViD4BAFxOiU6etME9NG2ZSi0RtA LkSqmMXDihDOCj0aju3lJ5p3+3GXyXXwnPiczajhTv/l2wm8zslOlGimx/r/mLfKXpU2OScewf DLxwQxvcNxavlPCeFjj9ilMMhTKWYnqzE8k/2kkWO+CkBisXZX0c0TesEPo5UJ7h6Mj6Db1PD1 iLeN87coUqqLL1BCRCPhov5jiH3+eyxSN/QngOxuu4xAnDW5FCimMNtgH54hC4N0lA1qiNSqkl H8F1YhCxAD73lhepxakD4VFudWkjEiGQEjLf37oyQntG2Q==; 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:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MhErchVxV/EiVrYc1HSQviohHbv+Br0Sk1pTrDWINPQ=; b=WB2qguse5tv9mRFO1wyp88aXnA xQN1eIis+VyG/00GD1LSesKIAuo8qp3OIRVFDOF2qLx6Cz+hw0UEyK5pnvVLUIyoBBlr+Snw6nKC/ YUPdKs3actXNQ7ODOIcIsFd3tZH272x9G6t2y0NGPmI+Zs0b7e4Q6bSkFeo6KOwc9CuHRO4EmL8Y6 qZY1DFagmM1T13iUE8J+o/SHD4QOPBzFkbgzN0pFTw1ZY09hOD9x4XTKvjwHuigQPqwqJR5nraWr0 zKoGAg14EpFXz+mjqUtyvFG51ge92UAPRuKb7declG07wlXI5r4W4iaRVVbIXOhXFFhm1EEgooMb/ OYMGIGcw==; Received: from authenticated user by zero.zsh.org with local id 1kekSB-000EZq-G1; Mon, 16 Nov 2020 19:46:19 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f50.google.com) smtp.remote-ip=209.85.221.50; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f50.google.com ([209.85.221.50]:34587) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kekRp-000EDd-Ie; Mon, 16 Nov 2020 19:45:58 +0000 Received: by mail-wr1-f50.google.com with SMTP id r17so20122419wrw.1 for ; Mon, 16 Nov 2020 11:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=MhErchVxV/EiVrYc1HSQviohHbv+Br0Sk1pTrDWINPQ=; b=HLe+GoV8hdySfdB97Rcv7Si6fhxB4t2GQFXo0UtPdnl1m5QIA5vOOzrMTs0GBvAT2J Z0AhcIk9c0JAidznvuMNGZ/IkhItYCrqIx9by+vrKpBth8QFEdTooi3lV2v9DgppexvD nPVjc7qjFtT+PGB1fjZH19MFtPCTYA6taqJKc2NU5lV649+aOprH7LKYn2tgi2Ksolj5 XYxC982wkKHmPtN8XX15ER7L69ae3iwlUYdCN5c/yDbD/hd5mVTLAI3ShQXhxxYHjebu LNvfTiZW0VxELosrtYc5T/zAmRa6G+VFwW2mvbgN5eGkpw7BCDOoVEA4yb5VamAo6K7s h1MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=MhErchVxV/EiVrYc1HSQviohHbv+Br0Sk1pTrDWINPQ=; b=t3p9YUvVYWk/n7SziHQmGSl1/NRpul9uQ/sih+3H+lt9t89FQFGOEYcNXKTstCOtFi UBfFxQBVaXSy9/qnK8vGMEx4MAbnjApAE8GEnKh5NMFej9E1JoUOAOjnno+MOeG6sHnK KnP0iz4V0i0q/opc7G2Dr+XtrfQoCVc6mZv2FVTH3ODovcBVanR6ozcU8q5dYsbBGzCG +GcS7nleVBNYBPPQojG9ArJfw16Eqa04fp+7BhJ6tdlBAMX8M/kRddjHcldr15vJmJKc JeElH0s37CTJ+hG4H4SaJmSbPmyT58WNXYOVGZfwMtndOH1uQI7Cblo4FLsy+gjxFfA8 TIyg== X-Gm-Message-State: AOAM530tzgQHdZiftOO5Z2VwQQShkWv+MYxT2EWhX57Y4tXoCslaM/Fn HP7fyQQK4Jhk/Wx2wE22D6Zpb2iH+D8= X-Google-Smtp-Source: ABdhPJyvZHiIaMXzcdeZccNzq2lxmNM5UbXn4AXjm1UkbRl33BbmH7kzQsMC+vsPNRXX4kNcD0jgIg== X-Received: by 2002:adf:dc4b:: with SMTP id m11mr20342619wrj.328.1605555956774; Mon, 16 Nov 2020 11:45:56 -0800 (PST) Received: from imac.fritz.box (port-92-196-84-68.dynamic.as20676.net. [92.196.84.68]) by smtp.gmail.com with ESMTPSA id z22sm436168wml.9.2020.11.16.11.45.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 11:45:55 -0800 (PST) From: Dominik Reichardt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: Apple bash to zsh script problems with error control and bash emulation Date: Mon, 16 Nov 2020 20:45:53 +0100 References: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com> <20201116180129.4f6a851f@tarpaulin.shahaf.local2> To: zsh-users@zsh.org In-Reply-To: <20201116180129.4f6a851f@tarpaulin.shahaf.local2> Message-Id: <4254F6E5-249B-4DFF-8D4D-6D253D15AFB2@gmail.com> X-Mailer: Apple Mail (2.3654.20.0.2.21) X-Seq: 26173 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 16. Nov 2020, at 19:01, Daniel Shahaf = wrote: >=20 > 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 >=20 > The easiest solution is to keep the script as =C2=AB#!/usr/bin/env = bash=C2=BB: >=20 > = https://github.com/zsh-users/zsh/blob/04bd9a44a74683ad0d83921bfb3aa0c4d599= 2c75/Etc/FAQ.yo#L2056-L2102 oddly enough, this doesn=E2=80=99t seem to work as expected with my old = script on both macOS 10.15 and 11.0. Several things I declare in the = function.sh seems as if they don=E2=80=99t exist. For example that "alias autogen=3D'./autogen.sh > /dev/null 2>&1=E2=80=99=E2= =80=9D, when I run the script it returns "./exultsnapshot.sh: line 45: = autogen: command not found=E2=80=9D. Something changed... >=20 >> 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. >=20 > Well, for starters, $PIPESTATUS doesn't expand to what you think it > does. I fixed this behaviour when I turned off bash emulation and used the = lower case pipestatus[@] in my function. Seems that didn=E2=80=99t work = correctly either way in the bash emulation and thus disturbed my error() = function. Now it works again and prints me the error of which command in = my build() function failed and then exits the script. >=20 >> What I expect is that when the script runs into an error it stops, = even if the error happens in one of the functions but currently the = script goes on and on. This used to work before in bash. >=20 > See =C2=ABset -e=C2=BB. You probably have it set in your bash global = setup. >=20 > See also the ERR_RETURN option. >=20 >> If I get rid of the =E2=80=94emulate sh, my variables don=E2=80=99t = get passed on correctly (the error I get in the shorted version of my = script is "configure: error: unrecognized option: `-q --disable-data = --with-macosx-static-lib-path=3D/opt/i386/lib=E2=80=99=E2=80=9D >>=20 >=20 > http://zsh.sourceforge.net/FAQ/zshfaq03.html#l18 Thanks, I have to confess I understood only parts of it, but seems that = using $CONF_OPT $CONF_ARGS as ${=3DCONF_OPT} ${=3DCONF_ARGS} fixed my = woes. So now the script runs as expected again without bash emulation! Wheee!