Hey guys, i've been searching all over the internet to try and figure this one out, and I stumbled across this forum. It seemed like a good place to get some help
I'm new to Linux and Bash, and i'm trying to write my first proper script at the moment. However i'm stuck trying to create a working loop for a case statement.
It goes something like this:
Code:
echo "Selection 1"
echo "Selection 2"
echo "Selection 3"
echo -n "Enter selection"
read x
case $x in
1) #Selection 1 code here
;;
2) #Selection 2 code here
;;
3) #Selection 3 code here
;;
*) #Default code here
esac
Basically i've been trying to write a loop that lets me go back to the start of the program so the user can input another selection once their first selection has been displayed.
I tried using something like:
Code:
loop=0
while [$loop = 0 ]
do
....code....
done
But that just loops the program endlessly.
Is there any simple way to achieve what I'm wanting to do?
Any help is much appreciated.
