I searched for array and map structures on bash scripting. It seems a bit hard to locate the value of a key without looping through it. One of the topics I had a look was How to define hash tables in Bash?. It didn't help much to me though.
In simple words, I just want to be able to access any value without loops.
#!/bin/bash
ARRAY=("kevin:42"
"jack:45"
"tom:22")
echo printing jack value: ${ARRAY["jack"]#*:}
Output
printing jack value: 42
Expected Output
printing jack value: 45
If you know any simple ways to do so, would be awesome. Thanks for the help in advance!