Quote:
Originally Posted by bluethundr
Code:
printf "Enter Number of Instances: "
read -r num_instances
if (( "$num_instances" > 1 )); then
while [ "$num_instances" ]
do
printf "Enter a server name: "
read -a server_names
done
else
printf "Enter a server name: "
read -r name_tag
fi
|
You never count down num_instances, so that the while loop will run forever.
You may want to add code that checks if num_instances is really a number. Inside ((...)), you don't need the dollar or the quote characters; the code is prettier without them. Instead of [[...]], you can use ((...)), again without dollar or quotes.
Why do you distinguish between the two cases of a single server and more than one server? It seems to me that this makes your program overly complicated.