delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/11/04/16:21:30

DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4A4LLUj41523078
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=NKTwrEP3
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7996F385783B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1730755288;
bh=ti4uwDVVqk39LFnZCASq4183WopzLtUXcE9KAWpN/dI=;
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=NKTwrEP3egUNbVt51FAMnCnlvePuUjQxsnago37iy+6pXBD31D7G0mUDmWIzBRTTX
Gnxp5LS7pOGbe0+iGWckY8B2vzWZpxq8SH3I8MwWE3bPeflxOa5x4GAZQsiCUFTgB1
a7WX1FR988rAkf3cHU7JeFcHI3uabk2VIeVdoTGA=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E2853858C5F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3E2853858C5F
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730755270; cv=none;
b=nC2Sbu6JVldbTtOu3QYeoQAgDO9Z2a7fAF17P4iuVRAVKuVb+QBAdk72a9Mbd1dbVuBo+QZr6OswvRfWJbImd/7D+S+Q3e9X5HE+oCc0LrFPfbRq8a7v0+PHxZG778H8u47FXrXPsy/F1ageiwmOOetCaI449h8KqM4J2yPW02k=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1730755270; c=relaxed/simple;
bh=buROqZymtfOjCsPUi9+emBlGf6n0jytKEPLjuWcle9U=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=pK79urhqQorNi+iaJNL0MDdTn6MKlbSFhkB3fBD5lSdM69LdESlIK7sNKvZ3oggrQy+YP+sbikJD++hZxxTvINXKh2G/ITAUKnvnes3Wame9q9vq06ID25AoVqub+J+KHCWIJ3bihR542RH8j7seGwiCHDTk3qEOi6tZDERlPgo=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1730755267; x=1731360067;
h=content-transfer-encoding:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=buROqZymtfOjCsPUi9+emBlGf6n0jytKEPLjuWcle9U=;
b=dH2c1HXvGyGHM5/WdLaNU3tT+8NdaEMfAW+WDMhFLW1qxqDs+pEAO/QdVLvAChETOv
WrfAIKLtvSltncetLICckv4k5UA2ZjzfRxhtz9RDoiIrR9Sd0UacwCgM30Uqs0iLmAsh
O6dTbrqYUUUPOnod+MNaIKtEdHnuU6c7RgocTwkYMEm0z5JUkLBvzuDwprycrtBfcY8/
kit1CalGXfYALS0kQJlprBxeR4X1e95kJ/TVq9sroxpliwIA0YsU9Okx+rVeAN8L4zyu
RMQq3vXl6M/27ZkaI/FQfuH9LF9w61i17AJlCG528f1QKVxGOmeiw3SsDB19QxuW1R41
PkPg==
X-Gm-Message-State: AOJu0YyBSHGBrESV4VJjGj0g2bgfKPobylDSLsdq1RqAeIzBwa2G8nFV
K0T8uZ6d0ObyuV32yht3sR9Dui2iYvsDpxh/xHJ8Fd0UosW/LxkwgU/RDyHY/d4kAx5e1fRH1in
zD2OsDTpCxRlMRd5mVfT1Lcv5682UdiCCMjg=
X-Google-Smtp-Source: AGHT+IEKkur9o4bMg3scH3wGbzeYOTy1A6Tk4nUiQSmzHo+iPYklXXGshKadPAe4bqyPbr2NvGb7ZHN4W3urDQlB8JU=
X-Received: by 2002:a05:6402:5202:b0:5c9:5cff:3cc2 with SMTP id
4fb4d7f45d1cf-5cbbfa71a66mr23205249a12.29.1730755267212; Mon, 04 Nov 2024
13:21:07 -0800 (PST)
MIME-Version: 1.0
References: <CAKwdsS9FGm9nqtZ+vSQ+WEWzRf-zUFAS06eo=ASwNB6ST3gddw AT mail DOT gmail DOT com>
<6fdbf92d-51f2-47ae-a482-5edd89ed3a89 AT maxrnd DOT com>
<f58d4a6c-476d-4cc5-bad5-28c99ad75c2b AT maxrnd DOT com>
<7618ad16-fc5a-4c5c-bce2-25915c2f2cc8 AT maxrnd DOT com>
<CAKwdsS8McuC6Bw_va7DOzBr1wpOWNNU7hcrH8cjuaCuRF0mb4Q AT mail DOT gmail DOT com>
<87fro6vqk5 DOT fsf AT Gerda DOT invalid>
In-Reply-To: <87fro6vqk5.fsf@Gerda.invalid>
Date: Mon, 4 Nov 2024 13:20:55 -0800
Message-ID: <CAKwdsS8c583Ok+cuWjexdBStc6xmZ8ZpfVBDNxJAbcrcxgXWhQ@mail.gmail.com>
Subject: Re: Is this correct behaviour for 'rev'?
To: cygwin AT cygwin DOT com
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Backwoods BC via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Backwoods BC <completely DOT and DOT totally DOT trash AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 4A4LLUj41523078

On Mon, Nov 4, 2024 at 9:49 AM ASSI via Cygwin <cygwin AT cygwin DOT com> wrote:
>
> Backwoods BC via Cygwin writes:
> > cat fileOfFullPathNames | rev | sed -r -e "s/\./$mySep/" | rev | sort
> > -t "$mySep" --key=2.1 | tr "$mySep" '.'
>
> $ <fileOfFullPathNames sed -E 's/[.]([^.]+)$/\x00\1/' | sort -t '\0' -k2 | tr '\0' .

Thanks, Achim! That's simpler and avoids 'rev' and its quirks. \x00
will be a problem for ASCII in Unicode and need to avoid sorting on
directory names, so a slight change:
<fileOfFullPathNames sed -E 's/[.]([^./]+)$/\x01\1/' | sort -t '\001'
-k2 | tr '\001' .

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019