[Top][All Lists]

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

Re: Race in bash-4.3 'typeset'?

From: L. A. Walsh
Subject: Re: Race in bash-4.3 'typeset'?
Date: Tue, 25 Oct 2016 13:58:34 -0700
User-agent: Thunderbird

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 -- 
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
   Hmmm... you're right.  I guess it's my mind remembering that
it is "unbound" and trying to use it under "-u" will yield an error
(so I always try to set a value when declaring it, as declaring it, alone
doesn't "bind" it...)...  *kick self for even opening mouth...*... :-)

   I'm too used to programming with -u to detect unset vars...(which
are usually the result of typo's like:

if [[ $tst eq 1 ]];then echo "so? wrong var"; fi

Now if I were perfect, I wouldn't be using "-u". ;-)

reply via email to

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