NetBSD Problem Report #59647

From www@netbsd.org  Wed Sep 10 13:44:21 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3550E1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 10 Sep 2025 13:44:21 +0000 (UTC)
Message-Id: <20250910134419.D2F8C1A923D@mollari.NetBSD.org>
Date: Wed, 10 Sep 2025 13:44:19 +0000 (UTC)
From: uwe@stderr.spb.ru
Reply-To: uwe@stderr.spb.ru
To: gnats-bugs@NetBSD.org
Subject: document sort(1) peculiarities
X-Send-Pr-Version: www-1.0

>Number:         59647
>Category:       standards
>Synopsis:       document sort(1) peculiarities
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jkoshy
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 10 13:45:00 +0000 2025
>Last-Modified:  Sun Jan 18 19:20:01 +0000 2026
>Originator:     Valery Ushakov
>Release:        NetBSD 10.1
>Organization:
>Environment:
>Description:
Cf. bin/51726 or src/bin/sh/mkoptions.sh revision 1.8:

  date: 2024-04-17 02:30:19 +0300;  author: christos;  state: Exp;
  lines: +3 -3;  commitid: 2c7j1Tx6qooqqq6F;

  Be more explicit with sort fields to produce consistent results with
  gnu sort (Jan-Benedict Glaw)

Our sort behaves differently w.r.t. ordering options (-b, -d, ...),
that can be specified either "globbaly" or as part of "keydef" (what
our manual page calls kstart, kend).

I am still not sure from the description, if it's only -b that is
special in our sort, or all of the ordering options.  The man page
seems to imply the former, but a quick RTFS seems to imply the latter
at a (very) quick glance.

A manual page should be a reference for the proverbial desperate
sysadmin at 3am Saturday, not an exegetical exercise.

>How-To-Repeat:
"Explain like I'm five" src/bin/sh/mkoptions.sh revision 1.8:

  date: 2024-04-17 02:30:19 +0300;  author: christos;  state: Exp;
  lines: +3 -3;  commitid: 2c7j1Tx6qooqqq6F;

>Fix:
Write some prose for the sort(1) man page that explains how ordering
options are actually applied and how that behavour is different from
the posix/gnu treatment of those same options.  Including CAVEATS
section.

Not _directly_ related, but an EXAMPLES section that demonstrates
relevant material with specific cases and not abstract prose that
sounds like it's from a medieval Zenzizenzizenzic treatise badly
translated from Latin could be handy...

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: standards-manager->jkoshy
Responsible-Changed-By: jkoshy@NetBSD.org
Responsible-Changed-When: Thu, 11 Sep 2025 15:48:23 +0000
Responsible-Changed-Why:
Taking a look at this bug.


From: "Joseph Koshy" <jkoshy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59647 CVS commit: src/usr.bin/sort
Date: Fri, 16 Jan 2026 18:07:11 +0000

 Module Name:	src
 Committed By:	jkoshy
 Date:		Fri Jan 16 18:07:11 UTC 2026

 Modified Files:
 	src/usr.bin/sort: sort.1

 Log Message:
 sort.1 (style fix): avoid overly long input lines.

 PR standards/59647.


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.42 src/usr.bin/sort/sort.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Joseph Koshy" <jkoshy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59647 CVS commit: src/usr.bin/sort
Date: Sat, 17 Jan 2026 19:08:03 +0000

 Module Name:	src
 Committed By:	jkoshy
 Date:		Sat Jan 17 19:08:03 UTC 2026

 Modified Files:
 	src/usr.bin/sort: sort.1

 Log Message:
 sort.1: Add examples.

 Add whitespace between logically independent sentences
 in the BUGS section.

 PR standards/59647


 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 src/usr.bin/sort/sort.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Joseph Koshy" <jkoshy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59647 CVS commit: src/usr.bin/sort
Date: Sat, 17 Jan 2026 21:17:23 +0000

 Module Name:	src
 Committed By:	jkoshy
 Date:		Sat Jan 17 21:17:23 UTC 2026

 Modified Files:
 	src/usr.bin/sort: sort.1

 Log Message:
 sort.1: tweak formatting of the synopsis.

 - Use an ellipsis to signal that the -k option can be repeated.
 - Correct a misplaced display of [-t char].

 PR standards/59647


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 src/usr.bin/sort/sort.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Joseph Koshy" <jkoshy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59647 CVS commit: src/usr.bin/sort
Date: Sun, 18 Jan 2026 19:16:18 +0000

 Module Name:	src
 Committed By:	jkoshy
 Date:		Sun Jan 18 19:16:18 UTC 2026

 Modified Files:
 	src/usr.bin/sort: sort.1

 Log Message:
 Highlight sort(1)'s three distinct modes of operation.

 PR standards/59647


 To generate a diff of this commit:
 cvs rdiff -u -r1.47 -r1.48 src/usr.bin/sort/sort.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.