From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10597 invoked from network); 20 Jul 2022 19:33:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 Jul 2022 19:33:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658345617; b=duBu9YSl2Fb3MhwdxBThSWXh/p2MBPUEcfrLjQFdWZpSt2IVxpHx9+V1lq5rxAXW2eFG4bCwJr 3EhAE501kmiItdS/wp0U2Uh1ue8gvKMP2CMADBnAVJYnU4UTl1ei68Pff4mWBmBKJ98Bl3vgBm HPExeq9zGn3inkf4+e12r3LPflCdP440eOmgX4brWe01Qm4DszVMmIn2F/XBy/DCLT4dkBx0xI jkEql6SBV2pPDyvZGXOMrLyJFEUvL2LtV1i1e8NUyEjT+qJI0sLranMpoN6djAmcPYklb/wt/k CyUipFvH/N6AAIKOvGYlFzS9yOrTOkqzxN5osVlG1zPS5A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202202e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202202 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658345617; bh=0FKpFnTpEUcbN+HJJCuyb22mq26Y3KzrzmuGl0o72vc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=Y/j2IaO9x7lssB4Q9twWD30atu/ZKbKCCH89pWHdsSPdK/mCPIX/fKLVQacRRnY/2Y99GD65i7 uHUIZOGneRhtHN7062zjJqbP2BAFWRu3pYo+tk8QCRuBGPpk2Os1CfMC5YSq5oUd23uIn/ruF1 zvUllhjcBMirDOk57OCuT+Qh4yEsVt6iwjudjVU7NB9qKnSxr7+PX1Tqy3qM7JCNpnFIsS+NQz ia7t2uXfjzuPj4WIr+1SKmpJH4N1+yDh1++9ryM7LfOwLQVBiIQcQxIz+FcJsu2j7uHGr6XP+O 0iOmE4wcO28RWJRTnoS8ZzkdZMm+4c+p+f+RKPDcBkFdVw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8S3I2rbjAtV4QDI4AWu3jBJ/l9dQXr8HtNbbZ6A7wx4=; b=jQVLhgTNlP00s4AHMH+IowblOJ sdxSX8Z8yIo1ajqoStvotK+6IvUwcEPzhQ6ZknRw239YA7iue36Vjo8hRApWckOvCxTIgHbXPfHCL 8ayMNBCvO+T7qX6Wsg6t57/PDB6/7WzxkoJEm2nWCyrAOktrSaMambH/H61Mg+mW4sHnwzO9EIXqI D5W0t9lma5nKOZzsYK4HOg+a573+6+NOr4hQT11K3W3g/LM1HS9OjxsZuAJqm8cKTlkiuhQf4ta63 aajA2AVkZVgMok1WDfcXZwmuxOURzy+E/PL2R5lP+pWmnoUcvIcgmKh2MLqSVc4NC88xDsWyNQzLZ EBsEfTaA==; Received: from authenticated user by zero.zsh.org with local id 1oEFRw-000On2-U4; Wed, 20 Jul 2022 19:33:36 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202202e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202202 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none Received: from mx.spodhuis.org ([94.142.241.89]:46708) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oEFQr-000O0m-Nu; Wed, 20 Jul 2022 19:32:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202202; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:From:Reply-To:Subject:Date:To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP:Organization :Auto-Submitted; bh=8S3I2rbjAtV4QDI4AWu3jBJ/l9dQXr8HtNbbZ6A7wx4=; t=1658345549; x=1659555149; b=Te+FrwD1Uyr6AZeNWwVSKy4yX3RvAazq/9z2d4DNvSGv8Gp hw4StzcILQxlWuqnJReveFigd8akOvbCX0PW1/o7S4Xh2opz4xDynav/MD6RS+1CnEXLR7ggPQxGF nJnUwj33ddL70qTIh5C/VJphB0LipMlS+AIDdoDvqv/oNnWd1RL9aVKlnDAqNkltJZNVSeD3iYoe/ ZaJyn1V46hgNV8X5OUQl83vILQug3YYyssxbxv/tE3P6DQ+trklrH7WVCnHfFDTUPkTP9EdN44H43 UzpqBCTcbW3oHJEh6j4RWcfqXrlb8IDziDWi99+hv2MXTH5H9eu9XzV7iEmczCZg==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202202e2; h=OpenPGP:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:From:Reply-To:Subject:Date:To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:OpenPGP:Organization :Auto-Submitted; bh=8S3I2rbjAtV4QDI4AWu3jBJ/l9dQXr8HtNbbZ6A7wx4=; t=1658345549; x=1659555149; b=C4ooPP7BQjEdcxSk3KgPq4f0t8/0ZQ178LA/3HOIpAh2FMt yQ8Q2VmMJg4bG1MxAC+fz60cbHSvr+SJoFQW7CQ==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oEFQr-000O0h-AT; Wed, 20 Jul 2022 19:32:29 +0000 Date: Wed, 20 Jul 2022 15:32:27 -0400 From: Phil Pennock To: zsh-users@zsh.org Subject: Re: Is it possible to clear empty :-tied elements? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Seq: 27908 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2022-07-19 at 21:54 +0200, Sebastian Gniazdowski wrote: > export -UT CMAKE_PREFIX_PATH="$ZPFX:$CMAKE_PREFIX_PATH" cmake_prefix_path > > The problem is that the variable/array will contain empty element if the > variable is empty when export is run. > > I wonder if is it possible to somehow clear such empty entry (i.e.: to > remove :: from "a::b") without another line of code? Assign it as an array and do _not_ quote the $ZPFX, so that empty values are not preserved. export -UT CMAKE_PREFIX_PATH cmake_prefix_path=($ZPFX "${(s,:,)CMAKE_PREFIX_PATH}") If you have to be resilient to SH_WORD_SPLIT being enabled, then replace $ZPFX with ${==ZPFX} instead. -Phil