On 1/22/19 10:23 PM, Chet Ramey wrote:
On 1/22/19 3:32 PM, Robert White wrote:
Howdy,
The following cannot work because, for some reason, the array subscript
parser insists on doing math on array indices even when the array is
associative instead of numeric
typeset -A UUID_TABLE
...
UUID_TABLE+=( [${SOME_UUID}]=${SOME_VALUE} )
...
some_command ${UUID_TABLE[${SOME_UUID}]}
The parser and evaluator insist on doing math on ${SOME_UUID} no matter how
its quoted or whatever. This seems extremely wrong.
Do you have some sample UUID data to test this with?
I'm going to have to provisionally withdraw this report. The problem
only seems to happen in the custom /init script in my initramfs. Trying
to recreate it with a simpler script (and the same bash binary) on a
fully running system using the the UUIDs I collected with blkid doesn't
have a problem at all. So something "mysterious" is going on.
The initscript is part of https://sourceforge.net/projects/underdog/ (if
you care) and is part of my attempt to build a concordance of UUID to
device to manager (e.g. lvm vs mdadm vs whatever) app. It works well
except when it doesn't.
Thanks for the prompt response. If I isolate the test case or the issue
in general I'll be back. Even just to say never mind if I find a super
stupid mistake. 8-)
--Rob White.