bug-bash
[Top][All Lists]
Advanced

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

Re: Empty array referenced by indirection reports unbound variable


From: konsolebox
Subject: Re: Empty array referenced by indirection reports unbound variable
Date: Thu, 30 Dec 2021 16:57:14 +0000

On Thu, Dec 30, 2021 at 4:35 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 12/27/21 11:37 PM, konsolebox wrote:
> > On Thu, Apr 8, 2021, 06:56 konsolebox, <konsolebox@gmail.com
> > <mailto:konsolebox@gmail.com>> wrote:
> >
> >     On Thu, Apr 8, 2021 at 2:44 AM Chet Ramey <chet.ramey@case.edu
> >     <mailto:chet.ramey@case.edu>> wrote:
> >      > Indirection does not check whether or not the variable it's 
> > indirecting
> >      > is $@/$* or ${array[@/*]}. It simply goes by the return value.
> >
> >     It looks like it can easily be fixed with this:
>
> Let's try it. Thanks for the report.

Thank you very much.  This will finally make `set -u` a completely
reliable function.  If I recall correctly, having want_indir set means
the indirection parameter is already valid, so there's no need to test
for other name-validity checks and go straight to checking the
indirected value.  Anyhow I've been using the patch since April and
have `set -u` set globally and I haven't had any issues related to it
since.


-- 
konsolebox



reply via email to

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