echo "1) aragorn.domain.net"
echo "2) marvel.domain.net"
echo "3) athena.domain.net"
echo "4) gandalf.domain.net"
echo "5) griffin.domain.net"
echo "What server would you like to connect to?(1-5)
read input
if [$input=1]
then
ssh aragorn.domain.net
elif [$input=2]
then
ssh marvel.domain.net
elif [$input=3]
then
ssh athena.domain.net
elif [$input=4]
then
ssh gandalf.domain.net
elif [$input=5]
then
ssh griffin.domain.net
else
echo"wrong choice"
fi
By the way, another way to do what you are trying to do would be to use "select":
set -A domain aragorn.domain.net marvel.domain.net athena.domain.net gandalf.domain.net griffin.domain.net
PS3="What server would you like to connect to? (1-5): "
select mydomain in ${domain[*]}
do
ssh $mydomain
break
done
1) aragorn.domain.net
2) marvel.domain.net
3) athena.domain.net
4) gandalf.domain.net
5) griffin.domain.net
What server would you like to connect to? (1-5):
$mydomain will be the domain, and $REPLY will be the number chosen by the user.