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


Message #42 received at 23090 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Ruediger Meier <sweet_f_a <at> gmx.de>, 23090 <at> debbugs.gnu.org
Subject: Re: bug#23090: true and false not POSIX
Date: Tue, 22 Mar 2016 10:48:16 -0600
[Message part 1 (text/plain, inline)]
On 03/22/2016 10:38 AM, Ruediger Meier wrote:
> I've seen many existing scripts where people do something like this:
> 
> cmd=whatever
> # ignore if not exist
> type "$cmd" || cmd="true"
> [...]
> $cmd --something --we --want --to --do --if --possible
> [...]

Such scripts are non-portable.  They could use:

type "$cmd" || cmd=:

for more portability.  It's not our fault that non-portable scripts exist.

> BTW this man page does not match to the most probably used built-in 
> command. This confuses the reader even more and is IMO another argument 
> why coreutils shouldn't have added --help options for these kind of 
> commands.

The man page (and --help output) specifically state:

       NOTE: your shell may have its own version of true, which usually
super‐
       sedes the version described here.  Please refer to your  shell's
 docu‐
       mentation for details about the options it supports.

So far, you haven't identified anything that we need to change in
behavior in either 'true' or 'false' (certainly not any changes required
for POSIX compliance, although it appears you are now moving on to
questioning our extension behavior when used in ways not mandated by
POSIX).  Therefore, I've taken the liberty of closing this bug report.
But feel free to continue discussion, and if you can come up with a
change that we _should_ make that won't disrupt existing clients, then
we can reopen the bug to track that.  Note that it is a high bar to
change the behavior of something like 'true'.

-- 
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.