I'm looking to write a bourne shell which loops through an array of hosts and performs an rsync for each. Something like:
HOSTS=("host1.domain.com", "host2.domain.com")
for HOST in $HOSTS
do
HOST_DIR_NAME = ${HOST//./-}
rsync backup_user@$HOST:/backup/blah/blah /backup/$HOST_DIR_NAME/blah/blah
done
The issue is, however, it appears that the array above is not working as expected, as upon looping through the array I see the following output:
wwcprod.plyinc.com,
Every online guide I find says that I'm defining the array correctly, but its obviously not working. Help!
Thanks!