Skip to content

Comm complains about input sort order #12912

Description

@hhmitchell

uutils' comm complains about sort order while gnucomm does not for the same input. Relatedly, uutils' sort and gnusort produce the same sorting.

Here's a simple test case:

% gnusort --version
sort (GNU coreutils) 9.7
Packaged by Ubuntu (9.7-3ubuntu2)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.
% gnucomm --version
comm (GNU coreutils) 9.7
Packaged by Ubuntu (9.7-3ubuntu2)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.

% sort --version   
sort (uutils coreutils) 0.8.0
% comm --version   
comm (uutils coreutils) 0.8.0

% gnusort <(echo "pkg-suffix\npkg1")
pkg1
pkg-suffix
% sort <(echo "pkg-suffix\npkg1")   
pkg1
pkg-suffix

% gnucomm -23 <(echo "pkg-suffix\npkg1" | sort) <(cat /dev/null)
pkg1
pkg-suffix
% comm -23 <(echo "pkg-suffix\npkg1" | sort) <(cat /dev/null)
comm: file 1 is not in sorted order
pkg1
pkg-suffix
comm: input is not in sorted order

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions