Email List: Xaustin-review-lX
[All Lists]

Defect in XCU sort

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU sort
From: yyyyyy@xxxxxxxxxxx
Date: Sat, 31 Jul 2004 01:03:40 +0100 (BST)
        Defect report from : Paul Eggert , UCLA

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 871 line 33829 section sort editorial {20040730a}

Problem:

Edition of Specification (Year): 2004

Defect code :  3. Clarification required

Does the command "sort -o -" create a file named "-", or does
it write to standard output?

The specification for "sort" says that it conforms to the Utility
Syntax Guidelines, and Guideline 13 says

    For utilities that use operands to represent files to be opened
    for either reading or writing, the '-' operand should be used only
    to mean standard input (or standard output when it is clear from
    context that an output file is being specified).

Here, "-" is an operand, so apparently "sort -o -" should write to
standard output.  This is what GNU coreutils 5.2.1 "sort" does.

However, I just checked Solaris 9 "sort" (both /usr/bin/sort and
/usr/xpg4/bin/sort) and OpenBSD 3.4 "sort", and they both create an
output file "-".  It sounds like the standard is not clear enough
here, perhaps because of the indirect reference to the Guidelines.


Action:

Append the following text after page 871 line 33829:

  If "output" is "-", sort shall write to standard output.

<Prev in Thread] Current Thread [Next in Thread>