Bug 261495 - sort --debug should print the information to stderr instead stdout
Summary: sort --debug should print the information to stderr instead stdout
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-26 17:22 UTC by Wolfram Schneider
Modified: 2022-01-29 18:02 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schneider freebsd_committer freebsd_triage 2022-01-26 17:22:58 UTC
sort --debug should print the information to stderr instead stdout

BSD sort has a flag to display extract information (memory usage, collate, sort method).

     --debug
             Print some extra information about the sorting process to the
             standard output.

e.g.:

$ cat /dev/null  | sort --debug
Memory to be used for sorting: 34288343040
Using collate rules of C.UTF-8 locale
sort_method=heapsort

I do not like that the debug information is printed to the same file descriptor (stdout) as the normal output.

$ date  | sort | wc -l
       1

$ date  | sort --debug | wc -l
       4

Proposed fix: print the debug information to stderr, similar to GNU sort.