Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Apple bash to zsh script problems with error control and bash emulation
- X-seq: zsh-users 26171
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Dominik Reichardt <domiman@xxxxxxxxx>
- Subject: Re: Apple bash to zsh script problems with error control and bash emulation
- Date: Mon, 16 Nov 2020 18:01:29 +0000
- Archived-at: <https://zsh.org/users/26171>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2020-11/20201116180129.4f6a851f%40tarpaulin.shahaf.local2>
- 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
- Cc: zsh-users@xxxxxxx
- 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==
- In-reply-to: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-users>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-users.zsh.org>
- List-owner: <mailto:zsh-users-request@zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-users>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-users>
- References: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com>
- Sender: zsh-users-request@xxxxxxx
Dominik Reichardt wrote on Mon, 16 Nov 2020 16:00 +0100:
> I’ve recently moved to zsh as Apple is pressuring us :)
>
The easiest solution is to keep the script as «#!/usr/bin/env bash»:
https://github.com/zsh-users/zsh/blob/04bd9a44a74683ad0d83921bfb3aa0c4d5992c75/Etc/FAQ.yo#L2056-L2102
> Something goes wrong in the error(), pipestatus() and teelog() functions, I guess. But I can’t quite tell and I’ve 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 if the error happens in one of the functions but currently the script goes on and on. This used to work before in bash.
See «set -e». You probably have it set in your bash global setup.
See also the ERR_RETURN option.
> If I get rid of the —emulate sh, my variables don’t 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=/opt/i386/lib’”
>
http://zsh.sourceforge.net/FAQ/zshfaq03.html#l18
Messages sorted by:
Reverse Date,
Date,
Thread,
Author