[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Race in bash-4.3 'typeset'?
From: |
Chet Ramey |
Subject: |
Re: Race in bash-4.3 'typeset'? |
Date: |
Fri, 28 Oct 2016 10:00:26 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/25/16 4:09 PM, Stuart Shelton wrote:
> The cases appear, purely by inspection, to be:
>
> Not declared: trivially, `typeset -p` doesn’t include the value;
> Declared (even as local) but unassigned: `typeset -p` includes "declare --
> varname";
> Declared and assigned: `typeset -p` includes "declare -- varname=‘value’”
>
> … although how much of this is by design and how much by chance I’m not sure
> ;)
It's all by design. The idea is that you can use `typeset -p' to save and
restore the variable state. It's imperfect, I'm sure, and there are
probably missing edge cases, but that's the idea.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
Re: Race in bash-4.3 'typeset'?, Chet Ramey, 2016/10/28
Re: Race in bash-4.3 'typeset'?, L. A. Walsh, 2016/10/25