summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/problem-13.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/bin/problem-13.sh b/bin/problem-13.sh
index b29cd4b..9322cd2 100755
--- a/bin/problem-13.sh
+++ b/bin/problem-13.sh
@@ -9,21 +9,39 @@ banner() {
echo "Enter your option and hit <Enter>:"
}
-main() {
- banner
+quit() {
+ exit 0
+}
+list() {
+ ls
+}
+print_date() {
+ date
+}
+logged_in() {
+ who
+}
+menu() {
read option
case "$option" in
- d) date
+ d) print_date
;;
- l) ls
+ l) list
;;
- w) who
+ w) logged_in
;;
- q) exit 0
+ q) quit
;;
esac
- exit 0
+}
+
+main() {
+ while true; do
+ banner
+ menu
+ done
+ quit
}
main