zsh-users
 help / color / mirror / code / Atom feed
From: dana <dana@dana.is>
To: Oğuz <oguzismailuysal@gmail.com>
Cc: andreas.kahari@abc.se, Zsh Users <zsh-users@zsh.org>
Subject: Re: variable expanding to `*` matches a literal `*` in case cond. construct
Date: Sun, 15 Dec 2019 18:03:40 -0600	[thread overview]
Message-ID: <6C537986-6091-4EF2-AA85-EB3391DF5F27@dana.is> (raw)
In-Reply-To: <CAH7i3LqVR3NqLLQng3QE=X8bPGztTmziOcwUf_9CCOqUiGQcyg@mail.gmail.com>

On 15 Dec 2019, at 06:50, Oğuz <oguzismailuysal@gmail.com> wrote:
> Well-known by experienced users. Since MacOS switched to zsh, and MacOS's
> userbase mostly consists of people who have no idea what they're doing when
> it comes to command line; I think it's not unreasonable to expect them to
> complain about how shell scripts/commands they find on the internet doesn't
> work on their precious cheese graters.

Not to pile on, but, just to be clear, since a lot of people still seem
confused on this point, or at least they're imagining unlikely scenarios:

Apple have changed their default *log-in shell* to zsh. /bin/sh is still
/bin/bash (though it seems like they might switch to dash in the future?), and
both of those still work exactly the way they did before. You still need to go
out of your way to write scripts that run under zsh. Even if you use zsh to
run a shell script without an interpreter directive, it will run it with
/bin/sh.

It's true that commands you copy and paste into your shell from the Internet
may not work if they use certain bashisms or (probably ill-conceived) features
of POSIX sh, but

(a) in my experience it's very rare that you're asked to interactively enter
    commands that make use of features that differ between zsh and bash/sh
    (i certainly don't see case/esac used much on the command line),

(b) it was *always* the case that those commands might not work on any given
    machine — the person giving the command has no idea if whoever they're
    instructing is using tcsh or fish or anything else, they can't just assume
    that it's bash or even Bourne-like.

On 15 Dec 2019, at 06:50, Oğuz <oguzismailuysal@gmail.com> wrote:
> I guess this is a new feature. The latest version available on Ubuntu 18.04
> repo doesn't have such an option as `--emulate`, you need to call `emulate`
> from within the script; which is even worse.

I think this was added in zsh 5.5, which was released a little too late to
get added to Bionic. Eoan and Focal are currently up-to-date.

dana


  parent reply	other threads:[~2019-12-16  0:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-15  8:41 Oğuz
2019-12-15 10:05 ` Andreas Kusalananda Kähäri
2019-12-15 11:04   ` Oğuz
2019-12-15 12:02     ` Andreas Kusalananda Kähäri
2019-12-15 12:50       ` Oğuz
2019-12-15 22:49         ` Eric Cook
2019-12-15 23:27         ` Dominik Vogt
2019-12-16  0:02           ` Perry Smith
2019-12-16  0:03         ` dana [this message]
2019-12-16  0:23           ` Oğuz
2019-12-16  0:28             ` Mikael Magnusson
2019-12-16  5:25             ` Lewis Butler

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=6C537986-6091-4EF2-AA85-EB3391DF5F27@dana.is \
    --to=dana@dana.is \
    --cc=andreas.kahari@abc.se \
    --cc=oguzismailuysal@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).