GNU bug report logs - #19604
echo --help does not work

Previous Next

Package: coreutils;

Reported by: prateek goyal <prateek.goyal5 <at> gmail.com>

Date: Thu, 15 Jan 2015 07:06:01 UTC

Severity: normal

Tags: notabug

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

Bug is archived. No further changes may be made.

Full log


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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: prateek goyal <prateek.goyal5 <at> gmail.com>, Eric Blake <eblake <at> redhat.com>
Cc: 19604 <at> debbugs.gnu.org, Pádraig Brady <P <at> draigbrady.com>
Subject: Re: bug#19604: echo --help does not work
Date: Fri, 16 Jan 2015 10:49:06 +0100
On 01/15/2015 04:55 PM, prateek goyal wrote:
> So even if I execute following command, it gives same result:

> prateek <at> prateek-pc:~/Documents/awk$ env POSIXLY_CORRECT=1 echo --help
> --help

That is exactly what Eric said before: POSIX mandates to literally
output the string "--help" - which coreutils' echo does if the variable
POSIXLY_CORRECT is set.  Otherwise, the implementation extends the
functionality and adheres to GNU standards which mandates to honor
the "--help" option to output the usage message:

  $ env --unset=POSIXLY_CORRECT echo --help
  Usage: ...

Maybe you were confused by the use of the 'env' utility.
You'll get the same by specifying the echo with it's absolute path:

  $ which echo
  /usr/bin/echo
  $ unset POSIXLY_CORRECT
  $ /usr/bin/echo --help
  Usage: [...]

Have a nice day,
Berny




This bug report was last modified 10 years and 131 days ago.

Previous Next


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