Strange variable asignement in bash script
Hi guys
I've finished a very simple script to manage some remote servers in bash. My
script works for 1 host and all test or for 1 test in all hosts... the
problems is when i try to make a loop to make it for all test and hosts.
I have 2 variables with some values
TEST="service1 service2 service3"
HOSTs="server1.mynet server2.mynet server3.mynet"
I want to do something like this;
for I in `echo $TEST`
do
for J in `echo $HOSTS`
do
.....
.....
.....
$TEST.$HOST="some value"
done
done
the result must be:
service1.server1.mynet="some value"
service1.server2.mynet="some value"
service1.server3.mynet="some value"
service2.server1.mynet="some value"
service2.server2.mynet="some value"
service2.server3.mynet="some value"
..... etc.
I have quite experience with bash... But this is the first time I see that
problem I can't create a variable like this $TEST.$HOST in the left side of =
anyone can help me to handle this?
Thanks a lot!
Juan
--
----------------------------------------------------------------------------
Usuario Linux Registrado: 257202
http://perso.wanadoo.es/elsotanillo (en construcción)
----------------------------------------------------------------------------
Reply to: