|
From: | Robert White |
Subject: | Re: UUID as Array Keys strangely not possible |
Date: | Sat, 26 Jan 2019 03:50:55 +0000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 1/22/19 10:23 PM, Chet Ramey wrote:
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.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?
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.
[Prev in Thread] | Current Thread | [Next in Thread] |