Zsh Mailing List Archive
Messages sorted by:
Re: variable expanding to `*` matches a literal `*` in case cond. construct
- X-seq: zsh-users 24549
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: variable expanding to `*` matches a literal `*` in case cond. construct
- Date: Mon, 16 Dec 2019 00:27:31 +0100
- In-reply-to: <CAH7i3LqVR3NqLLQng3QE=X8bPGztTmziOcwUf_9CCOqUiGQcyg@mail.gmail.com>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- List-unsubscribe: <mailto:email@example.com>
- Mail-followup-to: zsh-users@xxxxxxx
- 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>
- Reply-to: dominik.vogt@xxxxxx
On Sun, Dec 15, 2019 at 03:50:20PM +0300, O??uz wrote:
> On Sun, Dec 15, 2019 at 3:02 PM Andreas Kusalananda Kähäri <
> andreas.kahari@xxxxxx> 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. That's my concern, maybe I'm wrong,
> I don't know.
These features are why we "experienced users" prefer zsh. If it
worked exactly like the Posix shell, what would be the point in
> > Wanting to write scripts that "works with any shell" is IMHO a
> > misdirected efforti (why would you want to run code written for one
> > language with the interpreter for another?).
> I agree with that, but still, most shells out there are compatible with
> each other to some extent. I just expected zsh too to be so.
What you normally need are not scripts compatible with every
shell, but *portable* scripts that run on any system. Your best
bet ist to put
(or /bin/bash for bash based systems; Linux etc.)
at the beginning of the script and make it executable. The manual
of autoconf has a chapter about writing portable shell scripts.
I recommend to read it, it lists many differences between shells
and is really helpful if you ever write software that must compile
on many systems.
> > See the "emulate" built-in utility in the zshbuiltins(1) manual.
> 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.
What is actually the point in feeding scripts that have been
written for one shell to another? Posix shells have (by
specification) some bugs that make scripting harder than
necessary. Zsh replaces these bugs with sensible behaviour that
makes writing complex scripts for zsh much easier than for the
Posix shell, bash and others.
Some of zsh's strength are:
+ Powerful interactive mode
+ Advanced scripting
but if you're looking for something that works everywhere, /bin/sh
or /bin/bash is the better choice.
Dominik ^_^ ^_^
Messages sorted by: