From 14a892e627a375334a02381351f139d94ad7ecf3 Mon Sep 17 00:00:00 2001 From: ダカマ Date: Mon, 2 Jun 2025 13:08:46 +0200 Subject: First dump --- miscripts/choice.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 miscripts/choice.sh (limited to 'miscripts/choice.sh') 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 -- cgit v1.2.3