From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 39cab1f3 for ; Sun, 15 Dec 2019 23:28:24 +0000 (UTC) Received: (qmail 10393 invoked by alias); 15 Dec 2019 23:28:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24549 Received: (qmail 15312 invoked by uid 1010); 15 Dec 2019 23:28:18 -0000 X-Qmail-Scanner-Diagnostics: from mout.gmx.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(212.227.17.21):SA:0(-2.6/5.0):. Processed in 3.722193 secs); 15 Dec 2019 23:28:18 -0000 X-Envelope-From: dominik.vogt@gmx.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at gmx.net designates 212.227.17.21 as permitted sender) X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Mon, 16 Dec 2019 00:27:31 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: variable expanding to `*` matches a literal `*` in case cond. construct Message-ID: <20191215232731.m3fzzitvyfl4fkeu@gmx.de> Reply-To: dominik.vogt@gmx.de Mail-Followup-To: zsh-users@zsh.org References: <20191215100507.GA23773@pooh.my.domain> <20191215120231.GA18473@pooh.my.domain> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K1:zS6e8rgqBSMLExvLwo3FH1w5BlrPX+h4yFhQ7D+UVIsPkD/BTFz X86zSQLl5q6RT6t9ehC9dzrXEButnSU+BWAvJT2Baw3kc0LthY1RT3jhufDhaKNs+lHRqfG 8UF2zJfvXL/69fXQNhzkOMsj+Ygujuf6GPseY5i/CzrhZmbcHfs81oUlcAKfagmePh3hXHG RpOQP8VBgYwHKyNhpIvQw== X-UI-Out-Filterresults: notjunk:1;V03:K0:zsEyd3jrB2o=:n52Kj3Wa1Dtw60ScoWxsnM hs8nGp/w1NZAqjtPcGtP2uM8pHPpIdeTvAiquxHifb6LCdkhVzXInZQX5kv/PtHLesnuyusWI riv0ScpCWpaH+TGke9ZVF6Us0E+N0/YW7mLljncumItE7UdW7cPU9AoqE9BPF137m0FcKxbBR CWoPxM7QFblz5fzgwUHq+rfnHDnoq4oDf2aVrOM2ELaDjTBAqVVUHpeLaxw7xXzVtyFwKNg/4 QkW4PyNtJkbvotdnFRfEggEEf5RqpFhvTB3dhL+JKtw/35mENLadMVYgrUhrcASJzKyLk/N0x wJgfby/MXM1u8XvEYserDiYnGFunUvnNoiq/r6+LbQVRC03baetTz8UPUM89mtu7N4sXG9Urj mH7ur7g2hWoWTGMriNZSKIWbjbZTm/zYTconDdWQT/vAwcSnvTY/fWhnenl06VrPOgmrlBAQo ouOfshrJOu4CNALaUZC/SazDDMzSaIwDj3fj/CW/iTrkvRo67z2+PeDsa38AaZfTEvOmGlG75 DR+OuqsqG4IQhjQwShwq3bZbbViZBL+MRdm319I5VQP3ET8aSKemiYX1Or9kpBj7DICvoVqAZ NWBXsBGdsGg4qi7+bRtVj431zRvwF477MugQBeSIbEhKJpxkjoYs7P6chsCOS4D3D6dpIjD9y TFYVQprWZtTgmIPjAKBYh1dzKsC5hkyLvVdJBK/QO0kZnScvjtgLpRYr+zoZlDF4//MSWwrvz 9DrQFGVNFKK+eId15EKAB9B8/qJ7opjHnhDoIlxOBpJaYJ9xQwL39azOWC6BXrOkhfZlBj4gr zwT/zEH984Yni2lM4+5K7/yDTh9RtayFNszdL8vVtIEf/j35Qa+IjMDpEAlhYT7FtNmZ3GJd/ 1RkIVQaS8dhLastGr6ZnnH8U+gVvOI/ruWQ6cSwYQ+43JoMTQ0KmPchz0wlGf3akD4WnbKpsv DfO+0kMduRon4SoWDwVAhyVh9xSNE0jwpcxJsHdFAujHxE+IoE+x4acHMw4cnIaLvIK7kgbBs JbVi/dUkoZmELKoGvrcaTwUTUMO731YuRym+TVduH06z9zC5Z7Pe3AvpDm7yRe+YmjH5awJzZ DMuAkNV8r2VI/QqUW7dra8q5qvUfwQpK3SmccX8VCrpJQc/k756s043YkPI1VkNUr8UT7WsSt 3dnneczRF6RbtHIhk6iDgLNDZ/Rv5gGLHTF7XcTZIeQSKWRj2RAq5QEiVp6/CYQI3dweKab+o HdbXHgvDjVKtJ0sBSTw9+upUtsev2wuMyLEbw2Ps27FqUH2SrFJbiQ8WfxeU= 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=E4h=E4ri < > andreas.kahari@abc.se> 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 w= hen > it comes to command line; I think it's not unreasonable to expect them t= o > complain about how shell scripts/commands they find on the internet does= n't > work on their precious cheese graters. That's my concern, maybe I'm wron= g, > 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 using zsh? > > 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 #!/bin/sh (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. https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Por= table-Shell.html 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 `emula= te` > 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. Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt