>Return-Path: <yyyyyyyyyyyyyyyyyyyyyyy@xxxxxxxxxxxxx>
Paul,
I disagree with your analysis. In your example:
sort -o -
the final "-" is an option argument; not an operand. The description
of the -o option says that the output option argument is the name of
an output file to be used instead of standard output. There is nothing
here (nor in the Utility Syntax Guidelines) to indicate that if the name
of an output file option argument is "-" that it should be treated as a
synonym for the process' standard output. There is no reference to the
guidelines (direct or indirect) because they do not apply in this case.
All of sort's operands (if any appear) name input files and the OPERANDS
section on sort clearly specifies that if a file operand is "-" it
refers to standard input; never to standard output.
Cheers,
Don
>Date: Sat, 31 Jul 2004 01:03:40 +0100 (BST)
>From: yyyyyy@xxxxxxxxxxx
>X-Mailing-List: austin-review-l:archive/latest/1814
>
> 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.
|