Base WG Resolution Ref: bwg98-002
Topic: sort -c


This is an approved Base Working Group Resolution for XCU Issue 4/5 .

Last update: 08 May,2001


								98 #002

 _____________________________________________________________________________

	Topic:			sort -c
	Relevant Sections:	sort
	Spec:			XCU Issue 4/5 

Resolution Request:
-------------------

I believe that some vendors have misinterpreted the description of
the -c option, and have taken the word "output" in "No output is
produced; only the exit code is affected" as meaning diagnostic output
to stderr as well as normal output to stdout.  On such systems,
executing

	echo 'b\na' | sort -c

produces an exit code of 1 but no diagnostic output, whereas most
systems give a diagnostic along the lines of "sort: disorder: a".

Based on recent rulings:

> 	Since the CONSEQUENCES OF ERRORS section of the ln description in
> XCU4 (pg 421) says "Default." and since the Utility Description Defaults
> description of CONSEQUENCES OF ERRORS on pg 15-16 says:
> 		...
> 		The following apply to each utility, unless otherwise stated:
> 			...
> 			A diagnostic message will be written to stderr
> 			whenever an error condition occurs.
> 		...
> Since an exit status greater than 0 is to be used only when an error
> occurred, this wording requires that a diagnostic message be written.

it would appear this should also apply to sort -c.

If the resolution is that "sort -c" must produce a diagnostic when the exit
code is 1, then the VSC test for this should be updated to check for
the diagnostic, because there is at least one UNIX95 branded system
that does not produce the diagnostic.


Resolution Response
-------------------

On revisiting the issue, the group feels that the return value of 1
for sort -c is covered under exit status as a valid status return
(i.e. not an error), the >1 cases being for an error  and thus
a diagnostic is not required.

The wording under Standard Error that links a diagnostic  to a non-zero
value means that a diagnostic is allowable.  It is recommended
that an interpretation be filed on the
issue of whether the diagnostics should be linked to a non-zero return status,
proposing that diagnostics only be required when an error occurs or
otherwise explicitly stated.



Rationale
-------------
None.
Circulated for review: Jan 30 1998
Recirculated: April 2001
Approved: May 2001