Nick Stoughton <yyyy@xxxxxxxxxx> writes:
> After line 7240, add
> "Where a utility described in the Shell and Utilities volume of IEEE Std
> 1003.1-2001 as conforming to these guidelines accepts the operand - to
> mean standard input or output, this usage shall be explained in the
> OPERANDS section."
I see a couple of problems with this suggestion.
* It's an incompatible change to the standard.
Currently, applications can run standard commands like "tail -"
and know that "-" means to read standard input.
With the proposed change, the behavior would be implementation-defined.
Many commonly-used utilities would be affected by such a change.
* It is written as a constraint on the POSIX spec, whereas it should
be formulated as a constraint on the utilities themselves.
I accept Dan Cragun's explanation that "sort -o -" should write to a file
named "-" rather than to standard output, because "-" is not an operand.
(And thanks for the explanation.)
But I'm not convinced by his reference to XRAT P75-76, L3070-3075.
Yes, the rationale says that "tail" need not accept "-". But the
rationale does say that if "tail" accepts "-", it must not be "used
for other purposes", i.e., purposes other than "to mean standard input
or output". Hence an implementation of "tail -" that accepts "-" and
behaves like "tail ./-" does not conform to Guideline 13, as it's
using "-" for an "other purpose". The same argument applies to
commands like "tee -" and "uniq foo -": if these utilities accept "-",
they must treat "-" to mean standard output, not "./-".
|