Deutsch   English   Français   Italiano  
<v50c12$2dtrs$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.unix.shell
Subject: Re: Numerically sorted arguments (in shell)
Date: Thu, 20 Jun 2024 06:43:13 +0200
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v50c12$2dtrs$1@dont-email.me>
References: <v4grk8$2pp51$1@dont-email.me> <v4sena$1eqki$1@dont-email.me>
 <v4ujjt$1vjpg$1@dont-email.me> <v4ule0$200am$1@dont-email.me>
 <v4us5u$21bu3$1@dont-email.me> <v4vqib$21g0v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 20 Jun 2024 06:43:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="1a9a410acf435c06a905868c6b72f695";
	logging-data="2553724"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+P88fag8qvwv4GOgQ1Rw5h"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:OgRLLW24Yo90Ju+AlqXIQp1nYKA=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <v4vqib$21g0v$1@dont-email.me>
Bytes: 1842

On 20.06.2024 01:45, vallor wrote:
>> [...]
> 
> I finally remembered which tool has "versionsort(3)" -- it's ls:
> 
> $ ls -1
> test10.txt
> test1.txt
> test2.txt
> 
> $ ls -v -1
> test1.txt
> test2.txt
> test10.txt
> 
> Does that help?

Sure, thanks. - Just remember that it's a non-standard option. But
for my GNU environment it's certainly a usable part of the solution.
It seems to also handle multiple numeric components as desired (as
versions usually have)

$ ls | shuf | xargs ls -v
1    1.2   1.11  2.1  2.10  10.1  10.10  11.1
1.1  1.10  2	 2.2  2.11  10.2  10.11  11.2


Janis