bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ability to display parameters as global with `declare -gp`


From: Chet Ramey
Subject: Re: Ability to display parameters as global with `declare -gp`
Date: Fri, 15 Dec 2023 11:43:51 -0500
User-agent: Mozilla Thunderbird

On 12/11/23 10:01 AM, Albert Akchurin wrote:

Bash Version: 5.2

Patch 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    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]