Re: General Associative Array problem -- Was: UUID as Array Keys strangely not possible

2019-02-22 Thread Eduardo A . Bustamante López
On Sat, Feb 23, 2019 at 01:48:08AM +, Robert White wrote: (...) > Your syntax checker is straight tripping on that SC1036 error dude. Array > assignment using ARRAYNAME=( expression ) is completely legal and correct > with or without the eval. The structure even allows for line continuation > j

Re: General Associative Array problem -- Was: UUID as Array Keys strangely not possible

2019-02-22 Thread Robert White
On 2/22/19 4:17 PM, Eduardo Bustamante wrote: On Fri, Feb 22, 2019 at 3:24 AM Robert White wrote: (...) tail --lines=+3 /proc/partitions | grep -v ram | while read -a RECORD do (...) eval [${INLINE[UUID]}]=boo (...) done echo " Keys: " "${![@]}" = "${[@]}" echo "

Re: General Associative Array problem -- Was: UUID as Array Keys strangely not possible

2019-02-22 Thread Eduardo Bustamante
On Fri, Feb 22, 2019 at 3:24 AM Robert White wrote: (...) > tail --lines=+3 /proc/partitions | grep -v ram | > while read -a RECORD > do (...) > eval [${INLINE[UUID]}]=boo (...) > done > > echo " Keys: " "${![@]}" = "${[@]}" > echo " Keys: " "${![@]}" = "${[@]}" >

Re: General Associative Array problem -- Was: UUID as Array Keys strangely not possible

2019-02-22 Thread Chet Ramey
On 2/22/19 6:23 AM, Robert White wrote: > Consider the script at the end of this email. It's effectively impossible > to get or to accept the various values. What are "the various values"? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa,

General Associative Array problem -- Was: UUID as Array Keys strangely not possible

2019-02-22 Thread Robert White
Consider the script at the end of this email. It's effectively impossible to get or to accept the various values. Either that or I am doing something incredibly stupid. (It took me a while to factor this down and try virtually every workaround that would not involve writing exte

Re: UUID as Array Keys strangely not possible

2019-01-29 Thread Ángel
On 2019-01-26 at 07:55 +, Robert White wrote: > I've already gone through and replaced or refactored all the > double-square-bracket evaluations with single-square-bracket > expressions, and otherwise looked for any explicit arithmatic contexts > that might be confusing the issue. > > The c

Re: UUID as Array Keys strangely not possible

2019-01-25 Thread Robert White
On 1/26/19 4:37 AM, Dennis Williamson wrote: On Fri, Jan 25, 2019, 9:51 PM Robert White 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 e

Re: UUID as Array Keys strangely not possible

2019-01-25 Thread Dennis Williamson
On Fri, Jan 25, 2019, 9:51 PM Robert White 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 > >>

Re: UUID as Array Keys strangely not possible

2019-01-25 Thread Robert White
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

Re: UUID as Array Keys strangely not possible

2019-01-23 Thread Chet Ramey
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}]=${SOM

Re: UUID as Array Keys strangely not possible

2019-01-22 Thread Chet Ramey
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}]=${SOM

UUID as Array Keys strangely not possible

2019-01-22 Thread Robert White
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}]