In bash there are 2 options that I use.
1.
ArrayName=blah
printf -V "${ArrayName}[Index]" "%s" "Value To Set"
2.
ks_val_ChkName() {
local LC_COLLATE=C
case "${1:?Missing Variable Name}" in
[!a-zA-Z_]* | *[!a-zA-Z_0-9]* | '' ) return 3;;
esac
Sorry forgot the bit to retrive values
It is possible to retrive numeric values without eval
i.e.
val=$((${ArrayName}[Index]))
works quiet well and is quick, in fact I used to use this quiet a lot.
There is also a backdoor approach that I don't really advise.
val="${ArrayNam
John Kearney wrote:
Sorry forgot the bit to retrive values
It is possible to retrive numeric values without eval
i.e.
val=$((${ArrayName}[Index]))
works quiet well and is quick, in fact I used to use this quiet a lot.
There is also a backdoor approach that I don't really advise.
val="${A