Heres the bash script:
ALL="2 3"
VC2="https://someaddress.acme.com"
VC3="https://someotheraddress.acme.com"
hosts2='12
13
14'
hosts3='15
16
17'
for i in $ALL
do
Here is where i want the substitution but no matter what i use it doesn't work. I tried all of the following
VC="$VC$i"
VC="${VC$i}"
VC="$(VC$i)"
VC=$(VC$i)
HOSTS="$hosts$i"
echo "$VC"
echo "$HOSTS"
the output i need is for each of the numbers in the ALL variable to then equal the predefined VC and hosts variables. i.e.
When i=2:
i=2
VC="https://someaddress.acme.com"
HOSTS='12
13
14'
and when i=3
i=3
VC="https://someotheraddress.acme.com"
HOSTS='15
16
17'
Thanks in advance.
Thomas