I'm having a trouble getting this working in bash, I have the following array
server-farm=("10.0.10.1" 10.0.10.2")
I would like to loop through this array and assign uniq variable to each element.
Desired results.
srv1 = 10.0.10.1
srv2 = 10.0.10.2
Is this possible?
This is what I have tried so far, but couldn't get it to work.
for i in "${server_farm[@]}"
do
echo $i
done
Thank you
${server_farm[0]}is the first entry,${server_farm[1]}is the second, etc.bashvariables can't have hyphens in their names. So your array assignment is a bit suspect to begin with...