Re: Local variable can not unset within shell functions
From:
Chet Ramey
Subject:
Re: Local variable can not unset within shell functions
Date:
Mon, 15 Jul 2024 10:01:21 -0400
User-agent:
Mozilla Thunderbird
On 7/11/24 8:40 PM, Robert Elz wrote:
Further, if "localness" is considered an attribute of a variable (which
isn't how I would implement it, but assuming it is) then surely declare
should have an option to set the local attribute,
It doesn't need one; using declare in a shell function is sufficient to
create a local variable.
and declare -p should
generate a command which restores that (just as it does for the export
attribute, the integer attribute, and I assume, others.
And we have made a complete circle back to where this began.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/