On 12/11/23 10:01 AM, Albert Akchurin wrote:
Bash Version: 5.2Patch Level: 21 Release Status: release Description: `declare -p` loses the global flag passed to variable/array on definition. I think this behaviour is reasonable, but sometimes I need to save/restore Global variables in the function. Unfortunately when I source saved variables from a function the variables are scoped to that function. Could you please add the ability to display all the variables as global when using '-g' along with '-p' option? No internal checks needed, just Put the '-g' flag when displaying each variable definition requested.
I will consider this for a future version. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature