Is there a way to copy an associative array? I realize that regular arrays can be copied easily with a one liner as such:
set -A NEW_ARRAY $(echo ${OTHER_ARRAY[*]})
but doing so with associative arrays just gives you the values in that manner.
I know about nameref but I’m interested in knowing if there’s a way of copying the array such that the original array isn’t affected.
untested:
tested:
Result: