[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: documentation... readonly help is not accurate
From: |
Gotmy Nick |
Subject: |
Re: documentation... readonly help is not accurate |
Date: |
Mon, 4 Mar 2013 17:12:31 +0100 |
On 4 March 2013 14:51, Chet Ramey <chet.ramey@case.edu> wrote:
>
> 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.
Maybe I'm wrong, but this is creating a variable "foo" which is empty.
After this, we can re-declare foo() and it works. For example foo() {
echo bar; }
But trying foo=1 fails (as we created a readonly variable).
Maybe this is more clear to explain what I was stating:
foo1 () { echo foo1; }
readonly -f foo1
foo2=1
readonly foo2
readonly -pf
readonly
Best regards
--
IƱigo Tejedor Arrondo