There's got to be an easier way to do this, but not remembering or finding
it:
First tried the obvious:
declare -a ar1=([0]="1" [1]="2" [2]="3" [3]="44")
an=ar1
echo ${#!an[@]}
-bash: ${#!an[@]}: bad substitution
This works but feels kludgy
an=ar1
eval echo \${#$an[@]}
4
I thought the !na
Hello!
Am Tue, 20 Oct 2020 00:58:36 -0700 schrieb L A Walsh :
> There's got to be an easier way to do this, but not remembering or finding
> it:
>
> First tried the obvious:
> declare -a ar1=([0]="1" [1]="2" [2]="3" [3]="44")
> an=ar1
> echo ${#!an[@]}
> -bash: ${#!an[@]}: bad substitution
>
> T
On Tue, Oct 20, 2020 at 12:58:36AM -0700, L A Walsh wrote:
> There's got to be an easier way to do this, but not remembering or finding
> it:
>
> First tried the obvious:
> declare -a ar1=([0]="1" [1]="2" [2]="3" [3]="44")
> an=ar1
> echo ${#!an[@]}
> -bash: ${#!an[@]}: bad substitution
>
> This
Hello!
Am Tue, 20 Oct 2020 00:58:36 -0700 schrieb L A Walsh :
> There's got to be an easier way to do this, but not remembering or finding
> it:
>
> First tried the obvious:
> declare -a ar1=([0]="1" [1]="2" [2]="3" [3]="44")
> an=ar1
> echo ${#!an[@]}
> -bash: ${#!an[@]}: bad substitution
>
> T
Chet Ramey wrote:
> This release fixes several outstanding bugs in bash-5.0 and introduces
> several new features.
An unlisted change (I couldn't locate it in the changes) is that
'reverse-search-history (C-r)' now highlights the search pattern. Is
that because it is the search pattern or because
On 2020-10-20 13:44, Bob Proulx wrote:
Chet Ramey wrote:
This release fixes several outstanding bugs in bash-5.0 and introduces
several new features.
An unlisted change (I couldn't locate it in the changes) is that
'reverse-search-history (C-r)' now highlights the search pattern. Is
that beca
On 2020/10/20 01:29, Andreas Kusalananda Kähäri wrote:
In bash 4.3+, I would manke your "ar" variable a name reference variable
instead:
$ ar1=(1 2 3 44)
$ declare -n ar=ar1
$ echo "${#ar[@]}"
4
Ya, I was trying to use the 'byname' feature for older/wider support...sigh