Hello.
I have an export of an associative array build using declare -p SOME_ARRAY_NAME > SOME_FILE_NAME.txt
.
Producing some thing like
declare -A SOME_ARRAY_NAME=( [toto]="some_text" [tata]="a_text" ......... [last]="another_text" )
in a text file.
I have a stock of functions which are sourced from /etc/profile.local
.
They are accessible for any script.
Moreover the associative array export file was created using one of these functions.
I can create an associative array by calling a function, but the array is not available outside the creative function.
Given a running script, by calling a function, I would like to create an associative array (with the same name as the name in the exported file) and fill it with the exported file.
The associative array should be available in the script calling the function and to any child script.
I would like to use only function and no hard coding.
Any help is welcome.