summaryrefslogtreecommitdiff
path: root/miscripts/choice.sh
diff options
context:
space:
mode:
authorダカマ <dakama@kakeranoumi.xyz>2025-06-02 13:08:46 +0200
committerダカマ <dakama@kakeranoumi.xyz>2025-06-02 13:08:46 +0200
commit14a892e627a375334a02381351f139d94ad7ecf3 (patch)
treee7c1ee5040f3076f57401b3b9e9eb567e2ecfb1a /miscripts/choice.sh
First dumpHEADmaster
Diffstat (limited to 'miscripts/choice.sh')
-rw-r--r--miscripts/choice.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/miscripts/choice.sh b/miscripts/choice.sh
new file mode 100644
index 0000000..c2f4e16
--- /dev/null
+++ b/miscripts/choice.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Bash Menu Script Example
+
+PS3='Please enter your choice: '
+options=("Option 1" "Option 2" "Option 3" "Quit")
+select opt in "${options[@]}"
+do
+ case $opt in
+ "Option 1")
+ echo "you chose choice 1"
+ ;;
+ "Option 2")
+ echo "you chose choice 2"
+ ;;
+ "Option 3")
+ echo "you chose choice $REPLY which is $opt"
+ ;;
+ "Quit")
+ break
+ ;;
+ *) echo "invalid option $REPLY";;
+ esac
+done \ No newline at end of file