Hi,
I'm playing around with some bash. I am making a quick interface to eventually make a ssh connect menu.
My problem I'm having with the code below is that its not honoring my 'quit' and 'help'. When I enter a number for the host in question, it echos it out as expected.
I think I'm doing something wrong with strings and the case statements, but I'm not 100% sure.
Thanks in advance.
Code:
#!/bin/bash
PS3="Select: "
SERVERS=("host1" "host2" "host3")
select HOST in "${SERVERS[@]}";
do
case $HOST in
"quit")
echo "Qutting..."
break
;;
"help")
echo "Type in a number, we print it."
;;
*)
echo $HOST
;;
esac
done