bug-bash
[Top][All Lists]
Advanced

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

Re: documentation... readonly help is not accurate


From: Chet Ramey
Subject: Re: documentation... readonly help is not accurate
Date: Mon, 04 Mar 2013 08:51:57 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130216 Thunderbird/17.0.3

On 3/3/13 4:40 PM, Gotmy Nick wrote:
> Hello,
> 
>    Sorry if this has been reported earlier, but I can't find nothing
> related in the archives.
> 
>       $ help readonly | grep -- '-p'
>       readonly: readonly [-aAf] [name[=value] ...] or readonly -p
>             -p        display a list of all readonly variables and functions
> 
>       $ echo $BASH_VERSION
>       4.2.37(1)-release
> 
>    I think the description should say "or" instead of "and". I think
> it's the sorter way to clarify the behavior.
> 
>    This is, it will not print readonly functions unless called with
> -fp, and in such case, it will not print variables, so in my opinion,
> using "or" could be more accurate than "and".

This isn't accurate.  Run the following script:

foo()
{
        echo foo
}
bar=quux

readonly foo
readonly bar

readonly

In addition to the built-in bash readonly variables, both bar and foo will
be listed.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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