bug-coreutils
[Top][All Lists]
Advanced

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

bug#19604: echo --help does not work


From: Eric Blake
Subject: bug#19604: echo --help does not work
Date: Thu, 15 Jan 2015 07:09:18 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 01/15/2015 04:36 AM, Pádraig Brady wrote:
> tag 19604 notabug
> close 19604
> stop
> 
> On 15/01/15 06:20, prateek goyal wrote:
>> Hi,
>>
>>
>> when I try to use --help option with echo command, it does not print help 
>> contents, but prints "--help".
>>
>>
>> address@hidden:~/Documents/awk$ echo --help
>> --help
> 
> You're actually using your shell's echo there.
> To use the coreutils one:
> 
>   env echo --help

Furthermore, the behavior you saw in your shell is required by POSIX.
If you do 'env POSIXLY_CORRECT=1 echo --help', you will get the same
behavior from coreutils as you did from your shell.  'echo' is one of
the few utilities that _cannot_ honor --help for compatibility reasons.


> Note newer versions of bash will support $builtin --help,
> though I've not tested the echo case which would
> introduce a change in behavior.

If bash changes the behavior of 'echo --help' in POSIX mode, then that
would be a bug in bash.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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