bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bugreport 'sort'


From: Eric Blake
Subject: Re: Bugreport 'sort'
Date: Tue, 4 Mar 2008 16:28:12 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Pádraig Brady <P <at> draigBrady.com> writes:

> > Nice thought.  But it would violate POSIX if done by default
> 
> POSIX says you can't warn users about potential problems?

One person's bug is another person's feature.  The entire reason that 
LC_COLLATE exists is because some people INTENTIONALLY want to sort files in 
other than the C locale order, when they know what they are doing.  POSIX 
pretty much states that if an application prints a message to stderr, it should 
exit with non-zero status, unless explicitly mentioned otherwise in the POSIX 
requirements for that application.  And since sort doesn't know whether the 
user meant to use that LC_COLLATE setting, it would have to exit with 0 status, 
in spite of any warnings, for the case of the user that meant that sort order.  
Hence, there is no way to print a warning, be successful, and still comply with 
POSIX all at the same time.  True, we could key off of POSIXLY_CORRECT, but I'd 
rather minimize the (ab)use of that environment variable.

-- 
Eric Blake








reply via email to

[Prev in Thread] Current Thread [Next in Thread]