The GNU Bourne-Again SHell - Patches: patch #8733, let `declare -p -g FOO' generate...
You are not allowed to post comments on this tracker with your current authentication level.
patch #8733: let `declare -p -g FOO' generate global declarations
Submitter: | Colin Fraizer <cfraizer> | ||
Submitted: | Sat 05 Sep 2015 07:38:12 AM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | Wont Do | Privacy: | Public |
Assigned to: | None | Open/Closed: | Open |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2019-07-20 | chet | Status | None | Wont Do | |
2015-09-05 | cfraizer | Carbon-Copy | - | Added cfraizer |
Powered by Savane 3.13-d3ae.
Corresponding source code
As I think is common, I use ``declare -p FOO > my_file'' in shell functions to persist variables (especially arrays and associative arrays) into files.
For modularity, I would like to use a shell function to load those persisted values when (if) they are needed with ``source my_file''. My problem is that, if FOO is a global variable, it is persisted as ``declare -a FOO...'', but I want it persisted as ``declare -a -g FOO'' so it will be visible in the global namespace of my shell after the function returns.