zsh-users
 help / color / mirror / code / Atom feed
From: Lewis Butler <lbutler@covisp.net>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Apple bash to zsh script problems with error control and bash emulation
Date: Thu, 19 Nov 2020 06:31:18 -0700	[thread overview]
Message-ID: <B5010C0B-E3DB-4EF5-9FBA-F5D661690AD6@covisp.net> (raw)
In-Reply-To: <26ED4B54-363A-4A03-993D-AB447E062E2A@reichardt.de>

On 17 Nov 2020, at 09:13, Dominik Reichardt <dominik@reichardt.de> wrote:
> On 17. Nov 2020, at 16:54, Lewis Butler <lbutler@covisp.net> wrote:
>> 
>> There is no reason to change a working script from bash to zsh just because the interactive shell you use has changed.
>> 
>> 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).
> 
> 
> Let me rephrase it:
> I switched my interactive shell to zsh on all my machines. 
> 
> My script did no longer work correctly even though the script invoked bash (Apple’s 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

-- 
ɹןʇnqן
<mailto:lbutler@covisp.net>
tel:+1.303.219.0564





  parent reply	other threads:[~2020-11-19 13:32 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
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 [this message]
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=B5010C0B-E3DB-4EF5-9FBA-F5D661690AD6@covisp.net \
    --to=lbutler@covisp.net \
    --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).