admin管理员组

文章数量:1295130

I would like make a associative array and as values I would like to have array with name like keyv.

For example:

#!/bin/zsh

$key='key'

typeset -A associative_array
typeset -a "${(p)key}v"
"${(p)key}v"=( value1 )
"${(p)key}v"+=( value2 )
associative_array[${key}]="${(p)key}v"

But I've got an error:

./test.sh:7: unknown file attribute:

which is on the line: "${(p)key}v"=( value1 )

Is there a way to do it?

Many thanks for advices.

本文标签: How make array in zsh with name derived from variableStack Overflow