bug-bash
[Top][All Lists]
Advanced

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

Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#le


From: L. A. Walsh
Subject: Re: 4.4 change in behavior from 4.3: how to catch unset when using ${#length}
Date: Fri, 28 Oct 2016 12:43:39 -0700
User-agent: Thunderbird



Chet Ramey wrote:
On 10/24/16 7:32 PM, L. A. Walsh wrote:

   I don't understand the ambiguity.  If param= "#obj[@]", then it
is clear to me that the user wants the length of an array named "obj".

Stop there.  In something like ${#obj[@]}, `param' is `obj[@]'.  The
`${#param}' is a clearly-defined word expansion, separate from the
`[:]-' forms:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

That's what we're talking about here.
----
   Please, I'm not running in posix mode, so how would their rules
apply?  Just because pi=3 under Indiana state rules some number of years
ago, doesn't mean it is.  Just because posix defines something a certain way
doesn't mean it should apply in a non-posix mode shell.





reply via email to

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