Hi everyone,

It seems Bash 4.2.37 doesn't allow functions to redefine global constants
locally, yet it allows redefining constants local to calling functions.
Is this as supposed to be, or is it a bug?

I.e. this:

    bash -c 'declare -r v; a() { declare -r v; }; a'

Results in:

    bash: line 0: declare: v: readonly variable

While this works:

    bash -c 'a() { declare -r v; }; b() { declare -r v; a; }; b'

Thank you.

Sincerely,
Nick

Reply via email to