Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strange bug with or without quotes
- X-seq: zsh-users 30487
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Klaus Ethgen <Klaus@xxxxxxxxx>
- Cc: zsh-users@xxxxxxx
- Subject: Re: Strange bug with or without quotes
- Date: Sun, 5 Apr 2026 13:36:29 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=pxCQJhDdkIbL7s+DFNhUMswtLOkjki19Yl4WVVo7ePo=; fh=Dl0lPL1leeFmc3/O8eiM1hKJ4CeMRQAJjFeI5DzeMLM=; b=Efmrcc/kXX58C6RF5VufEngiXNParNJ15laf/1dJqqfkIkKMWPvrcbxqYILOFdKBOj Vk+SVpPfGXtAj953XIgNlj8EqCpuUiywM871DyywtNjC50bhiDEfeMjVT61aBZc5yHla TliqqJb5OWkN1xXfHkIqqfyG5/Ib9JIqvTrLvrYZsCcJOAs/572c7KBdf3PJsfQtmc2I yMfgErN5ym372nEPcOqfeOypWSES4BEJrJlCd/2eQ3FDp4/3bmL6+WniIS4q4CTS7Sms 2pUwVuOz8Wa9eXIB+pKfBOlMKLvAo/zPHVnPjCIvuhV/OomTaE755/zwzU4RYkikGhYl X5iA==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1775389003; cv=none; d=google.com; s=arc-20240605; b=aQCu6CZT2ydb673sipxddt+VLXn/wIKz38B3cNAkU0lE9EAXb/eYcu6sESNpRNcFUe 0d/LBDks9Mb0kjcEWdFrnQwKmoHGFryo3gWReWI8oryFjF1PPX2Kkk+Oib7MfSoWNsDm rjSw1LcpyGaeL/5BRucQKCAEtB2JKc/8X3wxHdShhcFonwx9UwWiv/0mRjHOnLddYuO0 C/KGzJYf/YmQcxd/0qDBAMgO6ER6u4ghUlGOAnkvWudNBDBBNZfYHUr1YfyELeBHUx7E wJhJz3y8k5N7A88C892TLe3RBPCyGrtMWNxDbzkMMDL2nqM7OR0c3hGTfmEpc4i087hX nSrg==
- Archived-at: <https://zsh.org/users/30487>
- In-reply-to: <adJE07PBAWEv0OhM@ikki.ket>
- List-id: <zsh-users.zsh.org>
- References: <adJE07PBAWEv0OhM@ikki.ket>
On Sun, Apr 5, 2026 at 1:18 PM Klaus Ethgen <Klaus@xxxxxxxxx> wrote:
>
> Hi,
>
> actually I stumbled across the following bug:
>
> Assume:
> local -a pcomps=('bzip2' 'lzip')
>
> Now try to keep matching parts:
> echo "${(M)pcomps:#bzip2}" # -> ""
> echo ${(M)pcomps:#bzip2} # -> "bzip2"
>
> For my understanding, there should be no differences between the quoted
> and the unquoted version.
>
> As I had exactly that in some checks, they was always false:
> if [[ -z "${(M)pcomps:#$i}" ]]
>
> By the way, I use zsh 5.9.
>
> Any thoughts about that?
an array in double quoted context will be joined by spaces, the
following will do what you want:
% echo "${(M@)pcomps:#bzip2}"
bzip2
Messages sorted by:
Reverse Date,
Date,
Thread,
Author