bash: set array env variable and de-referencing it from any shell script fails

Read the fine manual, "bugs" section.

Array variables may not (yet) be exported.

Though, I don't know that many consider this an actual bug. Other shells that support ksh-style arrays don't allow exporting them either.

You may pass around array definitions rather easily, through parameters or variables or the environment. It isn't usually very useful though.

function f {
    unset -v "$2"
    typeset "$2"
    eval "${!1}"
    typeset -p "$2"
}

typeset -a a=(a b c)
myArr=$(typeset -p a) f myArr a

The misunderstanding is in thinking that environment variables are only used by shells - they are not. No attributes, including readonly, integer, and arrays, can be exported into the environment block. Environment variables may be read by any language, C, C++, Perl, Java, Python, PHP, and so on. They also exist on Windows.

So, how could another language support Bash specific attributes? All environment variables are converted to strings, except in Bash where array values are not exported at all.

Korn shell will export just the first element. ksh93 also does some exec exploitation to preserve variable attributes exported to Korn shell children.

By the way, it is considered bad practice to use UPPERCASE for variable names, since they could collide with those used by the shell. Also, on Bash 3, the name STRING has issues when exported (fixed in Bash 4).