Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: variable expanding to `*` matches a literal `*` in case cond. construct
- X-seq: zsh-users 24551
- From: dana <dana@xxxxxxx>
- To: Oğuz <oguzismailuysal@xxxxxxxxx>
- Subject: Re: variable expanding to `*` matches a literal `*` in case cond. construct
- Date: Sun, 15 Dec 2019 18:03:40 -0600
- Cc: andreas.kahari@xxxxxx, Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH7i3LqVR3NqLLQng3QE=X8bPGztTmziOcwUf_9CCOqUiGQcyg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAH7i3Loe=j+cQXOCMKyy0=efmRxkzaONqaiCYpn9oA--_cYg3Q@mail.gmail.com> <20191215100507.GA23773@pooh.my.domain> <CAH7i3LqnGxBsbt3thw+M25RvwE0Z2uXdRnEKffDSpDoAL6zbwQ@mail.gmail.com> <20191215120231.GA18473@pooh.my.domain> <CAH7i3LqVR3NqLLQng3QE=X8bPGztTmziOcwUf_9CCOqUiGQcyg@mail.gmail.com>
On 15 Dec 2019, at 06:50, Oğuz <oguzismailuysal@xxxxxxxxx> 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@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author