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.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6923 invoked from network); 13 Dec 2022 20:01:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Dec 2022 20:01:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670961680; b=bR7u8+F4qYlnyFbvmM8SadTvTWjGdMlfFc2sCAJ3F6A5sSbkpOYWBTwu0wGOnhmxL4aamZrfYi +yknAjVFrAijblMPiQSAxHuE05MgBVJmKsBppHd9JnzoD6S/WCEvOK4pp/J6tv1+Km9tNcR8/s Apm4C6hhE9rEk0F9wJGDPAXfWsMjAxBgZpUiZkAU7S72dtDHaiOYdUliA1uPij9Bjb0uqtOxvz vsGCoHOtzfo7Fg2A1f00ZV6tMcK35k7JMRfJWybMbDLkoQX3oDVq/x8zxpysiUAyzMWsRM8XfR xi/uFxPt6nmMxPX5Od55jw2/6sgQ033+aBuXwjb7udUZ6Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1670961680; bh=YNNcXGBaaR1VSsSR2Kks4RnnQxYln6FmKjUNcBDxIWo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=BZVs8MQSz5SfxQXxsw39SSAbFF6kjElAi6/uX+OONjAVShVn+rGG8OqSEAcqIe+9fRk4tZmpdV Ypreh5Nf4OsBMk/gU3QyJtq/e4SNqAzjT6IWDkuB4dh33nhtcBWRVgIHF0VOdGK3X1NJWPgwht he9XJybo2OazTmnNuWCDujaD/J4fz4+JtJqMjKbVA0PHAETjIe8ic9wZAvPv3EvC8dJp4+oDp0 wQWAMQoU+RvhA3f7dr7dq0xoz3i9S/InHz+BNSp5CN+XtxcqI1abiW2wjlJTKlAQDWCOQhJh8m gbpWwVONqCBxpFP308EFKSu7qO7KoTRmEmqJzRWLVacmDw==; 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:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=LEfoNnP2kA8k0vkUHtcU6ODH4e7N8Aa4n43ER61xsJw=; b=ePy0T79UXOAiSz2pHcKZUJ9rDZ GIMz2EqpB+MlMlx98a33R02jdYFr0uz+8ybYYvr6KxnKVPcq/PQZrRaOV07HX7RoDX7sMuEfaZsGP mtUV1vtPYPaNWxZmO1UZE+UVaHj/jtJKnnJCA0Rr8NaaB47M1ZipCpAikR9wa2draJFJcWG08Li5P AmfjMiu9M/BhWm/gC9wvlbBUpJsZvW/XTrzE3uALKS8LVsx9BVXxGi0UjoJuF+qEgiYf53IOd/Bs6 GFwAVW+dOQDDX1UxvlL9CUYpsF1va6Pqlnge8joCjkXwR8MCZVN6aiqvfSWnXMzuRVXP/tx3xEqP3 ZgCEfoJg==; Received: by zero.zsh.org with local id 1p5BSo-0001Ej-9d; Tue, 13 Dec 2022 20:01:18 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:38926) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p5BRr-0000WN-GX; Tue, 13 Dec 2022 20:00:19 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RMU00A88EAWG350@mta02.eastlink.ca> for zsh-users@zsh.org; Tue, 13 Dec 2022 16:00:18 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 5BRppXk8cEN8v5BRppiOUr; Tue, 13 Dec 2022 16:00:18 -0400 X-Authority-Analysis: v=2.4 cv=IPDESCjG c=1 sm=1 tr=0 ts=6398d9d2 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=X7s9WE_Oc4_S7UdMyhYA:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=siBtyRupDMgg_rTsrgMA:9 a=8hr8lh73GCbNNT8B:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedugdehkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepgfdtvdduheevuefhvedtgfeuteefvdfhtdehleethfeiudelueekjeejfffhhefgnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------qK61QXOZdC0UzamJz4n0wvFQ" Message-id: Date: Tue, 13 Dec 2022 12:00:16 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: associative array questions Content-language: en-US To: zsh-users@zsh.org References: <859880bf-6808-ddf5-3376-5eff895daef3@eastlink.ca> <7390c1ea-746d-43c8-7480-f860db4ccf03@eastlink.ca> From: Ray Andrews In-reply-to: X-Seq: 28531 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: This is a multi-part message in MIME format. --------------qK61QXOZdC0UzamJz4n0wvFQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2022-12-13 08:22, Roman Perepelitsa wrote: > eval 'list=( "${(@M)list:#(#i)*$SEARCHBUF*}" )'     # filter the array. > > This eval will expand things that you don't want expanded. Use `set -A > $list` instead. > > Roman. I think I'm missing something Roman,  can't make it work.  Tried a few variations: set -A $list=( "${(@M)list:#(#i)*$SEARCHBUF*}" ) set -A $list=( "${(@M)${(P)list}#(#i)*$SEARCHBUF*}" ) set -A $list=( "${(@M)${(P)1}#(#i)*$SEARCHBUF*}" ) BTW is it possible to redirect the error messages and especially 'set -x' output?  All this is with zcurses active so the messages are hidden or chopped up. --------------qK61QXOZdC0UzamJz4n0wvFQ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2022-12-13 08:22, Roman Perepelitsa wrote:
eval 'list=( "${(@M)list:#(#i)*$SEARCHBUF*}" )'     # filter the array.

This eval will expand things that you don't want expanded. Use `set -A $list` instead.

Roman.

I think I'm missing something Roman,  can't make it work.  Tried a few variations:

set -A $list=( "${(@M)list:#(#i)*$SEARCHBUF*}" )
set -A $list=( "${(@M)${(P)list}#(#i)*$SEARCHBUF*}" )
set -A $list=( "${(@M)${(P)1}#(#i)*$SEARCHBUF*}" )

BTW is it possible to redirect the error messages and especially 'set -x' output?  All this is with zcurses active so the messages are hidden or chopped up.


--------------qK61QXOZdC0UzamJz4n0wvFQ--