GNU bug report logs - #23090
true and false not POSIX

Previous Next

Package: coreutils;

Reported by: Ruediger Meier <sweet_f_a <at> gmx.de>

Date: Tue, 22 Mar 2016 12:44:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Stephane Chazelas <stephane.chazelas <at> gmail.com>, Ruediger Meier <sweet_f_a <at> gmx.de>
Cc: 23090 <at> debbugs.gnu.org
Subject: bug#23090: true and false not POSIX
Date: Tue, 22 Mar 2016 09:27:07 -0600
[Message part 1 (text/plain, inline)]
On 03/22/2016 09:08 AM, Stephane Chazelas wrote:
>> BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth to 
>> violate parts of POSIX just for minor cosmetical reasons?
>>
>> I mean echo -n/-e may be an improvement though non-posix. But 
>> echo --version is a violation just for cosmetics, true --version is 
>> even worse.
> 
> AFAICT, echo --version is a violation, true --version is not.

'echo --version' is not a violation.  POSIX says that you are allowed to
require the user to set a particular environment variable to enter the
POSIX-conformant setup; in GNU coreutils' case, that variable is
POSIXLY_CORRECT.  When set, coreutils' echo behaves exactly as POSIX
requires.  When not set, coreutils' echo behaves as GNU Coding Standards
require.  As the two standards conflict, we cannot do both behaviors at
once; so the behavior of choice is determined by your environment variables.

In the case of 'true' and 'false', the two standards do not conflict, so
we implement both of them at once without the need to resort to reading
POSIXLY_CORRECT from the environment.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 60 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.