0

depending of which host I am I need to call array

for example:

!#bin/sh
hostname1=(1 2 3 4)
hostname2=(5 6 7 8)
myhostname=hostname1
x=${$myhostname[0]}
echo $x

however I'm getting error: bad substitution

0 Answers0