[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding FAQ entry: shell built-in (echo/printf/etc.)
From: |
Eric Blake |
Subject: |
Re: Adding FAQ entry: shell built-in (echo/printf/etc.) |
Date: |
Wed, 12 Aug 2015 08:55:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 08/11/2015 11:51 AM, Assaf Gordon wrote:
> Hello,
>
> What do you think about adding a FAQ entry about confusing shell builtin
> with coreutils' programs?
>
> shell builtin functions on do not support --version:
>
> $ echo --version
> --version
> $ printf --version
> bash: printf: --: invalid option
> printf: usage: printf [-v var] format [arguments]
Not true for ksh where builtins DO support --help/--version. Also, a
future version of bash may follow suit from current ksh behavior:
$ ksh -c 'printf --version'
version printf (AT&T Research) 2009-02-02
[Note that ksh 'echo --version' outputs '--version', as POSIX does not
allow for extensions on that command; but presumably if bash adds
support for --help to its builtins, it will follow suit of coreutils in
having POSIXLY_CORRECT affect 'echo --version' behavior]
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: Adding FAQ entry: shell built-in (echo/printf/etc.),
Eric Blake <=