I am trying to map a hostname to a queue manager name using the following array. I get an error with bad array script. What am I doing wrong here
declare -A managers
while read -r mgr host; do
managers[$mgr]=$host
done < file.txt
QMGR=$(cat qmgr.txt)
host=${managers[$QMGR]}
I get the following error:
Bad array sub script at line 3
Bad array sub script at line 3