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

Re: Defect in XCU sort

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Defect in XCU sort
From: Gunnar Ritter <yyyyyyyyyyyyy@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 31 Jul 2004 14:36:25 +0200
Organization: Privat.
References: <200407310003.BAA23022@xoneweb.opengroup.org>
yyyyyy@xxxxxxxxxxx wrote:

>       Defect report from : Paul Eggert , UCLA
> [...]
> @ page 871 line 33829 section sort editorial {20040730a}
> [...]
> 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).
> [...]
> It sounds like the standard is not clear enough here, perhaps because
> of the indirect reference to the Guidelines.

This issue does not just affect the 'sort' utility. At least the
following other utilities are concerned when reading files:

Utility      |  Heirloom    GNU         AIX         Solaris     HP-UX
----------------------------------------------------------------------
bc -         |  name        name        name        name        name
cksum -      |  name        stdin       name        stdin       stdin
expand -     |  name        stdin       name        name        name
file -       |  name        n/a         name        name        name
fold -       |  name        stdin       name        name        stdin
grep foo -   |  stdin       stdin       name        name        name
head -       |  stdin       stdin       name        name        name
nl -         |  name        stdin       name        name        stdin
od -         |  stdin       stdin       stdin       stdin       name
sed p -      |  name        stdin       name        name        name
wc -         |  name        stdin       name        name        name

(Versions used in these tests: Heirloom Toolchest 040727 POSIX.2-style
utilities; GNU coreutils 5.2.1, GNU bc 1.06, GNU grep 2.5.1, GNU sed
4.0.8; AIX 5.1; Solaris 8 /usr/xpg4/bin; HP-UX 11.11 with UNIX95 in
the environment.)

In general, systems other than GNU have a strong tendency to interpret
'-' as a file name instead of standard input, unless POSIX explicitly
states the opposite in the description for an individual utility.

> Append the following text after page 871 line 33829:
>
>   If "output" is "-", sort shall write to standard output.

Perhaps the issue should be solved for all affected utilities at once,
in whatever direction the solution goes.

        Gunnar

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