From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 7120 invoked from network); 10 Mar 2020 17:45:31 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from unknown (HELO minnie.tuhs.org) (45.79.103.53) by inbox.vuxu.org with ESMTP; 10 Mar 2020 17:45:31 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id EA7DB9BB83; Wed, 11 Mar 2020 03:45:28 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id E8EEC9BB47; Wed, 11 Mar 2020 03:44:55 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id A39A19BB47; Wed, 11 Mar 2020 03:44:54 +1000 (AEST) Received: from mail.bitblocks.com (ns1.bitblocks.com [173.228.5.8]) by minnie.tuhs.org (Postfix) with ESMTP id 61ECA9BB46 for ; Wed, 11 Mar 2020 03:44:54 +1000 (AEST) Received: from bitblocks.com (localhost [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 00B20156E45D; Tue, 10 Mar 2020 10:44:32 -0700 (PDT) To: Dan Cross In-reply-to: Your message of "Tue, 10 Mar 2020 13:38:23 -0400." References: <202003101615.02AGFLgS075920@coolidge.cs.dartmouth.edu> Comments: In-reply-to Dan Cross message dated "Tue, 10 Mar 2020 13:38:23 -0400." From: Bakul Shah MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <80192.1583862272.1@bitblocks.com> Date: Tue, 10 Mar 2020 10:44:32 -0700 Message-Id: <20200310174440.00B20156E45D@mail.bitblocks.com> Subject: Re: [TUHS] Command line options and complexity X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society , Doug McIlroy Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Tue, 10 Mar 2020 13:38:23 -0400 Dan Cross wrote: > > This begs questions of stability: in the event of non-unique keys and > non-key fields in the sortable data, which "records" (lines) are kept and > which are discarded? Surely the "first" is kept and subsequent entries with > the same key suppressed, but I confess I don't know enough about the > internals of sed to know even what algorithm it uses (I assume a disk-based > merge sort?), but I would imagine these details have changed over time. FreeBSD manpage for sort says that -u implies a stable sort, similar to -s.