Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread L A Walsh
On 2022/03/23 09:49, Chet Ramey wrote: On 3/23/22 7:56 AM, Robert Elz wrote: You might not like the terminology, but it is what it is, and you don't get to arbitrarily redefine it, unless you change your name to Humpty Dumpty. Bonus points for the "Through the Looking Glass"

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Chet Ramey
On 3/23/22 7:56 AM, Robert Elz wrote: You might not like the terminology, but it is what it is, and you don't get to arbitrarily redefine it, unless you change your name to Humpty Dumpty. Bonus points for the "Through the Looking Glass" reference. -- ``The lyf so short, the craft so long to

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Chet Ramey
On 3/21/22 8:45 AM, Andreas Luik wrote: Bash Version: 4.4 Patch Level: 20 Release Status: release Description: Bash fails to correctly test for parameter to be unset or null when the parameter is an array reference [*] or [@]. Repeat-By: myvar[0]= echo "${myvar[0]:+nonnull}" -> OK

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Alex fxmbsw7 Ratchev
there is nothing but a simple str minus str, results in null string some, internal check, to make null nothing strings marked non existing, is up to you to code, and yet such doesnt exist much i think in sh bashism On Wed, Mar 23, 2022, 12:44 Greg Wooledge wrote: > On Wed, Mar 23, 2022 at

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Robert Elz
Date:Wed, 23 Mar 2022 01:48:48 -0700 From:L A Walsh Message-ID: <623adef0.1060...@tlinx.org> | POSIX phraseology applies to the POSIX language. Which bash is an (extended) implementation of. | In 'C' Completely irrelevant. | In perl: Also irrelevant.

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Robert Elz
Date:Wed, 23 Mar 2022 07:38:39 -0400 From:Greg Wooledge Message-ID: | But as it happens, the writers of the POSIX standards *did* use that | word in some places, and so we have to live with it. The usage much predates POSIX or any of the previous standards. It

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Greg Wooledge
On Wed, Mar 23, 2022 at 01:48:48AM -0700, L A Walsh wrote: > On 2022/03/23 00:25, Ilkka Virta wrote: > > The POSIX phraseology is that "null" means the empty string. > >POSIX phraseology applies to the POSIX language. > > In 'C' > > char *s = NULL > is not the same as > char *s="";

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread L A Walsh
On 2022/03/23 00:25, Ilkka Virta wrote: The POSIX phraseology is that "null" means the empty string. POSIX phraseology applies to the POSIX language. In 'C' char *s = NULL is not the same as char *s=""; They aren't the same at the machine level nor at the language level. In

Re: parameter expansion null check fails for arrays when [*] or [@] is used

2022-03-23 Thread Ilkka Virta
On Tue, Mar 22, 2022 at 11:52 PM L A Walsh wrote: > On 2022/03/21 05:45, Andreas Luik wrote: > > Description: > > Bash fails to correctly test for parameter to be unset or null > when the parameter is an array reference [*] or [@]. > > > > Repeat-By: > > > > myvar[0]= > > echo