Im trying to learn a little a little more about scripting so im just writing simple scripts to try and get me going. I know there is a ton of documentation available on the web but sometimes it's a pain to dig around and find what I need. At this moment I am needing simple help with case statements.
Here is my simple script:
Code:
#!/bin/bash
clear
kv="uname -r"
ut="uptime"
echo "Press 1 to check kernel version."
echo "Press 2 to do nothing."
read userchoice
case "$userchoice" in
1)
clear; echo -n "Your kernel version is: "
$kv;
;;
2)
echo "Then Shut Up!";
;;
*)
echo "Press 1 or 2 jacka$$!";
;;
esac
My simple question is: How do I go back to the beginning of the script after the end the case statement? Is there a case statement command/function that does this? Or do I have recall the script within the script?
edit: in dos there is the goto command... is there something similar in bash?
Thanks!