From 11126e430236ca221cfee68420b5da44ec3d47d5 Mon Sep 17 00:00:00 2001 From: moshix Date: Fri, 29 Dec 2017 00:08:32 -0600 Subject: [PATCH] new menu bash script --- menu.bash | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 menu.bash diff --git a/menu.bash b/menu.bash new file mode 100644 index 0000000..8676245 --- /dev/null +++ b/menu.bash @@ -0,0 +1,22 @@ +title="Moshix' Wonderful Ascii World" +prompt="Pick an option:" +options=("Star Wars" "Acquarium" "Mission Impossible Computer Screen") +trap ctrl_c INT +function ctrl_c() { + echo "** Trapped CTRL-C **" +} +today=$(date) +echo "$today" >> /home/asci/visitor.log +echo +echo +echo "$title" +PS3="$prompt " +select opt in "${options[@]}" "Quit"; do + case "$REPLY" in + 1 ) /home/asci/starwars/asciimation.awk ./starwars/data/sw1.txt;; + 2 ) /usr/local/bin/asciiquarium;; + 3 ) /usr/bin/hollywood;; + $(( ${#options[@]}+1 )) ) echo; echo; echo " OK, back to your terminal prompt...Goodbye!"; sleep 2; break;; + *) echo "Invalid option. Try another one.";continue;; + esac +done