Can someone please help me with a bash script? Can't seem to wrap my mind aoround it.
Property
server1=abc,def,ghc
server2=xyz,tes,iuy
echo $server1
abc,def,ghc
echo $HOSTNAME
server1
with those info above, I want to output the output "abc,def,ghc" in a test variable.
echo \$$HOSTNAME
$server1
bash-4.1$ test=`echo \$$HOSTNAME`
bash-4.1$ echo $test
8722HOSTNAME
If someone can pls help me get this done in perl/bash or any code I can use pls. Thank you.