help-bash
[Top][All Lists]
Advanced

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

Re: local functions


From: Christof Warlich
Subject: Re: local functions
Date: Fri, 11 Dec 2020 07:25:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Am 10.12.20 um 15:04 schrieb Eli Schwartz:

On 12/10/20 8:34 AM, Christof Warlich wrote:
$ help declare

says:

    ...
     When used in a function, `declare' makes NAMEs local, as with the
`local'
     command.
     ...
Thus, either the documentation or bash's behavior seens to be wrong,
right?

The only confusion here is you seem to think that the special options
-f, -F, -p are obeying the description "Declare variables and give
them attributes" in the first place.

Well, the general statement that "declare makes NAMEs local" _is_
confusing (at best). I would rephrase it to something like:

When using `declare` in a function to set attributes, it makes NAMEs
local, as with the `local`command.




reply via email to

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