From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 80A8E20DD9 for ; Sun, 5 May 2024 15:53:35 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1714917215; b=HubZ/HEmUr6QLYgLdUMW06PhuH90fMMAkyTH6kZ16bqCkZi+gl7Bxm/2K0QQkhqrUMl/bO+lBY Vxr6zU4/a+rk36nnLAhGizD7pqP9u7uC6YDZe7JZoQSKxu1GYRDau0aAM6cdyVrUO71dSBLTrC 2sTXRjsaeLqbwXy1c3TXkbtY4mE3I+fSsNih86R73XFeKebd1cxzE9g6BSe0d16f+l89Wa2Lr/ cRNCbxB7q97OVu1boXrgfN00Skf3QXrzoVHohB98wqtRQ00xQXztNxj2hacbD11IHe87Lv6YDp QngDxc0+0N3KrHDJOAWFxfviniRbXe948plLQKrE8q5z+A==; 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=1714917215; bh=+s+NuRBrsrJd6Mx7u7r3JIWlXuUleDxkY1ZHVnIeido=; 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=JTKaxoNQyVpa4Aje6ljiClYbTZV6zdxmN4T4NuuTMbd7EIxDWt5Bxb33EzSeJFZj/Uq/i1nODd bB525h0xK25dNiO0ggAK0UwA7ZuVF7GHsxGE57sQ3m20tGxeRSRcPWjDIlsioSbfb0sB9MKyyd cR/mjPHRBg65TqUXKYVhd/2Bk9qx//owVvdf9NJwCaWxRDvPc/BAITQ9vVKggrYoaRQfWQhxUW OgzwFpbQ2ZSoMh7UJIhlBZRQggORP+aV9aqReoNzr7ya6yT4y9g1EXWbSfkNxEw8nK41dXAGpT WJ6ATUNVd99qyf0eyhqxp72QiG4rWIV2eu7DAYCxOU/fcw==; 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=kLaWff1h52vUmICdlN02DQBTsaL8fKD3qWHpu3qo9qo=; b=XNKBHOYGGwXui0w6qikkcZPRiQ yPLyuI7Ew0b6DQJBFnewEAwa6iOpYxA+NJFYqX2JnlxRllybEVmZv5SY0qCOfO7nDz58Zuap2wRph bSuPMZDHv8XUdVT2UXff7722S7UoLVGv01lXg3PWAfXiuQX9iwQMWzqpbMZdBWxwKxnQdzzd6jEIr iqnWc86cWPaGI3Q8VNVmhoJWJxmSS3JEjO8aw6XUddCdejZw3zneV8iV/eCLbUCUYZhWZulpDUaLA zSg2BnzgvIvt/AJRbyyEhLwaQ1BIuG5JvO1ZLrroyktJgS/wH7XPSwJh6r0sfEi2vvEGUMF9xi/YQ 5Rbj4few==; Received: by zero.zsh.org with local id 1s3cJ4-000J4T-1D; Sun, 05 May 2024 13:53:34 +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]:56633) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s3cIX-000INa-Hu; Sun, 05 May 2024 13:53:02 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca ([24.224.136.13]) with ESMTPS id <0SD00Q7QQMFUDW90@mta02.eastlink.ca> for zsh-users@zsh.org; Sun, 05 May 2024 10:53:00 -0300 (ADT) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id 3cIVsmksN98ni3cIWsoX4W (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 05 May 2024 10:53:00 -0300 X-Authority-Analysis: v=2.4 cv=C75KyhP+ c=1 sm=1 tr=0 ts=66378f3c a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=lf3lF-AXr8_v9EnkRPgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=5j_4k_6F8xwuv4HGc-sA:9 a=eCu1rIA6gWf6FNJO:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvgedgjedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------kx9kzk1ckyQHSI10LGpCNP7t" Message-id: Date: Sun, 5 May 2024 06:52:59 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: nesting issue To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29894 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. --------------kx9kzk1ckyQHSI10LGpCNP7t Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-05-04 22:40, Roman Perepelitsa wrote: > local sorted=( $1,*(nN) ) Beautiful.  I get a 'version sort' in one go which is just what I want.  Subsequent to my code snip I run the thing through ' | sort -V ' to get the version sort, but  little 'n' is smart enough to handle that in one line.  Dunno, it always seemed to me that 'numeric sort' is intuitively what the sort command calls 'version sort'. This is what I dare say everybody wants: 8 /aWorking/Zsh/Source/Wk/Boneyard 1 % local in=(aaa,*(nN)); print -l $in aaa,1 aaa,2 aaa,2,howdy aaa,3a,pard aaa,3,pard aaa,4,2a howdy aaa,5c,pard aaa,5,pard aaa,6 aaa,6a,howdy aaa,7,aaa,7 aaa,8 aaa,9 aaa,9a aaa,10 aaa,11 aaa,11,pard aaa,12,12a aaa,12,some_somme ( One quibble, I see (cut down): aaa,3a,pard aaa,3,pard aaa,6 aaa,6a,howdy ... I'd expect aaa,3,pard aaa,3a,pard ... however ' sort -V' does exactly the same as 'n' so I'm not whining. ) ... and this is not: 8 /aWorking/Zsh/Source/Wk/Boneyard 1 % local in=(aaa,*(nN)); print -l $in | sort -n aaa,1 aaa,10 aaa,11 aaa,11,pard aaa,12,12a aaa,12,some_somme aaa,2 aaa,2,howdy aaa,3a,pard aaa,3,pard aaa,4,2a howdy aaa,5c,pard aaa,5,pard aaa,6 aaa,6a,howdy aaa,7,aaa,7 aaa,8 aaa,9 aaa,9a (sorry about the garbage filenames, they're stress testers.) --------------kx9kzk1ckyQHSI10LGpCNP7t Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-05-04 22:40, Roman Perepelitsa wrote:
local sorted=( $1,*(nN) )

Beautiful.  I get a 'version sort' in one go which is just what I want.  Subsequent to my code snip I run the thing through ' | sort -V ' to get the version sort, but  little 'n' is smart enough to handle that in one line.  Dunno, it always seemed to me that 'numeric sort' is intuitively what the sort command calls 'version sort'. 

This is what I dare say everybody wants:

8 /aWorking/Zsh/Source/Wk/Boneyard 1 % local in=(aaa,*(nN)); print -l $in
aaa,1
aaa,2
aaa,2,howdy
aaa,3a,pard
aaa,3,pard
aaa,4,2a howdy
aaa,5c,pard
aaa,5,pard
aaa,6
aaa,6a,howdy
aaa,7,aaa,7
aaa,8
aaa,9
aaa,9a
aaa,10
aaa,11
aaa,11,pard
aaa,12,12a
aaa,12,some_somme

(
One quibble, I see (cut down):

aaa,3a,pard
aaa,3,pard
aaa,6
aaa,6a,howdy

... I'd expect

aaa,3,pard
aaa,3a,pard

... however ' sort -V' does exactly the same as 'n' so I'm not whining.
)

... and this is not:

8 /aWorking/Zsh/Source/Wk/Boneyard 1 % local in=(aaa,*(nN)); print -l $in | sort -n
aaa,1
aaa,10
aaa,11
aaa,11,pard
aaa,12,12a
aaa,12,some_somme
aaa,2
aaa,2,howdy
aaa,3a,pard
aaa,3,pard
aaa,4,2a howdy
aaa,5c,pard
aaa,5,pard
aaa,6
aaa,6a,howdy
aaa,7,aaa,7
aaa,8
aaa,9
aaa,9a

(sorry about the garbage filenames, they're stress testers.)


--------------kx9kzk1ckyQHSI10LGpCNP7t--