GNU bug report logs - #5817
"false" core util

Previous Next

Package: coreutils;

Reported by: phoenix <7times191 <at> googlemail.com>

Date: Thu, 1 Apr 2010 14:14:02 UTC

Severity: normal

Tags: moreinfo, unreproducible

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


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

From: Bob Proulx <bob <at> proulx.com>
To: phoenix <7times191 <at> googlemail.com>
Cc: 5817 <at> debbugs.gnu.org
Subject: Re: bug#5817: "false" core util
Date: Sat, 3 Apr 2010 15:21:03 -0600
tags 5817 + moreinfo unreproducible
thanks

phoenix wrote:
> I've found a serious error in the program "false": If I pipe some text to it
> (e.g. echo "i lost the game" | false), it does not fail but rather returns a
> success. Any suggestions?

As others noted the 'false' command is a builtin to most shells.
Therefore if you execute the following you are not getting the
coreutils version of false but are instead getting your shell builtin
version of false.  In this case I am running bash and bash detects the
error.

  $ echo foo | false
  -bash: echo: write error: Broken pipe
  $ echo $?
  1
  $ type false
  false is a shell builtin
  $ help false
  false: false
    Return an unsuccessful result.

In order to get the coreutils version you would need to specify a path
to it.  But the shell should still detect this error.

  $ echo foo | /bin/false
  -bash: echo: write error: Broken pipe
  $ echo $?
  1

The main reason for a standalone executable is for legacy
compatibility and also on those occations when a program that isn't a
shell needs to exec a program.

> I need this program very much for completing my thesis on
> Pseudo-Riemannian manifolds.

Nice!  And on April 1st too!

> It would very kind of you if you'd inform me when the error has been fixed.
> (Remark: I am using Ubuntu 9.10.)

I do not presently have an Ubuntu system available to test this upon
but I believe it to be a problem specific to either your shell or to
your environment.  Coreutils false doesn't have this problem.  Neither
does Debian which as you know is the basis for Ubuntu.

Humorous Side Note: It has been remarked that false is actually more
portable than true.  Because if it doesn't exist the shell's exit
status is still failure.

Bob




This bug report was last modified 15 years and 99 days ago.

Previous Next


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