[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is this right? test -v $hash{defined_value} == false?
From: |
Linda Walsh |
Subject: |
Re: Is this right? test -v $hash{defined_value} == false? |
Date: |
Mon, 13 Jul 2015 23:31:23 -0700 |
User-agent: |
Thunderbird |
Chet Ramey wrote:
On 7/12/15 11:58 PM, Linda Walsh wrote:
set -A hash
This is an error
---
a brain-o -- at least I got the capitalized-A ;-)
(original code probably had a
hash hash
or
map hash
)
declare -A hash...
(I rarely type out the full command due to my aliases
and lazinesses....*ouch*)
hash=([defined_value]=22)
This creates an indexed array.
----
Um? Did you really assume I meant 'set'.. well
.... I better not ask... I _have_ been so spacey, which is
why I try to write aliases and trivial helper routines
I should stick to my aliases.. ;-)
Ishtar:/suse132> declare -A has
Ishtar:/suse132> has=([defined_value]=22)
Ishtar:/suse132> declare -p has
declare -A has='([defined_value]="22" )'
test/[/[[ -v didn't understand array variables and subscripts until bash-4.3.
----
Ahh.... that's what I was wondering... u
Thanks...