Skip to main content

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

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

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
added 5 characters in body; added 4 characters in body
Source Link
MO12
  • 409
  • 1
  • 6
  • 19

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

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 script at line 3

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

added 34 characters in body
Source Link
MO12
  • 409
  • 1
  • 6
  • 19

What am I doing wring here. I am trying to map a hostname to a queue manager name and 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 script at line 3

What am I doing wring here. I am trying to map a hostname to a queue manager name and using the following array

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 script at line 3

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 script at line 3

Source Link
MO12
  • 409
  • 1
  • 6
  • 19
Loading