zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Dominik Reichardt <domiman@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: Apple bash to zsh script problems with error control and bash emulation
Date: Mon, 16 Nov 2020 18:01:29 +0000	[thread overview]
Message-ID: <20201116180129.4f6a851f@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <1EFC2452-32D1-411C-B239-0031131FA197@gmail.com>

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


  reply	other threads:[~2020-11-16 18:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 15:00 Dominik Reichardt
2020-11-16 18:01 ` Daniel Shahaf [this message]
2020-11-16 18:10   ` Roman Perepelitsa
2020-11-16 19:45   ` Dominik Reichardt
2020-11-16 20:11     ` Roman Perepelitsa
2020-11-16 23:15       ` Lewis Butler
2020-11-17  7:08         ` Roman Perepelitsa
2020-11-17 13:03       ` Dominik Reichardt
2020-11-17 15:54         ` Lewis Butler
2020-11-17 16:13           ` Dominik Reichardt
2020-11-17 21:29             ` Roman Perepelitsa
2020-11-17 21:47               ` Bart Schaefer
2020-11-17 22:25                 ` Dominik Reichardt
2020-11-18 10:01                 ` Roman Perepelitsa
2020-11-19 13:31             ` Lewis Butler
2020-11-19 13:55               ` Dominik Reichardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116180129.4f6a851f@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=domiman@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).