On Fri, Aug 20, 2021, at 6:11 PM, Léa Gris wrote:
> Le 21/08/2021 à 00:06, Chet Ramey écrivait :
> > The best way to clone an associative array is:
> > 
> > declare -A options
> > eval options=\( "${assoc[@]@K}" \)
> > 
> > The quoting @K performs is eval-safe.
> > 
> 
> Although I was not attempting to clone the Associative array but turn it 
> into a flat array with interleaved key and value each as own element.
declare -a options
eval options=\( "${assoc[@]@K}" \)

-- 
vq

Reply via email to